From 2b5a669a1f47e9baf7f6c4b4084c2f35a5278578 Mon Sep 17 00:00:00 2001 From: zhoule Date: Tue, 19 Mar 2024 17:56:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A2=84=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/control/event/event/index.vue | 12 ------ .../event/plan/addAndEditDialog/index.vue | 40 ++++++++++++++++++- .../control/event/plan/formTable/index.vue | 10 ++--- .../pages/control/event/plan/index.vue | 4 +- 4 files changed, 45 insertions(+), 21 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue index 45d927c8..78cf1f81 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue @@ -66,18 +66,6 @@ import { Message } from "element-ui"; import { Loading } from 'element-ui'; import { WarningType as warningTypeMapping, WarningSubclass as warningSubclassTypeMapping } from "@screen/utils/enum.js" -function getRandomData(min = 1, max = 15) { - return Math.floor(Math.random() * (max - min + 1)) + min; -} - -function getMockData() { - return Array.from({ length: getRandomData(9, 24) }).map(() => ({ - time: "2023.12.22 13:00:00", - source: "视频智能识别", - location: "k100+000", - direction: "济南方向", - })); -} const warningSourceMapping = { 1: '视频AI', 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 bea6206b..8648cb3b 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 @@ -412,6 +412,29 @@ const typeMap = { ] } +const gzztMap = { + "01": '常亮', + "02": '流水', + "03": '闪烁', + "04": '关闭', +} +const gzmsMap = { + "SETMD0": "激光关闭", + "SETMD1": "常亮模式", + "SETMD2": "间隔100ms闪烁模式", + "SETMD3": "间隔200ms闪烁模式", + "SETMD4": "间隔500ms闪烁模式", + "SETMD5": "2次闪烁模式", + "SETMD6": "SOS模式", + "SETMD7": "自定义模式1", + "SETMD8": "自定义模式2", + "SETMD9": "自定义模式3", +} +const controlModelMap = { + "00": '手动模式', + "01": '自动模式', + "02": '万年历', +} export default { name: 'addAndEditDialog', components: { @@ -599,7 +622,15 @@ export default { let action = {}; if (it.otherConfig) { let config = JSON.parse(it.otherConfig); - action = { ...it, ...config, qbb: (config?.dcInfoBoardTemplate?.content || '') }; + let qbb = '' + if (config.id) { + qbb = config.content; + config = { dcInfoBoardTemplate: config }; + } + // if (config.state) { + // config.gzms = config.state + // } + action = { ...it, ...config, qbb: qbb }; } if (it.deviceList) { action.deviceList = it.deviceList.split(',').map(str => Number(str)); @@ -653,12 +684,16 @@ export default { if (it.controlModel) { let other = { controlModel: it.controlModel, + controlModelName: controlModelMap[it.controlModel], state: it.state, + name: gzztMap[it.state] } if (it.time && it?.time[0]) { other = { controlModel: it.controlModel, + controlModelName: controlModelMap[it.controlModel], state: it.state, + name: gzztMap[it.state], startTime: it.time[0], endTime: it.time[1] } @@ -668,6 +703,7 @@ export default { if (it.gzms) { data.otherConfig = JSON.stringify({ state: it.gzms, + name: gzmsMap[it.gzms], operationDuration: it.operationDuration, }) } @@ -678,8 +714,8 @@ export default { if (valid) { // this.submitting = false; let secondFormTable = this.$refs['secondFormTable'].tableData || []; - // console.log('12', secondFormTable); let thirdFormTable = this.$refs['thirdFormTable'].tableData || []; + console.log('12', thirdFormTable); let dcArr = []; let id = ''; if (this.dialogType == 2) id = this.planId; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue index dae791e5..e3804335 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue @@ -55,11 +55,11 @@
- - - + + + - @@ -329,7 +329,7 @@ export default { }, dialogSubmit(data) { this.tableData[this.index].qbb = data.content; - this.tableData[this.index].otherConfig = JSON.stringify({ dcInfoBoardTemplate: data }); + this.tableData[this.index].otherConfig = JSON.stringify(data); } } } 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 c1ec7f7f..77b20840 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 @@ -28,7 +28,7 @@ - + @@ -146,7 +146,7 @@ export default { result.rows.forEach(it => { it.strEventCategory = it.eventCategory == 1 ? '交通事件' : '感知事件'; it.strEventType = eventTypeMap[it.eventCategory || 0][it.eventType]; - it.strDeviceType = deviceMap[it.deviceType]; + // it.strDeviceType = deviceMap[it.deviceType]; }) this.tableData = result.rows; this.total = result.total; From 633e287c7377344f8db659dcb90160ff6af5db53 Mon Sep 17 00:00:00 2001 From: zhoule Date: Tue, 19 Mar 2024 18:19:56 +0800 Subject: [PATCH 2/4] bug --- .../eventPlanDialog/index.vue | 29 ++++++------------- .../event/event/EventDetailDialog/index.vue | 6 ++-- .../pages/control/event/plan/index.vue | 2 +- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/eventPlanDialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/eventPlanDialog/index.vue index fb7721a6..d13d831f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/eventPlanDialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/eventPlanDialog/index.vue @@ -4,8 +4,7 @@
- - +
@@ -68,9 +67,9 @@ export default { }, props: { visible: Boolean, - detail: { - type: Object, - default: () => { } + info: { + type: Array, + default: () => [] } }, data() { @@ -95,6 +94,7 @@ export default { qbb: '' }], planName: '', + dcExecuteAction: [], deviceData: [], eventOptions: [ { @@ -198,6 +198,8 @@ export default { modelVisible: { get() { if (this.visible) { + this.planName = this.info[0]?.planName || ''; + this.dcExecuteAction = this.info[0]?.dcExecuteAction || []; } return this.visible; }, @@ -207,16 +209,8 @@ export default { }, }, methods: { - initData(id = 1) { - request({ - url: `/business/plans/list/${id}`, - method: "get", - }).then((result) => { - if (result.code != 200) return Message.error(result?.msg); - let data = result.data; - let dcExecuteAction = result.data.dcExecuteAction; - - this.planId = data.id; + initData(data) { + this.planId = data.id; this.formData = { eventCategory: data.eventCategory, planName: data.planName, @@ -236,11 +230,6 @@ export default { } }) - }).catch((err) => { - console.log(err) - Message.error("查询事件预案列表失败", err); - }) - }, async loadData() { if (this.deviceData.length <= 0) { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue index 8e7d6f29..fc7b1da8 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue @@ -18,7 +18,7 @@
- +