+
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 @@
{{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 () {