diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 71ba395a..9c4d9936 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -107,6 +107,7 @@ Vue.prototype.socket = Socket; Vue.prototype.numberMul = numberMul; Vue.prototype.emitter = emitter; +// 挂载全局事件变更ws响应 Vue.prototype.EventBus = new Vue(); // gis Vue.prototype.$GlobalConfig = config.GlobalConfig; diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue index 6a77ffe0..f14cbdb4 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue @@ -2,8 +2,6 @@
- -
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue index 12a41953..4f7f30e0 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue @@ -18,9 +18,9 @@
-
@@ -195,6 +195,14 @@ export default { getMinMapLayers(); this.$root.$on('delete-event', this.handleRefresh); + //启动监听事件 + this.EventBus.$on("deviceState", deviceList => { + this.updateEventState(deviceList) + }); + + }, + destroyed(){ + this.EventBus.$off("deviceState"); }, beforeDestroy() { this.emitter.off("selectedCompleted", this.selectedCompletedHandle); @@ -270,6 +278,16 @@ export default { handleDevice: debounce(async function (item) { await this.handleDeviceImmediate(item); }, 360), + //更新设备状态 + async updateEventState(eventList){ + markerClusterIns.data.forEach(e => { + const device = _.find(eventList,{iotDeviceId: e.extData.iotDeviceId}) + if(device){ + e.extData.deviceState = device.deviceState; + } + }); + markerClusterIns.setData() + }, async handleRefresh(){ const tab = _.filter(this.tabContentData,{status:'_active'}) try{ diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue index ed52ec15..08b1bca0 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/index.vue @@ -59,16 +59,24 @@ export default { return { planId: "", tableData: [], + subclass:"" }; }, - watch: {}, - mounted() {}, - methods: { - detailChange(eventId) { - if(this.tableData.length === 0){ - this.initData(this.detailData); + watch: { + "provideData.detail"(newValue, oldValue) { + if(this.subclass !== newValue.subclass){ + this.initData(newValue) } + }, + }, + mounted() {}, + methods: { + // detailChange(eventId) { + // if(this.tableData.length === 0){ + // this.initData(this.detailData); + // } + // }, initData(eventInfo) { request({ url: `business/plans/list/event/type`, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue index c97d4145..fc022912 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/DialogProcess/index.vue @@ -1,33 +1,19 @@