08f84dcbdb3efcf085a43a9dbc63f28a.json 16 KB

1
  1. {"remainingRequest":"C:\\Users\\Administrator\\Desktop\\crmeb5.0\\template\\admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\Administrator\\Desktop\\crmeb5.0\\template\\admin\\src\\pages\\setting\\notification\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"C:\\Users\\Administrator\\Desktop\\crmeb5.0\\template\\admin\\src\\pages\\setting\\notification\\index.vue","mtime":1761185180181},{"path":"C:\\Users\\Administrator\\Desktop\\crmeb5.0\\template\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\Administrator\\Desktop\\crmeb5.0\\template\\admin\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"C:\\Users\\Administrator\\Desktop\\crmeb5.0\\template\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\Administrator\\Desktop\\crmeb5.0\\template\\admin\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:DQppbXBvcnQgeyBnZXROb3RpZmljYXRpb25MaXN0LCBnZXROb3RpZmljYXRpb25JbmZvLCBub3RpY2VTdGF0dXMsIG5vdGlmaWNhdGlvbkZvcm0gfSBmcm9tICdAL2FwaS9ub3RpZmljYXRpb24uanMnOw0KaW1wb3J0IHsgcm91dGluZVN5bmNUZW1wbGF0ZSwgd2VjaGF0U3luY1RlbXBsYXRlIH0gZnJvbSAnQC9hcGkvYXBwJzsNCmV4cG9ydCBkZWZhdWx0IHsNCiAgZGF0YSgpIHsNCiAgICByZXR1cm4gew0KICAgICAgbW9kYWxUaXRsZTogJycsDQogICAgICBub3RpZmljYXRpb25Nb2RhbDogZmFsc2UsDQogICAgICBoZWFkZXJMaXN0OiBbDQogICAgICAgIHsgbGFiZWw6ICfkvJrlkZjpgJrnn6UnLCB2YWx1ZTogJzEnIH0sDQogICAgICAgIHsgbGFiZWw6ICflubPlj7DpgJrnn6UnLCB2YWx1ZTogJzInIH0sDQogICAgICAgIHsgbGFiZWw6ICfoh6rlrprkuYnpgJrnn6UnLCB2YWx1ZTogJzMnIH0sDQogICAgICBdLA0KICAgICAgbGV2ZWxMaXN0czogW10sDQogICAgICBjdXJyZW50VGFiOiAnMScsDQogICAgICBsb2FkaW5nOiBmYWxzZSwNCiAgICAgIGZvcm1EYXRhOiB7fSwNCiAgICB9Ow0KICB9LA0KICBjcmVhdGVkKCkgew0KICAgIHRoaXMuY2hhbmdlVGFiKHRoaXMuY3VycmVudFRhYik7DQogIH0sDQogIG1ldGhvZHM6IHsNCiAgICBjaGFuZ2VTd2l0Y2goZSwgcm93LCB0eXBlKSB7DQogICAgICBub3RpY2VTdGF0dXModHlwZSwgcm93W3R5cGVdLCByb3cuaWQpDQogICAgICAgIC50aGVuKChyZXMpID0+IHsNCiAgICAgICAgICB0aGlzLiRtZXNzYWdlLnN1Y2Nlc3MocmVzLm1zZyk7DQogICAgICAgIH0pDQogICAgICAgIC5jYXRjaCgoZXJyKSA9PiB7DQogICAgICAgICAgdGhpcy4kbWVzc2FnZS5lcnJvcihlcnIubXNnKTsNCiAgICAgICAgfSk7DQogICAgfSwNCiAgICBub3RpZmljYXRpb25Gb3JtKGlkKSB7DQogICAgICB0aGlzLiRtb2RhbEZvcm0obm90aWZpY2F0aW9uRm9ybShpZCkpLnRoZW4oKCkgPT4gdGhpcy5jaGFuZ2VUYWIoKSk7DQogICAgfSwNCiAgICBjaGFuZ2VUYWIoKSB7DQogICAgICBnZXROb3RpZmljYXRpb25MaXN0KHRoaXMuY3VycmVudFRhYikudGhlbigocmVzKSA9PiB7DQogICAgICAgIHRoaXMubGV2ZWxMaXN0cyA9IHJlcy5kYXRhOw0KICAgICAgfSk7DQogICAgfSwNCiAgICAvLyDlkIzmraXorqLpmIXmtojmga8NCiAgICByb3V0aW5lVGVtcGxhdGUoKSB7DQogICAgICByb3V0aW5lU3luY1RlbXBsYXRlKCkNCiAgICAgICAgLnRoZW4oKHJlcykgPT4gew0KICAgICAgICAgIHRoaXMuJG1lc3NhZ2Uuc3VjY2VzcyhyZXMubXNnKTsNCiAgICAgICAgICB0aGlzLmNoYW5nZVRhYih0aGlzLmN1cnJlbnRUYWIpOw0KICAgICAgICB9KQ0KICAgICAgICAuY2F0Y2goKHJlcykgPT4gew0KICAgICAgICAgIHRoaXMuJG1lc3NhZ2UuZXJyb3IocmVzLm1zZyk7DQogICAgICAgIH0pOw0KICAgIH0sDQogICAgLy8g5ZCM5q2l5b6u5L+h5qih54mI5raI5oGvDQogICAgd2VjaGF0VGVtcGxhdGUoKSB7DQogICAgICB3ZWNoYXRTeW5jVGVtcGxhdGUoKQ0KICAgICAgICAudGhlbigocmVzKSA9PiB7DQogICAgICAgICAgdGhpcy4kbWVzc2FnZS5zdWNjZXNzKHJlcy5tc2cpOw0KICAgICAgICAgIHRoaXMuY2hhbmdlVGFiKHRoaXMuY3VycmVudFRhYik7DQogICAgICAgIH0pDQogICAgICAgIC5jYXRjaCgocmVzKSA9PiB7DQogICAgICAgICAgdGhpcy4kbWVzc2FnZS5lcnJvcihyZXMubXNnKTsNCiAgICAgICAgfSk7DQogICAgfSwNCiAgICAvLyDlvIDlkK/lhbPpl60NCiAgICBjaGFuZ2VTdGF0dXMoKSB7fSwNCiAgICAvLyDliJfooagNCiAgICBub3RpY2UoKSB7fSwNCiAgICAvLyDorr7nva4NCiAgICBzZXR0aW5nKHJvdykgew0KICAgICAgdGhpcy4kcm91dGVyLnB1c2goew0KICAgICAgICBwYXRoOiB0aGlzLiRyb3V0ZVByb1N0ciArICcvc2V0dGluZy9ub3RpZmljYXRpb24vbm90aWZpY2F0aW9uRWRpdD9pZD0nICsgcm93LmlkLA0KICAgICAgfSk7DQogICAgfSwNCiAgICBnZXREYXRhKGtleXMsIHJvdywgaXRlbSkgew0KICAgICAgdGhpcy5mb3JtRGF0YSA9IHt9Ow0KICAgICAgZ2V0Tm90aWZpY2F0aW9uSW5mbyhyb3cuaWQsIGl0ZW0pLnRoZW4oKHJlcykgPT4gew0KICAgICAgICBrZXlzLm1hcCgoaSwgdikgPT4gew0KICAgICAgICAgIHRoaXMuZm9ybURhdGFbaV0gPSByZXMuZGF0YVtpXTsNCiAgICAgICAgfSk7DQogICAgICAgIHRoaXMuZm9ybURhdGEudHlwZSA9IGl0ZW07DQogICAgICAgIHRoaXMubm90aWZpY2F0aW9uTW9kYWwgPSB0cnVlOw0KICAgICAgfSk7DQogICAgfSwNCiAgICAvLyDliKDpmaQNCiAgICBkZWwocm93LCB0aXQsIG51bSkgew0KICAgICAgbGV0IGRlbGZyb21EYXRhID0gew0KICAgICAgICB0aXRsZTogdGl0LA0KICAgICAgICBudW06IG51bSwNCiAgICAgICAgdXJsOiBgc2V0dGluZy9ub3RpZmljYXRpb24vZGVsX25vdC8ke3Jvdy5pZH1gLA0KICAgICAgICBtZXRob2Q6ICdERUxFVEUnLA0KICAgICAgICBpZHM6ICcnLA0KICAgICAgfTsNCiAgICAgIHRoaXMuJG1vZGFsU3VyZShkZWxmcm9tRGF0YSkNCiAgICAgICAgLnRoZW4oKHJlcykgPT4gew0KICAgICAgICAgIHRoaXMuJG1lc3NhZ2Uuc3VjY2VzcyhyZXMubXNnKTsNCiAgICAgICAgICB0aGlzLmxldmVsTGlzdHMuc3BsaWNlKG51bSwgMSk7DQogICAgICAgIH0pDQogICAgICAgIC5jYXRjaCgocmVzKSA9PiB7DQogICAgICAgICAgdGhpcy4kbWVzc2FnZS5lcnJvcihyZXMubXNnKTsNCiAgICAgICAgfSk7DQogICAgfSwNCiAgfSwNCn07DQo="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";AAgKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/pages/setting/notification","sourcesContent":["<template>\r\n <div class=\"message\">\r\n <el-card :bordered=\"false\" shadow=\"never\" class=\"ivu-mt\" :body-style=\"{ padding: '0 20px 20px' }\">\r\n <div>\r\n <el-tabs v-model=\"currentTab\" @tab-click=\"changeTab\">\r\n <el-tab-pane\r\n :label=\"item.label\"\r\n :name=\"item.value.toString()\"\r\n v-for=\"(item, index) in headerList\"\r\n :key=\"index\"\r\n />\r\n </el-tabs>\r\n </div>\r\n <el-row class=\"mb14\" v-if=\"currentTab == 1\">\r\n <el-col>\r\n <el-button v-auth=\"['app-wechat-template-sync']\" type=\"primary\" v-db-click @click=\"routineTemplate\"\r\n >同步小程序订阅消息</el-button\r\n >\r\n <el-button v-auth=\"['app-wechat-template-sync']\" type=\"primary\" v-db-click @click=\"wechatTemplate\"\r\n >同步微信模版消息</el-button\r\n >\r\n </el-col>\r\n </el-row>\r\n <el-row class=\"mb14\" v-if=\"currentTab == 3\">\r\n <el-col>\r\n <el-button type=\"primary\" v-db-click @click=\"notificationForm(0)\">添加通知</el-button>\r\n </el-col>\r\n </el-row>\r\n <el-alert v-if=\"currentTab == 1\" type=\"warning\" :closable=\"false\">\r\n <template slot=\"title\">\r\n <p class=\"alert_title\">小程序订阅消息</p>\r\n 登录微信小程序后台,基本设置,服务类目增加《生活服务 > 百货/超市/便利店》 (否则同步小程序订阅消息会报错)<br />\r\n 同步小程序订阅消息,是在小程序后台未添加订阅消息模板的前提下使用的,会新增一个模板消息并把信息同步过来,并新本项目数据库。<br />\r\n <br />\r\n <p class=\"alert_title\">微信模板消息</p>\r\n 登录微信公众号后台,选择模板消息,在账号详情下的服务类目中手动设置服务类目,《生活服务 >\r\n 百货/超市/便利店》(否则同步模板消息不成功)<br />\r\n 同步公众号模板消息,同步公众号模板会删除公众号后台现有的模板,并重新添加新的模板,然后同步信息到数据库,如果多个项目使用同一个公众号的模板,请谨慎操作。\r\n </template>\r\n </el-alert>\r\n <el-table\r\n :data=\"levelLists\"\r\n ref=\"table\"\r\n class=\"mt14\"\r\n v-loading=\"loading\"\r\n highlight-current-row\r\n no-userFrom-text=\"暂无数据\"\r\n no-filtered-userFrom-text=\"暂无筛选结果\"\r\n >\r\n <el-table-column label=\"ID\" width=\"80\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.id }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"通知类型\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.name }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"通知场景说明\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.title }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"站内信\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <el-switch\r\n v-if=\"scope.row.is_system !== 0\"\r\n :active-value=\"1\"\r\n :inactive-value=\"2\"\r\n v-model=\"scope.row.is_system\"\r\n :value=\"scope.row.is_system\"\r\n @change=\"changeSwitch($event, scope.row, 'is_system')\"\r\n size=\"large\"\r\n :disabled=\"scope.row.is_system == 0\"\r\n >\r\n </el-switch>\r\n <div v-else>-</div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"公众号模板\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <el-switch\r\n v-if=\"scope.row.is_wechat !== 0\"\r\n :active-value=\"1\"\r\n :inactive-value=\"2\"\r\n v-model=\"scope.row.is_wechat\"\r\n :value=\"scope.row.is_wechat\"\r\n @change=\"changeSwitch($event, scope.row, 'is_wechat')\"\r\n size=\"large\"\r\n :disabled=\"scope.row.is_wechat == 0\"\r\n >\r\n </el-switch>\r\n <div v-else>-</div>\r\n </template>\r\n </el-table-column>\r\n\r\n <el-table-column label=\"发送短信\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <el-switch\r\n v-if=\"scope.row.is_sms !== 0\"\r\n :active-value=\"1\"\r\n :inactive-value=\"2\"\r\n v-model=\"scope.row.is_sms\"\r\n :value=\"scope.row.is_sms\"\r\n @change=\"changeSwitch($event, scope.row, 'is_sms')\"\r\n size=\"large\"\r\n >\r\n </el-switch>\r\n <div v-else>-</div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"企业微信\" min-width=\"130\" v-if=\"currentTab != 1\">\r\n <template slot-scope=\"scope\">\r\n <el-switch\r\n v-if=\"scope.row.is_ent_wechat !== 0\"\r\n :active-value=\"1\"\r\n :inactive-value=\"2\"\r\n v-model=\"scope.row.is_ent_wechat\"\r\n :value=\"scope.row.is_ent_wechat\"\r\n @change=\"changeSwitch($event, scope.row, 'is_ent_wechat')\"\r\n size=\"large\"\r\n >\r\n </el-switch>\r\n <div v-else>-</div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"小程序订阅\" min-width=\"130\" v-if=\"currentTab == 1 || currentTab == 3\">\r\n <template slot-scope=\"scope\">\r\n <el-switch\r\n v-if=\"scope.row.is_routine !== 0\"\r\n :active-value=\"1\"\r\n :inactive-value=\"2\"\r\n v-model=\"scope.row.is_routine\"\r\n :value=\"scope.row.is_routine\"\r\n @change=\"changeSwitch($event, scope.row, 'is_routine')\"\r\n size=\"large\"\r\n :disabled=\"scope.row.is_routine == 0\"\r\n >\r\n </el-switch>\r\n <div v-else>-</div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"操作\" fixed=\"right\" :width=\"currentTab == 3 ? 130 : 70\">\r\n <template slot-scope=\"scope\">\r\n <a class=\"setting btn\" v-db-click @click=\"setting(scope.row)\">设置</a>\r\n <template v-if=\"currentTab == 3\">\r\n <el-divider direction=\"vertical\"></el-divider>\r\n <a class=\"setting btn\" v-db-click @click=\"notificationForm(scope.row.id)\">编辑</a>\r\n <el-divider direction=\"vertical\"></el-divider>\r\n <a class=\"setting btn\" v-db-click @click=\"del(scope.row, '删除', scope.$index)\">删除</a>\r\n </template>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n </el-card>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { getNotificationList, getNotificationInfo, noticeStatus, notificationForm } from '@/api/notification.js';\r\nimport { routineSyncTemplate, wechatSyncTemplate } from '@/api/app';\r\nexport default {\r\n data() {\r\n return {\r\n modalTitle: '',\r\n notificationModal: false,\r\n headerList: [\r\n { label: '会员通知', value: '1' },\r\n { label: '平台通知', value: '2' },\r\n { label: '自定义通知', value: '3' },\r\n ],\r\n levelLists: [],\r\n currentTab: '1',\r\n loading: false,\r\n formData: {},\r\n };\r\n },\r\n created() {\r\n this.changeTab(this.currentTab);\r\n },\r\n methods: {\r\n changeSwitch(e, row, type) {\r\n noticeStatus(type, row[type], row.id)\r\n .then((res) => {\r\n this.$message.success(res.msg);\r\n })\r\n .catch((err) => {\r\n this.$message.error(err.msg);\r\n });\r\n },\r\n notificationForm(id) {\r\n this.$modalForm(notificationForm(id)).then(() => this.changeTab());\r\n },\r\n changeTab() {\r\n getNotificationList(this.currentTab).then((res) => {\r\n this.levelLists = res.data;\r\n });\r\n },\r\n // 同步订阅消息\r\n routineTemplate() {\r\n routineSyncTemplate()\r\n .then((res) => {\r\n this.$message.success(res.msg);\r\n this.changeTab(this.currentTab);\r\n })\r\n .catch((res) => {\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n // 同步微信模版消息\r\n wechatTemplate() {\r\n wechatSyncTemplate()\r\n .then((res) => {\r\n this.$message.success(res.msg);\r\n this.changeTab(this.currentTab);\r\n })\r\n .catch((res) => {\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n // 开启关闭\r\n changeStatus() {},\r\n // 列表\r\n notice() {},\r\n // 设置\r\n setting(row) {\r\n this.$router.push({\r\n path: this.$routeProStr + '/setting/notification/notificationEdit?id=' + row.id,\r\n });\r\n },\r\n getData(keys, row, item) {\r\n this.formData = {};\r\n getNotificationInfo(row.id, item).then((res) => {\r\n keys.map((i, v) => {\r\n this.formData[i] = res.data[i];\r\n });\r\n this.formData.type = item;\r\n this.notificationModal = true;\r\n });\r\n },\r\n // 删除\r\n del(row, tit, num) {\r\n let delfromData = {\r\n title: tit,\r\n num: num,\r\n url: `setting/notification/del_not/${row.id}`,\r\n method: 'DELETE',\r\n ids: '',\r\n };\r\n this.$modalSure(delfromData)\r\n .then((res) => {\r\n this.$message.success(res.msg);\r\n this.levelLists.splice(num, 1);\r\n })\r\n .catch((res) => {\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .el-tabs__item {\r\n height: 54px !important;\r\n line-height: 54px !important;\r\n}\r\n.message ::v-deep .ivu-table-header thead tr th {\r\n padding: 8px 16px;\r\n}\r\n.message ::v-deep .ivu-tabs-tab {\r\n border-radius: 0 !important;\r\n}\r\n.table-box {\r\n padding: 20px;\r\n}\r\n.is-table {\r\n display: flex;\r\n /* justify-content: space-around; */\r\n justify-content: center;\r\n}\r\n.btn {\r\n padding: 6px 0px;\r\n cursor: pointer;\r\n font-size: 12px;\r\n border-radius: 3px;\r\n}\r\n.is-switch-close {\r\n background-color: #504444;\r\n}\r\n.is-switch {\r\n background-color: #eb5252;\r\n}\r\n.notice-list {\r\n background-color: #308cf5;\r\n margin: 0 15px;\r\n}\r\n.table {\r\n padding: 0 18px;\r\n}\r\n.alert_title {\r\n margin-bottom: 5px;\r\n font-weight: 700;\r\n}\r\n</style>\r\n"]}]}