From 1ae7f5709fa16f2036ed9fabe0cf5ff8df75c87c Mon Sep 17 00:00:00 2001 From: zhoule Date: Thu, 14 Mar 2024 15:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E9=A2=84=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/plan/addAndEditDialog/index.vue | 221 +++++++++++------- .../pages/control/event/plan/data.js | 99 +++----- .../control/event/plan/formTable/index.vue | 138 ++++------- .../pages/control/event/plan/index.vue | 27 ++- 4 files changed, 228 insertions(+), 257 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue index 95811c77..ae8017d7 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue @@ -1,5 +1,5 @@ - + - + @@ -112,20 +116,24 @@ export default { props: { visible: Boolean, eventType: Number, - // process: { - // type: Array, - // default: () => [] - // } + tableData: { + type: Array, + default: () => [{ + deviceType: 1, + searchRule: 1, + qbb: '安全行驶' + }] + } }, data() { return { - tableData: [ - { - deviceType: 1, - phrases2: 1, - phrases4: '安全行驶' - } - ], + // tableData: [ + // { + // deviceType: 1, + // searchRule: 1, + // qbb: '安全行驶' + // } + // ], deviceOptions: [ { value: 1, @@ -208,53 +216,14 @@ export default { } }, methods: { - getProcess() { - this.tableData = []; - request({ - url: `/business/dcEventType/${this.eventType}`, - method: "get", - }).then(result => { - if (result.code != 200) return Message.error(result.msg); - //流程列表 - this.process = []; - this.tableData = []; - result.data.processConfigList?.forEach((it, index) => { - let commonPhrasesArr = it.commonPhrases ? it.commonPhrases.split(',') : ['']; - let phrs = []; - commonPhrasesArr?.forEach(phr => { - phrs.push({ id: it.id, phrases: phr }) - }) - this.process.push({ - ...it, - phrs: phrs, - label: it.processNode, - isActive: index == 0 ? true : false, - }) - if (index == 0) { - this.id = it.id; - this.tableData = phrs; - } - }) - - }) - }, changeDeviceType(value) { this.deviceType = value; }, - getTableData() { - let rows = this.process.find(item => item.id == this.id); - return rows?.phrs || []; - }, - updateTableData(id = 1) { - this.id = id; - this.tableData = []; - let pros = this.process.find(item => item.id == id); - this.tableData = pros.phrs; - }, onAdd(id) { this.tableData.push({ - id: id, - phrases: '' + deviceType: 1, + // searchRule: 1, + // qbb: '安全行驶' }) }, onDel(index) { @@ -263,35 +232,6 @@ export default { } this.tableData.splice(index, 1) }, - submitTable() { - let data = [] - this.process.forEach((lc) => { - let commonPhrases = []; - lc.phrs.forEach(phr => { if (phr.phrases) commonPhrases.push(phr.phrases) }) - data.push({ - commonPhrases: commonPhrases.join(','), - id: lc.id, - eventType: lc.eventType, - nodeNode: lc.nodeNode, - processNode: lc.processNode - }) - }) - console.log('data', data) - // return; - request({ - url: `/business/dcEventType/updateDcProcessConfig`, - method: "post", - data: { - eventType: this.eventType, - processConfigList: data - } - }).then(result => { - if (result.code != 200) return Message.error(result.msg); - Message.success(result.msg); - this.modelVisible = false; - this.$emit('reInitData', true) - }) - } } } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue index 5ec17711..d9153625 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue @@ -17,8 +17,8 @@ 刷新 - + @@ -41,8 +41,7 @@ - +