02c3fffd288e1a5fd14ad9fec0c1a6f8.json 9.2 KB

1
  1. {"remainingRequest":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/thread-loader/dist/cjs.js!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/babel-loader/lib/index.js!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js??ref--0-0!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/src/view/system-config/systemNotice.vue?vue&type=script&lang=js&","dependencies":[{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/src/view/system-config/systemNotice.vue","mtime":1618306924000},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js","mtime":1665684022107},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/thread-loader/dist/cjs.js","mtime":1665684003955},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/babel-loader/lib/index.js","mtime":1665684010704},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js","mtime":1665684022107},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/vue-loader/lib/index.js","mtime":1665684006084}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport axios from '@/libs/api.request';\nexport default {\n name: 'systemNotice',\n\n data() {\n return {\n btnLoading_pass: false,\n currentPage: 1,\n total: 0,\n showNoticeModal: false,\n eduModalTitle: 'addnew',\n // 查询条件\n pagenum: 10,\n // 新增数据对象\n addData: {\n title: '',\n content: '',\n province: '',\n city: '',\n district: ''\n },\n editPid: '',\n editCid: '',\n editDid: '',\n provinceList: [],\n // 省列表\n cityList: [],\n // 市列表\n districtList: [],\n // 区列表\n publishType: '1',\n // 发布对象\n addRule: {\n title: [{\n required: true,\n message: '请先填写公告标题',\n trigger: 'blur'\n }],\n content: [{\n required: true,\n message: '请先填写公告内容',\n trigger: 'blur'\n }],\n province: [{\n validator: (rule, value, callback) => {\n if (this.publishType == 1) {\n callback();\n } else {\n if (!value) {\n return callback(new Error('请选择省'));\n } else {\n callback();\n }\n }\n },\n trigger: 'blur'\n }],\n city: [{\n validator: (rule, value, callback) => {\n if (this.publishType == 1) {\n callback();\n } else {\n if (!value) {\n return callback(new Error('请选择市'));\n } else {\n callback();\n }\n }\n },\n trigger: 'blur'\n }],\n district: [{\n validator: (rule, value, callback) => {\n if (this.publishType == 1) {\n callback();\n } else {\n if (!value) {\n return callback(new Error('请选择市'));\n } else {\n callback();\n }\n }\n },\n trigger: 'blur'\n }]\n },\n columns: [{\n title: ' 排序',\n key: 'id'\n }, {\n title: '标题',\n key: 'title'\n }, {\n title: '更改时间',\n key: 'updated_at'\n }, {\n title: '创建时间',\n key: 'created_at'\n }, {\n title: '操作',\n key: 'action',\n align: 'center',\n render: (h, params) => {\n return h('div', [h('Button', {\n props: {\n size: 'small',\n type: 'primary'\n },\n style: {\n marginTop: '5px',\n marginBottom: '5px'\n },\n on: {\n click: () => {\n this.eduModalTitle = 'check';\n this.showNoticeModal = true; // this.addData = params.row\n\n this.addData.title = params.row.title;\n this.addData.content = params.row.content;\n this.addData.province = params.row.province; // 这里的赋值不会触发 省select的on-change,具体原因不只\n\n this.getCity(); // 不对city 和 district,因为会查出相对应的 select的on-change,采用手动调用 getCity()的方式\n\n if (params.row.province) {\n this.editPid = params.row.province, this.editCid = params.row.city, this.editDid = params.row.district, // this.getProvince('check')\n this.publishType = '2';\n } else {\n this.publishType = '1';\n }\n }\n }\n }, '查看')]);\n }\n }],\n tableData: []\n };\n },\n\n created() {\n this.getList();\n this.getProvince();\n },\n\n methods: {\n // 分页\n levelchangepage(res) {\n this.currentPage = res;\n this.getList();\n },\n\n // 打开新增广告弹窗\n openNoticeModal() {\n this.eduModalTitle = 'addnew', this.publishType = '1', this.addData.title = '';\n this.addData.content = '';\n this.showNoticeModal = true;\n },\n\n // 获取列表信息\n getList() {\n axios.request({\n method: 'POST',\n url: '/admins/system/notice',\n data: {\n page: this.currentPage\n }\n }).then(res => {\n if (res.data.code === 'success') {\n this.tableData = res.data.data.data;\n this.total = res.data.data.total;\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n // 新增促销活动\n saveAdd(name) {\n this.$refs[name].validate(valid => {\n if (valid) {\n var that = this;\n that.btnLoading_pass = true;\n var addData = {\n title: this.addData.title,\n content: this.addData.content\n };\n\n if (this.publishType == 2) {\n addData['province'] = this.addData.province;\n addData['city'] = this.addData.city;\n addData['district'] = this.addData.district;\n }\n\n axios.request({\n url: '/admins/system/notice/edit',\n data: addData,\n method: 'POST'\n }).then(res => {\n if (res.data.code === 'success') {\n that.showNoticeModal = false;\n that.getList();\n }\n\n that.$Message.info(res.data.message);\n that.btnLoading_pass = false;\n });\n } else {// this.$Message.error('Fail!');\n }\n });\n },\n\n getProvince() {\n axios.request({\n method: 'GET',\n url: '/admins/area/0'\n }).then(res => {\n if (res.data.code === 'success') {\n this.addData.province === '' && (this.addData.province = res.data.data.list[0].id);\n this.provinceList = res.data.data.list;\n this.getCity();\n } else {\n this.$vux.toast.text(res.data.message, 'middle');\n }\n });\n },\n\n getCity() {\n var id = this.addData.province;\n this.editCid && (id = this.editCid);\n axios.request({\n method: 'GET',\n url: '/admins/area/' + id\n }).then(res => {\n if (res.data.code === 'success') {\n this.cityList = res.data.data.list;\n\n if (this.editCid) {\n this.addData.city = this.editCid;\n this.editCid = ''; // 第一次赋值之后置空\n } else {\n this.addData.city = res.data.data.list[0].id;\n }\n\n this.getDistrict();\n } else {\n this.$vux.toast.text(res.data.message, 'middle');\n }\n });\n },\n\n getDistrict() {\n var id = this.addData.province;\n this.editDid && (id = this.editDid);\n console.log('getDistrict', this.addData.city);\n axios.request({\n method: 'GET',\n url: '/admins/area/' + this.addData.city\n }).then(res => {\n if (res.data.code === 'success') {\n this.districtList = res.data.data.list;\n\n if (this.editDid) {\n this.addData.district = this.editDid;\n this.editDid = ''; // 第一次赋值之后置空\n } else {\n this.addData.district = res.data.data.list[0].id;\n }\n } else {\n this.$vux.toast.text(res.data.message, 'middle');\n }\n });\n }\n\n }\n};",null]}