diff --git a/epmet-oper-web/src/js/dai/config.js b/epmet-oper-web/src/js/dai/config.js index 6df826c..ace8d46 100644 --- a/epmet-oper-web/src/js/dai/config.js +++ b/epmet-oper-web/src/js/dai/config.js @@ -4,7 +4,7 @@ export const mockUrlPrefix = export const envIsDev = process.env.VUE_APP_NODE_ENV === 'dev' export default { - appid: { + appId: { //开发环境appid devResiAppid: 'wx0301bf7f534d97d1', // 风凌石居民端 devWorkAppid: 'wx2679392c4cc2af22', //风凌石工作端 diff --git a/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue b/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue index 84190b4..ed486fc 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue @@ -361,7 +361,7 @@ :visible="upOrDownDia.visible" @cancel="upOrDownDiaCancel" @ok="upOrDownDiaOk"> -
+
{ this.roleCheckedArray.push(item.roleKey) }) - this.endLoading() + if (this.roleCheckedArray.length === 0) { + this.checkAll = false + this.isIndeterminate = false + } else if (this.roleCheckedArray.length === this.roleAllList.length) { + this.checkAll = true + this.isIndeterminate = false + } else { + this.checkAll = false + this.isIndeterminate = true + } + + + + } else { + this.$message.error(m) } + this.endLoading() }, //设置权限 async savePermission () { - this.startLoading() + if (this.roleCheckedArray.length === 0) { this.$message.warning('所选角色数量必须大于1') return false } + this.startLoading() this.upOrDownForm.roleList = [] this.roleAllList.forEach(allItem => { this.roleCheckedArray.forEach(selItem => { @@ -727,6 +747,7 @@ export default { this.isIndeterminate = false; }, handleCheckedCitiesChange (value) { + let checkedCount = value.length; this.checkAll = checkedCount === this.roleAllList.length; this.isIndeterminate = checkedCount > 0 && checkedCount < this.roleAllList.length; @@ -741,6 +762,12 @@ export default { functionId: row.functionId, reason: '' } + this.roleCheckedArray = [] + this.roleAllList.forEach(item => { + this.roleCheckedArray.push(item.roleKey) + }) + this.checkAll = true + this.isIndeterminate = false this.upOrDownDia.visible = true }, diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue index 9fc8e90..58385bf 100644 --- a/epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue @@ -4,57 +4,25 @@ - - - + name="resi"> + - - + name="gov"> + - - -
+ diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue new file mode 100644 index 0000000..3395158 --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue @@ -0,0 +1,247 @@ + + + + + + \ No newline at end of file diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue index 0f93e2f..6c32291 100644 --- a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue @@ -9,13 +9,34 @@
- + -
111
+
+
消息示例
+ +
+ +
+ + + + {{item}}: + + + {{kidSelExampleList[index]}} + + +
+ +
+
- + @@ -45,9 +66,10 @@ :min="1" :max="5">
- {{item}} + {{item}}
@@ -56,12 +78,13 @@
{{item}} -
@@ -105,19 +128,20 @@ export default { visible: false, workAppid: '', resiAppid: '', - tid: '',// dataForm: { appId: '', tid: '', sceneDesc: '', - kidList: [] + kidList: [], + nameList: [] }, kidAllList: [],//全部的关键字对象 kidAllName: [],//全部的关键字name - kidSelNameList: [], - kidSelList2: [], + kidSelNameList: [],//选择的关键字name + kidSelIdList: [],//选择的关键字id + kidSelExampleList: [],//选择的关键字example } }, created () { @@ -129,7 +153,7 @@ export default { this.workAppid = workAppid this.resiAppid = resiAppid this.dataForm.appId = resiAppid - this.tid = row.tid + this.dataForm.tid = row.tid this.visible = true @@ -150,49 +174,81 @@ export default { this.kidAllName.push(item.name) }) + } else { + this.$message.error(msg) } this.endLoading() }, - moveUp () { - + moveUp (index) { + this.kidSelNameList.splice(index - 1, 1, ...this.kidSelNameList.splice(index, 1, this.kidSelNameList[index - 1])) + this.kidSelIdList.splice(index - 1, 1, ...this.kidSelIdList.splice(index, 1, this.kidSelIdList[index - 1])) + this.kidSelExampleList.splice(index - 1, 1, ...this.kidSelExampleList.splice(index, 1, this.kidSelExampleList[index - 1])) + console.log(this.kidSelNameList) + console.log(this.kidSelIdList) + console.log(this.kidSelExampleList) + }, + checkboxChange (val, item, index) { + // debugger + const kid = this.kidAllList[index].kid + const example = this.kidAllList[index].example + if (val) { + this.kidSelIdList.push(kid) + this.kidSelExampleList.push(example) + } else { + this.kidSelIdList = this.kidSelIdList.filter(idItem => idItem !== kid) + this.kidSelExampleList = this.kidSelExampleList.filter(exampleItem => exampleItem !== example) + } + console.log("kidSelIdList") + console.log(this.kidSelIdList) + console.log("kidSelExampleList") + console.log(this.kidSelExampleList) }, - saveForm () { - this.$refs['dataForm'].validate((valid, messageObj) => { - - if (!valid) { - app.util.validateRule(messageObj) - } else { - - let url = '' - if (this.type === 'U') { - url = '/oper/customize/customerfootbar/updatefootbar' - // url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/updatefootbar' - } else { - // url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/createfootbar' - url = '/oper/customize/customerfootbar/createfootbar' - this.dataForm.id = '' - this.dataForm.customerId = 'default' - } - window.app.ajax.post(url, this.dataForm, - (data, rspMsg) => { - this.$message({ - type: 'success', - message: '保存成功' - }) - this.$emit('editDiaOK') - this.visible = false - }, - (rspMsg, data) => { - this.endLoading() - this.$message.error(rspMsg) - }) - } - }) + async saveForm () { + if (this.kidSelIdList.length === 0) { + this.$message.warning('请选择至少一个关键词') + return false + } + if (this.dataForm.sceneDesc === '') { + this.$message.warning('请填写场景描述') + return false + } + const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/addtemplate' + // const url = '/third/subscribe/addtemplate' + this.dataForm.kidList = this.kidSelIdList + this.dataForm.nameList = this.kidSelNameList + + const { data, code, msg } = await requestPost(url, this.dataForm) + if (code === 0) { + let clientType = this.dataForm.appId === this.resiAppid ? 'resi' : 'gov' + this.$emit('editDiaOK', clientType) + this.handleClose() + } else { + this.$message.error(msg) + } + + }, handleClose () { + this.resetData() this.visible = false }, + //重置数据 + resetData () { + this.dataForm = { + appId: '', + tid: '', + sceneDesc: '', + kidList: [], + nameList: [] + } + + this.kidAllList = []//全部的关键字对象 + this.kidAllName = []//全部的关键字name + this.kidSelNameList = []//选择的关键字name + this.kidSelIdList = []//选择的关键字id + this.kidSelExampleList = []//选择的关键字example + }, // 开启加载动画 startLoading () { @@ -229,13 +285,14 @@ export default { return this.resolution === 'small' ? 80 : 70 }, diaTop () { - return this.resolution === 'small' ? '30px' : '100px' + return this.resolution === 'small' ? '20px' : '100px' }, formHeight () { return this.clientHeight * 0.6 }, rowHeight () { return (this.formHeight - 70) + 'px' + }, ...mapGetters(['clientHeight', 'resolution']), }, @@ -274,5 +331,14 @@ export default { float: right; margin-right: 10px; } + +.div_left { + margin: 20px 0 0 0; +} +.div_left_item { + background-color: white; + margin: 0 0 10px 0; + padding: 0 0 0 10px; +} \ No newline at end of file diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue index 2667cdc..0dc8bb9 100644 --- a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue @@ -22,11 +22,16 @@ header-align="left" :min-width="100" align="left"> - + { if (this.activeName === 'mine') { - // this.$refs['table_work'].doLayout() // 解决表格错位 + this.$refs.ref_mytemp.doLayout() // 解决表格错位 } else if (this.activeName === 'public') { this.$refs.ref_publictable.doLayout() // 解决表格错位 } @@ -145,16 +144,35 @@ export default { methods: { //加载列表数据 - loadData () { + async loadData () { + this.dataListLoading = true + const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/getpubtemplatetitles' + // const url = '/third/subscribe/getpubtemplatetitles' + + this.tableParams.appId = this.workAppid + this.tableParams.ids = '794' + const { data, code, msg } = await requestPost(url, this.tableParams) + if (code === 0) { + this.total = data.total + this.dataList = data.list + this.dataList.forEach(element => { + element.typeShow = element.type === 2 ? '一次性订阅' : '长期订阅' + element.keywordsShow = element.keywords.join() + }) + } else { + this.$message.error(msg) + } + this.dataListLoading = false }, - tabClick (tab) { - if (tab.name === 'mine') { + tabClick () { + if (this.activeName === 'mine') { + this.$refs['ref_mytemp'].init(this.workAppid, this.resiAppid) } - if (tab.name === 'public') { - + if (this.activeName === 'public') { + this.loadData() } }, @@ -167,8 +185,10 @@ export default { diaCancel () { this.$emit('cancleBack') }, - editDiaOK () { - this.refresh() + editDiaOK (clientType) { + this.activeName = 'mine' + this.$refs['ref_mytemp'].init(this.workAppid, this.resiAppid, clientType) + }, editDiaCancel () {