diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue index a0efe10c..3da4843a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue @@ -29,7 +29,7 @@ import Video from "@screen/components/Video"; import Form from "@screen/components/FormConfig"; import request from "@/utils/request"; import { Message } from "element-ui"; -import moment from "moment"; +import moment, { fn } from "moment"; import Carousel from "@screen/pages/control/event/event/EventDetailDialog/Carousel"; import { WarningTypeList, @@ -183,8 +183,10 @@ export default { }; }, async created() { - this.getDetails(); - this.getVehicleTypeList(); + let self = this; + this.getVehicleTypeList(function(){ + self.getDetails(); + }); }, async mounted() { }, beforeDestroy() { @@ -220,8 +222,11 @@ export default { }); }); }, - getVehicleTypeList() { - if (vehicleTypeList.length) return; + getVehicleTypeList(fn) { + if (vehicleTypeList.length) { + fn() + return + }; request({ url: `/system/dict/data/type/${"sys_vehicle_type"}`, @@ -230,13 +235,13 @@ export default { }) .then(({ data, code }) => { if (code != 200) return Message.error("详情获取失败"); - vehicleTypeList = this.formList[5].options.options = data.map( (item) => ({ key: item.dictValue, label: item.dictLabel, }) ); + fn(); }) .catch((err) => { }); }, @@ -301,10 +306,6 @@ export default { setTimeout(() => { this.$refs.FormConfigRef.reset(true); }); - setTimeout(() => { - this.formList[5].options = { options: - WarningSubclassList[data.warningType] || []}; - }, 100); this.data.direction = DirectionTypes[this.data.direction]; this.data.duration = getDuration(this.data.warningTime); this.interval = setInterval(() => { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/mixin.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/mixin.js index 9d4b8886..13dd9f9e 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/mixin.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/mixin.js @@ -24,7 +24,7 @@ export const dialogDelayVisible = { emits: ["change"], computed: { obverseVisible: { - set(bool) { + set(bool) { try { typeof this.visibleClose === "function" && this.visibleClose?.(bool); } catch (error) {} diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue index 84ffb511..df83a4a8 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue @@ -53,11 +53,11 @@
- - - - - + + + + +