67710d195bde135fec64c7c31d60f49c.json 13 KB

1
  1. {"remainingRequest":"/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=style&index=0&lang=css&","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/css-loader/index.js","mtime":1665684004023},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":1665684006115},{"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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.mt10 {\n margin-top: 10px;\n}\n",{"version":3,"sources":["systemNotice.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgVA;AACA;AACA","file":"systemNotice.vue","sourceRoot":"src/view/system-config","sourcesContent":["<template>\n <div>\n <Card>\n <Row>\n <Button type=\"primary\" v-opcode=\"'admins/notice/notice/edit'\" @click=\"openNoticeModal()\">\n <Icon type=\"md-add\" />新增公告\n </Button>\n </Row>\n <Row class=\"mt10\">\n <Table border ref=\"selection\" :columns=\"columns\" :data=\"tableData\">\n </Table>\n </Row>\n <!-- 页码 -->\n <div style=\"margin: 10px;overflow: hidden\">\n <div style=\"float: left;\">\n <Page :total=\"total\" :current=\"currentPage\" :page-size=\"pagenum\" @on-change=\"levelchangepage\"></Page>\n </div>\n </div>\n </Card>\n <!-- 新增/查看 公告 -->\n <Modal v-model=\"showNoticeModal\" >\n <p slot=\"header\" style=\"text-align:left;font-size:16px;\">\n <Icon type=\"ios-alert\" color=\"#2d8cf0\" size=\"24\" />\n <span>{{eduModalTitle=='addnew' ? '新增公告' : '公告详情'}}</span>\n </p>\n <Form ref=\"addform\" :model=\"addData\" :rules=\"addRule\" label-position=\"right\" :label-width=\"80\">\n <FormItem prop=\"title\" label=\"公告标题:\">\n <Input v-model=\"addData.title\" placeholder=\"请输入公告标题\"></Input>\n </FormItem>\n <FormItem label=\"发布对象:\">\n \t<RadioGroup v-model=\"publishType\">\n \t\t<Radio label=\"1\">所有</Radio>\n \t\t<Radio label=\"2\">选择区域</Radio>\n \t</RadioGroup>\n </FormItem>\n <FormItem label=\"省\" prop=\"province\" v-show=\"publishType==2\">\n \t\t<Select v-model=\"addData.province\" placeholder=\"请选择省\" @on-change=\"getCity()\">\n \t\t\t\t<Option v-for=\"item in provinceList\" :value=\"item.id\" :key=\"item.id\">{{ item.name }}</Option>\n \t\t</Select>\n </FormItem>\n <FormItem label=\"市\" prop=\"city\" v-show=\"publishType==2\">\n <Select v-model=\"addData.city\" placeholder=\"请选择市\" @on-change=\"getDistrict()\">\n <Option v-for=\"item in cityList\" :value=\"item.id\" :key=\"item.id\">{{ item.name }}</Option>\n </Select>\n </FormItem>\n <FormItem label=\"区\" prop=\"district\" v-show=\"publishType==2\">\n \t\t<Select v-model=\"addData.district\" placeholder=\"请选择区\">\n \t\t\t\t<Option v-for=\"item in districtList\" :value=\"item.id\" :key=\"item.id\">{{ item.name }}</Option>\n \t\t</Select>\n </FormItem>\n <FormItem prop=\"content\" label=\"公告内容:\">\n <Input v-model=\"addData.content\" type=\"textarea\" :autosize=\"{minRows: 2,maxRows: 5}\" placeholder=\"请输入公告内容\"></Input>\n </FormItem>\n </Form>\n <div slot=\"footer\">\n <Row type=\"flex\" justify=\"center\">\n <Button @click=\"showNoticeModal=false\">取消</Button>\n <Button type=\"primary\" @click=\"saveAdd('addform')\" :loading=\"btnLoading_pass\" v-show=\"eduModalTitle=='addnew'\">确定</Button>\n </Row>\n </div>\n </Modal>\n </div>\n</template>\n\n<script>\nimport axios from '@/libs/api.request'\nexport default {\n name: 'systemNotice',\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 cityList: [], // 市列表\n districtList: [], // 区列表\n publishType: '1', // 发布对象\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 {\n title: ' 排序',\n key: 'id'\n },\n {\n title: '标题',\n key: 'title'\n },\n {\n title: '更改时间',\n key: 'updated_at'\n },\n {\n title: '创建时间',\n key: 'created_at'\n },\n {\n title: '操作',\n key: 'action',\n align: 'center',\n render: (h, params) => {\n return h('div', [\n 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\n // this.addData = params.row\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 this.getCity() // 不对city 和 district,因为会查出相对应的 select的on-change,采用手动调用 getCity()的方式\n if (params.row.province) {\n this.editPid = params.row.province,\n this.editCid = params.row.city,\n this.editDid = params.row.district,\n // this.getProvince('check')\n this.publishType = '2'\n } else {\n this.publishType = '1'\n }\n }\n }\n }, '查看')\n ])\n }\n }\n ],\n tableData: []\n }\n },\n created () {\n this.getList()\n this.getProvince()\n },\n methods: {\n // 分页\n levelchangepage (res) {\n this.currentPage = res\n this.getList()\n },\n // 打开新增广告弹窗\n openNoticeModal () {\n this.eduModalTitle = 'addnew',\n this.publishType = '1',\n this.addData.title = ''\n this.addData.content = ''\n this.showNoticeModal = true\n },\n // 获取列表信息\n getList () {\n axios\n .request({\n method: 'POST',\n url: '/admins/system/notice',\n data: {\n page: this.currentPage\n }\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 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 if (this.publishType == 2) {\n addData['province'] = this.addData.province\n addData['city'] = this.addData.city\n addData['district'] = this.addData.district\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 that.$Message.info(res.data.message)\n that.btnLoading_pass = false\n })\n } else {\n // this.$Message.error('Fail!');\n }\n })\n },\n getProvince () {\n \taxios.request({\n \t\tmethod: 'GET',\n \t\turl: '/admins/area/0'\n \t}).then((res) => {\n \t\tif (res.data.code === 'success') {\n \t\t\tthis.addData.province === '' && (this.addData.province = res.data.data.list[0].id)\n \t\t\tthis.provinceList = res.data.data.list\n this.getCity()\n \t\t} else {\n \t\t\tthis.$vux.toast.text(res.data.message, 'middle')\n \t\t}\n \t})\n },\n getCity () {\n \tvar id = this.addData.province\n this.editCid && (id = this.editCid)\n \taxios.request({\n \t\tmethod: 'GET',\n \t\turl: '/admins/area/' + id\n \t}).then((res) => {\n \t\tif (res.data.code === 'success') {\n \t\t\tthis.cityList = res.data.data.list\n \t\t\tif (this.editCid) {\n \t\t\t\tthis.addData.city = this.editCid\n \t\t\t\tthis.editCid = '' // 第一次赋值之后置空\n \t\t\t} else {\n \t\t\t\tthis.addData.city = res.data.data.list[0].id\n \t\t\t}\n this.getDistrict()\n \t\t} else {\n \t\t\tthis.$vux.toast.text(res.data.message, 'middle')\n \t\t}\n \t})\n },\n getDistrict () {\n var id = this.addData.province\n this.editDid && (id = this.editDid)\n console.log('getDistrict', this.addData.city)\n \taxios.request({\n \t\tmethod: 'GET',\n \t\turl: '/admins/area/' + this.addData.city\n \t}).then((res) => {\n \t\tif (res.data.code === 'success') {\n \t\t\tthis.districtList = res.data.data.list\n \t\t\tif (this.editDid) {\n \t\t\t\tthis.addData.district = this.editDid\n \t\t\t\tthis.editDid = '' // 第一次赋值之后置空\n \t\t\t} else {\n \t\t\t\tthis.addData.district = res.data.data.list[0].id\n \t\t\t}\n \t\t} else {\n \t\t\tthis.$vux.toast.text(res.data.message, 'middle')\n \t\t}\n \t})\n }\n }\n}\n</script>\n\n<style>\n .mt10 {\n margin-top: 10px;\n }\n</style>\n"]}]}