From c35abc6b21bf8bbf03ba0b29754a58ef0b6db442 Mon Sep 17 00:00:00 2001 From: qingzhengli <1204552371@qq.com> Date: Tue, 19 Mar 2024 20:09:43 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=20=E8=A1=8C=E8=BD=A6=E8=AF=B1=E5=AF=BC?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DeviceControlDialog.vue | 20 +- .../Dialogs/DrivingGuidance/index.vue | 49 +- .../RoadAndEvents/utils/buttonEvent.js | 1 + .../event/plan/addAndEditDialog/index.vue | 1471 ++++++++--------- .../JiHeExpressway/utils/deviceControl.js | 20 + .../src/views/JiHeExpressway/utils/enum.js | 16 + 6 files changed, 799 insertions(+), 778 deletions(-) create mode 100644 ruoyi-ui/src/views/JiHeExpressway/utils/deviceControl.js diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue index d22bb7e3..bb160c92 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue @@ -35,6 +35,7 @@ import request from "@/utils/request"; import { Message } from "element-ui"; // import { axiosIns } from "@screen/utils/axios/auth.js"; +import { handle3CResult } from "@screen/utils/deviceControl.js" const workStatus = [ { @@ -198,24 +199,7 @@ export default { formData.controlType = data.mode; - switch (data.mode) { - case "00": - formData.onWorkStatus = data.onWorkStatus; - formData.inWorkStatus = data.inWorkStatus; - break; - case "01": - case "02": - await this.requestURL("3C") - .then((data2) => { - formData.onWorkStatus = data2.onWorkStatus; - formData.inWorkStatus = data2.inWorkStatus; - - if (data.mode === '01') - formData.displayTime = [data.startDisplay, data.endDisplay]; - }) - .catch(() => { }); - break; - } + await handle3CResult(data, formData, this.requestURL); this.oldFormData = { ...formData }; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue index f4b4479b..dbdd2288 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue @@ -17,10 +17,7 @@ - + @@ -35,7 +32,10 @@ import { } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; import Video from "@screen/components/Video"; import request from "@/utils/request"; - +import { delay } from "@screen/utils/common.js" +import { handle3CResult } from "@screen/utils/deviceControl.js" +import { controlModelMap, gzztMap } from "@screen/utils/enum.js"; +import { find } from "lodash"; import { dialogDelayVisible } from "./../mixin"; // 行车诱导 @@ -116,19 +116,30 @@ export default { .then((data) => { this.dialogData.brand = data.brand; }) - .catch((err) => {}); - - this.requestURL(52) - .then((result) => { - this.data.workMode = { - "00": "手动控制", - "01": "自动控制", - "02": "万年历", - }[result.mode]; - this.data.onWorkStatus = result.onWorkStatus; - this.data.inWorkStatus = result.inWorkStatus; - }) - .catch((err) => {}); + .catch((err) => { }); + + // this.requestURL(52) + // .then((result) => { + // this.data.workMode = { + // "00": "手动控制", + // "01": "自动控制", + // "02": "万年历", + // }[result.mode]; + // this.data.onWorkStatus = result.onWorkStatus; + // this.data.inWorkStatus = result.inWorkStatus; + // }) + // .catch((err) => { }); + this.requestURL() + .then(async (data) => { + await delay(0); + const formData = {}; + formData.controlType = data.mode; + await handle3CResult(data, formData, this.requestURL); + + formData.controlType && (this.$set(this.data, "workMode", controlModelMap[formData.controlType]))//(this.data.workMode = controlModelMap[formData.controlType]); + formData.inWorkStatus && (this.$set(this.data, "inWorkStatus", gzztMap[formData.inWorkStatus]))//(this.data.inWorkStatus = gzztMap[formData.inWorkStatus]); + formData.onWorkStatus && (this.$set(this.data, "onWorkStatus", gzztMap[formData.onWorkStatus]))//(this.data.onWorkStatus = gzztMap[formData.onWorkStatus]); + }); const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark); console.log( @@ -194,7 +205,7 @@ export default { align-items: center; justify-content: end; - > div { + >div { font-size: 16px; padding: 6px 12px; } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js index 911b1124..e69d0b66 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js @@ -100,6 +100,7 @@ function resolveDataOptions(data, config, component, isDefault) { const formData = extData?.otherConfig ? JSON.parse(extData.otherConfig) : null; + console.log(component, "DialogComponent"); this.dialogConfig = { component, data: { 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 8648cb3b..7e87577d 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,65 +1,63 @@ - - - - - - - 交通事件 - 感知事件 - - - - - - - - - - - + + + + + + + 交通事件 + 感知事件 + + + + + + + + + + + - + - - - - + + + + - - + + - - - - 执行操作: - - - - - - - - - - 恢复操作: - - - - - - - + + + + 执行操作: + + + + + + + + + + 恢复操作: + + + + + + + - - 取消 - 保存 - - + + 取消 + 保存 + + \ No newline at end of file + diff --git a/ruoyi-ui/src/views/JiHeExpressway/utils/deviceControl.js b/ruoyi-ui/src/views/JiHeExpressway/utils/deviceControl.js new file mode 100644 index 00000000..6545bb0d --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/utils/deviceControl.js @@ -0,0 +1,20 @@ +export async function handle3CResult(data, formData, requestURL) { + switch (data.mode) { + case "00": + formData.onWorkStatus = data.onWorkStatus; + formData.inWorkStatus = data.inWorkStatus; + break; + case "01": + case "02": + await requestURL("3C") + .then((data2) => { + formData.onWorkStatus = data2.onWorkStatus; + formData.inWorkStatus = data2.inWorkStatus; + + if (data.mode === "01") + formData.displayTime = [data.startDisplay, data.endDisplay]; + }) + .catch(() => {}); + break; + } +} diff --git a/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js b/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js index ff923e15..f8d39568 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js +++ b/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js @@ -309,3 +309,19 @@ export const DirectionTypes = { 3: "济南方向", 2: "双向", }; + +//行车诱导相关 + +export const controlModelMap = { + "00": "手动模式", + "01": "自动模式", + "02": "万年历", +}; + +export const gzztMap = { + "00": "不更新", + "01": "常亮", + "02": "流水", + "03": "闪烁", + "04": "关闭", +};