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 5080769c..efaad632 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 @@ -21,32 +21,7 @@ import Form from "@screen/components/FormConfig"; import { Message } from "element-ui"; // import { axiosIns } from "@screen/utils/axios/auth.js"; -import { handle3CResult } from "@screen/utils/deviceControl.js"; import DeviceParam from "./DeviceParam.vue"; -const workStatus = [ - { - key: "00", - label: "不更新状态", - disabled: false, - }, - { - key: "01", - label: "常亮", - }, - { - key: "02", - label: "流水", - }, - { - key: "03", - label: "闪烁", - }, - { - key: "04", - label: "关闭", - disabled: false, - }, -]; export default { name: "DeviceControlDialog", diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue index 9a92dfd8..9b9decee 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue @@ -79,7 +79,7 @@ export default { default: () => [] } }, - inject: ["requestURL"], + inject: ["requestURL", "updateFormData"], data() { return { formData: {}, @@ -267,6 +267,7 @@ export default { // ); break; } + console.log(result, "resultxxxxx") batchFunctions({ devices: devices, functions: functions @@ -275,6 +276,7 @@ export default { .then(() => { this.$emit("update:value", false); // this.modelVisible = false; Message.success(`操作成功`); + this.updateFormData({ ...result, workMode: result.mode }); }) .catch((err) => { console.log( 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 31cc6dd6..6ec632b5 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 @@ -37,7 +37,7 @@ 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 { find, assign } from "lodash"; import { dialogDelayVisible } from "./../mixin"; import LineChart from "../../LineChart/index.vue"; @@ -48,6 +48,7 @@ export default { provide() { return { requestURL: this.requestURL, + updateFormData: this.updateFormData }; }, components: { @@ -138,13 +139,7 @@ export default { 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]); + this.updateFormData({ ...formData, workMode: data.mode }); }); const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark); @@ -157,6 +152,15 @@ export default { if (roadInfo) this.data.roadName = roadInfo.roadName; }, methods: { + updateFormData(formData) { + formData.workMode && + this.$set(this.data, "workMode", controlModelMap[formData.workMode]); //(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]); + + }, handleClickTabs() { }, requestURL(functionId = 52, options = {}) { return new Promise((resolve, reject) => {