| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <com-list-page :crumbs="crumbs" id="application">
- <com-list-table
- ref="table"
- :api="'qi-juhe/notice/index'"
- :search-list="searchList"
- >
- <el-table-column prop="id" width="80px" label="ID" align="center">
- </el-table-column>
- <el-table-column prop="type_text" width="120px" label="通知类型" align="center">
- </el-table-column>
- <el-table-column prop="data" min-width="500px" label="推送数据" align="center">
- </el-table-column>
- <el-table-column prop="response" label="响应数据" align="center">
- </el-table-column>
- <el-table-column prop="created_at" min-width="120px" label="通知时间" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </com-list-table>
- </com-list-page>
- <script>
- const application = new Vue({
- el: '#application',
- data: {
- type_list: [],
- supply_list: [],
- crumbs: [
- {
- title: '首页',
- router: 'mall/overview/index',
- },
- {
- title: '通知日志',
- }
- ],
- searchList: [
- {
- key: 'supply_id',
- title: '供应链',
- type: 'select',
- options: [],
- valueKey: {
- label: 'app_name',
- value: 'id',
- },
- },
- {
- key: 'type',
- title: '通知类型',
- type: 'select',
- options: [],
- valueKey: {
- label: 'label',
- value: 'value',
- },
- },
- {
- key: 'data',
- title: '内容',
- type: 'text',
- },
- ],
- },
- methods: {
- getType() {
- let self = this;
- request({
- params: {
- r: 'qi-juhe/notice/type',
- },
- method: 'get',
- }).then(e => {
- let data = []
- Object.keys(e.data.data).forEach(element => {
- data.push({
- label: e.data.data[element],
- value: element,
- })
- });
- this.searchList[1].options = data
- }).catch(e => {
- console.log(e);
- })
- },
- getSupply() {
- let self = this;
- request({
- params: {
- r: 'qi-juhe/supplys/index',
- },
- method: 'get',
- }).then(e => {
- this.searchList[0].options = e.data.data.list
- }).catch(e => {
- console.log(e);
- })
- }
- },
- mounted: function() {
- this.getType()
- this.getSupply()
- },
- });
- </script>
|