From d70cc699b8e08027ecdef9dbbb64be409d987b64 Mon Sep 17 00:00:00 2001 From: zhoule Date: Mon, 25 Mar 2024 17:17:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eventPlanDialog/index.vue | 94 ++++++++++++++----- .../EventDetailDialog/formTable/index.vue | 16 ++-- .../EventDetailDialog/qbbDialog/index.vue | 60 ++++++++---- 3 files changed, 120 insertions(+), 50 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 70e04ddf..934e8d13 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 @@ -62,7 +62,9 @@ export default { }, provide() { return { - loadData: throttle(this.loadData, 1000) + loadData: throttle(this.loadData, 1000), + getAutomatic: this.getTemplateAutomatic, + getOriginal: this.getBoardOriginal } }, props: { @@ -99,6 +101,8 @@ export default { automaticInfo: {}, dcExecuteAction: [], deviceData: [], + automaticData: {}, + boardOriginalData: {}, eventOptions: [ { value: 1, @@ -233,7 +237,7 @@ export default { if (it.actionType == 1) { secondFormData.push(action); } else if (it.actionType == 2) { - thirdFormData.push(action); + thirdFormData.push({ ...action, qbb: '默认恢复该情报板上次常态化信息' }); } }) this.secondFormData = secondFormData; @@ -255,30 +259,76 @@ export default { async getTemplateAutomatic() { let url = ''; let data = {}; + let otherConfig = {}; let plan = this.info.find(it => it.planName == this.planName); - if (this.activeName == '-1') {//感知 - url = '/business/plans/warning/confirm'; - data = { - dcEmergencyPlans: plan, - dcWarning: this.eventFormData - } - } else {//交通 - url = '/business/plans/event/automatic'; - data = { - dcEmergencyPlans: plan, - dcEvent: this.eventFormData + console.log('plan', plan) + let action = plan.dcExecuteAction.find(it => it.actionType == 1 && it.deviceType == 2); + if (action) { + otherConfig = JSON.parse(action.otherConfig); + if (this.activeName == '-1') {//感知 + url = '/business/plans/warning/confirm'; + data = { + dcInfoBoardTemplate: otherConfig, + dcWarning: this.eventFormData + } + } else {//交通 + url = '/business/plans/event/automatic'; + data = { + dcInfoBoardTemplate: otherConfig, + dcEvent: this.eventFormData + } } + const result = await request({ + url: url, + method: "post", + data: data + }) + if (result.code != 200) return Message.error(result?.msg); + this.automaticData = result.data; + } else { + console.log('没有情报板,不调用接口'); + this.automaticData = {}; } - const result = await request({ - url: url, - method: "post", - data: data - }) - if (result.code != 200) { - Message.error(result?.msg); - return {}; + return this.automaticData; + }, + async getBoardOriginal() { + let url = ''; + let data = {}; + let plan = this.info.find(it => it.planName == this.planName); + console.log('plan1', plan) + let action = plan.dcExecuteAction.find(it => it.actionType == 1 && it.deviceType == 2); + if (action) { + if (this.activeName == '-1') {//感知 + url = '/business/plans/warning/board/confirm'; + data = { + dcEmergencyPlans: { + ...plan, + executeAction: action + }, + dcWarning: this.eventFormData + } + } else {//交通 + url = '/business/plans/event/board/confirm'; + data = { + dcEmergencyPlans: { + ...plan, + executeAction: action + }, + dcEvent: this.eventFormData + } + } + const result = await request({ + url: url, + method: "post", + data: data + }) + if (result.code != 200) return Message.error(result?.msg); + this.boardOriginalData = result.data; + } else { + console.log('没有情报板,不调用接口'); + this.boardOriginalData = {}; } - return result.data; + return this.boardOriginalData; }, changeRadio(value) { let plan = this.info.find(it => it.planName == value); diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/formTable/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/formTable/index.vue index 1733abc2..f9865651 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/formTable/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/formTable/index.vue @@ -41,6 +41,7 @@ :value="item.id"> + @@ -87,8 +88,8 @@ - + @@ -96,7 +97,7 @@ import Table from '@screen/components/Table.vue'; import Button from '@screen/components/Buttons/Button.vue'; import request from "@/utils/request"; -// import QbbDialog from "../qbbDialog/index.vue"; +import QbbDialog from "../qbbDialog/index.vue"; import { Message } from 'element-ui' import { planDeviceOptions } from "@screen/utils/enum.js"; @@ -106,7 +107,7 @@ export default { components: { Button, Table, - // QbbDialog + QbbDialog }, // model: { // prop: 'visible', @@ -259,10 +260,9 @@ export default { }, clickQbb(index) { this.index = index; - this.qbbData = this.tableData[index].dcInfoBoardTemplate; - if (this.type == 1) { - this.isShowDialog = true; - } + // this.qbbData = this.tableData[index].dcInfoBoardTemplate; + console.log('this.type', this.type) + this.isShowDialog = true; }, onCloseDialog() { this.isShowDialog = false; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/qbbDialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/qbbDialog/index.vue index e0348eae..d8303bbd 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/qbbDialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/qbbDialog/index.vue @@ -4,9 +4,7 @@

预案内容

- - - +

@@ -17,9 +15,7 @@

自动生成

- - - +

@@ -28,7 +24,7 @@

情报板模版

- +
-