From bc8a34510acb721058b5b75562c730ef2ef40c2c Mon Sep 17 00:00:00 2001 From: jiangyy Date: Fri, 11 Sep 2020 09:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E9=98=85=E6=B6=88=E6=81=AF=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-oper-web/.env.development | 4 +- .../js/columns/customer/manage/customer.js | 2 +- .../src/views/components/CTable.vue | 60 ++++---- .../src/views/components/CTableNoPage.vue | 12 +- .../modules/customer/customize/ConfigItem.vue | 1 + .../modules/customer/manage/CustomerInfo.vue | 2 +- .../miniProAgent/version/CommitForm.vue | 6 +- .../productConfig/subscribe/MyTemp.vue | 54 ++++---- .../productConfig/subscribe/MyTempList.vue | 35 ++--- .../productConfig/subscribe/TempDetail.vue | 128 +++++++++++------- .../productConfig/subscribe/TempEdit.vue | 35 +++-- .../productConfig/subscribe/TempList.vue | 40 ++++-- epmet-oper-web/src/views/pages/loginWork.vue | 2 +- 13 files changed, 220 insertions(+), 161 deletions(-) diff --git a/epmet-oper-web/.env.development b/epmet-oper-web/.env.development index 91d7451..eabfef7 100644 --- a/epmet-oper-web/.env.development +++ b/epmet-oper-web/.env.development @@ -1,5 +1,5 @@ NODE_ENV=development -VUE_APP_API_SERVER = http://192.168.1.130:8080/api -# VUE_APP_API_SERVER = http://10.10.10.207:8080/api +# VUE_APP_API_SERVER = http://192.168.1.130:8080/api +VUE_APP_API_SERVER = http://10.10.10.50:8080/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api VUE_APP_NODE_ENV=dev \ No newline at end of file diff --git a/epmet-oper-web/src/js/columns/customer/manage/customer.js b/epmet-oper-web/src/js/columns/customer/manage/customer.js index 97924dc..38fb175 100644 --- a/epmet-oper-web/src/js/columns/customer/manage/customer.js +++ b/epmet-oper-web/src/js/columns/customer/manage/customer.js @@ -77,7 +77,7 @@ export default { }, { key: 'rootManageName', - title: '根管理员', + title: '超级管理员', display: ['table', 'model'], type: 'input', rule: [ diff --git a/epmet-oper-web/src/views/components/CTable.vue b/epmet-oper-web/src/views/components/CTable.vue index a20538c..b905e31 100644 --- a/epmet-oper-web/src/views/components/CTable.vue +++ b/epmet-oper-web/src/views/components/CTable.vue @@ -67,7 +67,8 @@ :fit=" col.fill?col.fill:'fill'"> -- - + + @@ -137,7 +138,7 @@ export default { table: { height: this.tableHeight, params: { - pageSize: this.pageSize, // 当前页数显示记录数 + pageSize: Number, // 当前页数显示记录数 pageNo: this.pageNo // 当前页数 } }, @@ -150,7 +151,7 @@ export default { watch: { tableHeight (height) { this.table.height = height - } + }, }, props: { keyword: { @@ -188,10 +189,7 @@ export default { type: Number, default: 1 }, - pageSize: { - type: Number, - default: 10 - }, + tableHeight: { type: Number }, @@ -206,23 +204,30 @@ export default { }, computed: { - // 操作列宽度 - // operationWidth: () => { - // return 120 - // // if (this.operations.includes('add')) { - // // return (this.operations.length - 1) * 80 // 操作列包含add类型按钮时返回 - // // } else if (this.operations.includes('analyze')) { - // // return (this.operations.length + 0.5) * 80 // 操作列包含analyze类型按钮时返回 - // // } else { - // // return this.operations.length * 140 - // // } - // }, - tableSize () { - if (this.resolution === 'small') { - return 10 - } else { - return 20 + + pageSize: { + + //getter 方法 + get () { + if (this.resolution === 'small') { + this.table.params.pageSize = 10 + + return 10 + } else { + this.table.params.pageSize = 20 + return 20 + } + }, + //setter 方法 + set (newValue) { + + console.log('computed setter...') + this.table.params.pageSize = newValue + // return newValue } + + + }, tablePageSizes () { if (this.resolution === 'small') { @@ -248,13 +253,14 @@ export default { }) Object.assign(this.table.params, this.params) + console.log(this.table.params) // 获取数据 window.app.ajax.post( this.url, this.table.params, (data, rspMsg) => { if (data) { - // debugger + this.tableData = data.list this.total = data.total } @@ -307,8 +313,10 @@ export default { scope._self.$refs[`popover-${scope.$index}`].doClose() }, handleSizeChange (pageSize) { + this.table.params.pageSize = pageSize - this.table.params.pageNo = 0 + + this.table.params.pageNo = 1 this.$nextTick(() => { this.loadData() }) diff --git a/epmet-oper-web/src/views/components/CTableNoPage.vue b/epmet-oper-web/src/views/components/CTableNoPage.vue index 10a0d72..cc38a03 100644 --- a/epmet-oper-web/src/views/components/CTableNoPage.vue +++ b/epmet-oper-web/src/views/components/CTableNoPage.vue @@ -66,7 +66,8 @@ class="function-icon" :fit=" col.fill?col.fill:'fill'"> - + + - + @@ -92,14 +91,15 @@ export default { init (appId) { this.appId = appId + this.loadData() }, //加载列表数据 async loadData () { this.dataListLoading = true - const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/gettemplate' - // const url = '/third/subscribe/gettemplate' + // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/gettemplate' + const url = '/third/subscribe/gettemplate' const params = { appId: this.appId } @@ -115,12 +115,9 @@ export default { }, // 刷新 - refresh () { - if (this.activeName === 'gov') { - this.loadWorkTableData() // 获取表格数据 - } else if (this.activeName === 'resi') { - this.loadResiTableData() // 获取表格数据 - } + refreshTable (appId) { + this.appId = appId + this.loadData() }, // 详情 @@ -143,8 +140,8 @@ export default { async del (row) { this.startLoading() - const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/deltemplate' - // const url = '/third/subscribe/deltemplate' + // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/deltemplate' + const url = '/third/subscribe/deltemplate' const params = { appId: this.appId, priTmplId: row.priTmplId @@ -153,26 +150,14 @@ export default { const { data, code, msg } = await requestPost(url, params) if (code === 0) { this.$message.success('删除成功') + this.loadData() } else { this.$message.error(msg) } this.endLoading() }, - // 取消 - diaCancel () { - this.$emit('cancleBack') - }, - editDiaOK () { - this.refresh() - }, - editDiaCancel () { - - }, - async renderSelData () { // 渲染下拉框/单选框/复选框等数据 - - }, // 开启加载动画 startLoading () { diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue index 092e27d..f9c8649 100644 --- a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue @@ -17,20 +17,20 @@
- +
+ + + + {{item.title}} + + + {{item.content}} + + +
@@ -39,58 +39,70 @@ -
+
- 模板ID + 模板ID - {{dataForm.priTmplId}} + {{dataForm.priTmplId}}
-
+
- 标题 + 标题 - {{dataForm.title}} + {{dataForm.title}}
-
+
- 类目 + 类目 - {{'社区/论坛'}} + {{'社区/论坛'}}
-
+
- 详细内容 + 详细内容 - {{dataForm.content}} +
+ + + {{item.title}} + + + {{item.content}} + + +
+
-
+
- 场景说明 + 场景说明 - {{dataForm.sceneDesc}} + {{dataForm.sceneDesc}}
@@ -120,14 +132,15 @@ export default { priTmplId: '', title: '', content: '', - contentShow: [], example: '', - exampleArray: [], type: '', kidNames: '', - kidNamesArray: [], sceneDesc: '' - } + }, + + exampleArray: [], + contentArray: [], + kidNamesArray: [], } }, created () { @@ -144,15 +157,28 @@ export default { }, loadData () { + //左侧示例解析 + this.exampleArray = [] let array = this.dataForm.example.split('\\n') - array.forEach(element => { - let oneArray = element.split(':') - let obj = Object + for (let i = 0; i < array.length - 1; i++) { + let oneArray = array[i].split(':') + let obj = {} obj.title = oneArray[0] obj.content = oneArray[1] - }) - this.dataForm.exampleArray = - console.log(this.dataForm.exampleArray) + this.exampleArray.push(obj) + } + + //右侧详细内容解析 + + this.contentArray = [] + let arrayContent = this.dataForm.content.split('\\n') + for (let i = 0; i < arrayContent.length - 1; i++) { + let oneArray = arrayContent[i].split(':') + let obj = {} + obj.title = oneArray[0] + obj.content = oneArray[1] + this.contentArray.push(obj) + } }, handleClose () { @@ -181,7 +207,7 @@ export default { computed: { diaWidth () { - return this.resolution === 'small' ? 80 : 70 + return this.resolution === 'small' ? 70 : 60 }, diaTop () { return this.resolution === 'small' ? '20px' : '100px' @@ -221,18 +247,18 @@ export default { margin: 10px 10px; font-size: 18px; } +.padding_10 { + padding-left: 10px; +} .div_left { - margin: 20px 20px 20px 20px; + margin: 40px 20px 20px 20px; } .div_left_item { background-color: white; margin: 0 0 10px 0; - padding: 0 0 0 10px; } -.div_left_item_total { - margin: 10px 0 10px 20px; - +.span_left_item_title { color: rgb(121, 121, 121); font-size: 15px; } @@ -240,7 +266,17 @@ export default { color: rgb(31, 31, 31); font-size: 15px; } -.span_left_item_title { + +.div_right_item_total { + margin: 10px 0 10px 20px; +} +.span_right_item_content { + color: rgb(31, 31, 31); + font-size: 15px; +} +.span_right_item_title { + color: rgb(121, 121, 121); + font-size: 15px; padding-left: 40px; } 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 6c32291..e8c69fd 100644 --- a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue @@ -132,6 +132,8 @@ export default { dataForm: { appId: '', tid: '', + title: '', + type: Number, sceneDesc: '', kidList: [], nameList: [] @@ -154,6 +156,8 @@ export default { this.resiAppid = resiAppid this.dataForm.appId = resiAppid this.dataForm.tid = row.tid + this.dataForm.type = row.type + this.dataForm.title = row.title this.visible = true @@ -162,12 +166,13 @@ export default { }, async getkeywords () { this.startLoading() - const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/getkeywords' - // const url = '/third/subscribe/getkeywords' + // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/getkeywords' + const url = '/third/subscribe/getkeywords' let _data = { - appId: this.appId + appId: this.resiAppid, + titleId: this.dataForm.tid } - const { data, code, msg } = await requestPost(url, _data) + const { data, code, msg, internalMsg } = await requestPost(url, _data) if (code === 0) { this.kidAllList = data this.kidAllList.forEach(item => { @@ -175,7 +180,7 @@ export default { }) } else { - this.$message.error(msg) + this.$message.error(msg + ":" + internalMsg) } this.endLoading() }, @@ -183,9 +188,9 @@ export default { 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) + // console.log(this.kidSelNameList) + // console.log(this.kidSelIdList) + // console.log(this.kidSelExampleList) }, checkboxChange (val, item, index) { // debugger @@ -198,10 +203,10 @@ export default { 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) + // console.log("kidSelIdList") + // console.log(this.kidSelIdList) + // console.log("kidSelExampleList") + // console.log(this.kidSelExampleList) }, async saveForm () { @@ -213,11 +218,11 @@ export default { this.$message.warning('请填写场景描述') return false } - const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/addtemplate' - // const url = '/third/subscribe/addtemplate' + // 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 - + console.log(this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm) if (code === 0) { let clientType = this.dataForm.appId === this.resiAppid ? 'resi' : 'gov' 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 0dc8bb9..7b22cc9 100644 --- a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue @@ -86,12 +86,12 @@ export default { resiAppid: '', //分页 - pageNo: 0, + pageNo: 1, pageSize: 10, total: 0, tableParams: { - pageNo: 0, + pageNo: 1, pageSize: 10 }, @@ -146,10 +146,10 @@ export default { //加载列表数据 async loadData () { this.dataListLoading = true - const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/getpubtemplatetitles' - // const url = '/third/subscribe/getpubtemplatetitles' + // 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.appId = this.resiAppid this.tableParams.ids = '794' const { data, code, msg } = await requestPost(url, this.tableParams) @@ -166,13 +166,35 @@ export default { this.dataListLoading = false }, + loadData2 () { + this.total = 10 + this.dataList = [ + { + "tid": 484, + "title": "新的评论提醒", + "type": 2, + "categoryId": + "794", + "keywords": ["文章标题", "评论内容", "评论时间", "取消提醒", "评论用户", "帖子内容", "评论类型", "评论人数", "备注"] + }, + { "tid": 523, "title": "评论成功提醒", "type": 2, "categoryId": "794", "keywords": ["时间", "评论人", "温馨提示"] }, { "tid": 529, "title": "便民信息审核结果通知", "type": 2, "categoryId": "794", "keywords": ["审核结果", "审核人员", "联系电话", "审核时间", "拒绝理由"] }, { "tid": 569, "title": "签到提醒", "type": 2, "categoryId": "794", "keywords": ["签到人", "签到时间", "活动名称", "温馨提示", "连续签到", "待领奖励", "累计签到"] }, { "tid": 572, "title": "活动成功通知", "type": 2, "categoryId": "794", "keywords": ["活动标题", "完成时间", "参与人数", "执行情况"] }, { "tid": 577, "title": "挑战开始提醒", "type": 2, "categoryId": "794", "keywords": ["挑战名称", "开始时间", "结束时间", "挑战目标", "奖金池"] }, { "tid": 579, "title": "动态点赞通知", "type": 2, "categoryId": "794", "keywords": ["点赞用户", "点赞时间", "帖子标题", "被赞次数", "温馨提示", "帖子内容", "动态标题", "动态内容"] }, { "tid": 688, "title": "挑战结果通知", "type": 2, "categoryId": "794", "keywords": ["挑战名称", "挑战结果", "当前排名", "挑战项目", "挑战时间", "奖励信息", "备注"] }, { "tid": 696, "title": "新的回复提醒", "type": 2, "categoryId": "794", "keywords": ["留言主题", "回复内容", "回复时间", "留言分区", "取消提醒", "用户"] }, { "tid": 726, "title": "审核通过提醒", "type": 2, "categoryId": "794", "keywords": ["审核结果", "帖子主题", "会员昵称", "通过时间", "备注", "活动名称", "活动时间", "组队发起人", "报名时间", "申请方"] } + ] + this.dataList.forEach(element => { + element.typeShow = element.type === 2 ? '一次性订阅' : '长期订阅' + element.keywordsShow = element.keywords.join() + }) + }, + tabClick () { if (this.activeName === 'mine') { this.$refs['ref_mytemp'].init(this.workAppid, this.resiAppid) } if (this.activeName === 'public') { - this.loadData() + if (this.dataList.length === 0) { + this.loadData2() + } + } }, @@ -187,7 +209,7 @@ export default { }, editDiaOK (clientType) { this.activeName = 'mine' - this.$refs['ref_mytemp'].init(this.workAppid, this.resiAppid, clientType) + this.$refs['ref_mytemp'].refreshTable(clientType) }, editDiaCancel () { @@ -196,14 +218,14 @@ export default { handleSizeChange (pageSize) { this.tableParams.pageSize = pageSize - this.tableParams.pageNo = 0 + this.tableParams.pageNo = 1 this.$nextTick(() => { this.loadData() }) }, // 改变当前页 handleCurrentChange (pageNo) { - this.tableParams.pageNo = pageNo - 1 + this.tableParams.pageNo = pageNo this.$nextTick(() => { this.loadData() }) diff --git a/epmet-oper-web/src/views/pages/loginWork.vue b/epmet-oper-web/src/views/pages/loginWork.vue index d155329..d294254 100644 --- a/epmet-oper-web/src/views/pages/loginWork.vue +++ b/epmet-oper-web/src/views/pages/loginWork.vue @@ -318,7 +318,7 @@ export default { float: left; } .span_name { - font-size: 20px; + font-size: 18px; cursor: pointer; /* color: rgb(37, 156, 235); */ float: left;