From 6b68425fc633b7d0daee7a43806ee7498998a40f Mon Sep 17 00:00:00 2001 From: wxw <Administrator@DESKTOP-5BIMHQ3> Date: 星期三, 11 九月 2024 14:44:14 +0800 Subject: [PATCH] Merge branch 'master' into wxw --- Web/src/views/device/deviceMonitor/index.vue | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Web/src/views/device/deviceMonitor/index.vue b/Web/src/views/device/deviceMonitor/index.vue index b404ddf..f66cf15 100644 --- a/Web/src/views/device/deviceMonitor/index.vue +++ b/Web/src/views/device/deviceMonitor/index.vue @@ -114,13 +114,13 @@ </template> <script lang="ts" setup> -import { ref, onMounted } from 'vue'; +import { ref, onMounted } from 'vue'; import { listWcsDevice, writeValue } from '/@/api/wcs/wcsDevice'; import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils'; import { listWcsPlc } from '/@/api/wcs/wcsPlc'; import { ElMessageBox, ElMessage } from 'element-plus'; import setting from '/@/views/device/deviceMonitor/component/setting.vue' -import { signalR } from './signalR'; +import { signalR,stopConnection } from './signalR'; //杩炴帴signalR 鐩戝惉鍙樻洿 onMounted(async () => { signalR.off('PublicPlcDevice'); @@ -133,12 +133,15 @@ } } else if (data.type == 1) { - stations.value.forEach(list => { - var index = list.findIndex(s => s.id == data.id); + lineOptions.value.forEach(s => { + var index = stations.value[s.id].findIndex(s => s.id == data.id); if (index !== -1) { - list.splice(index, 1, data); + stations.value[s.id].splice(index, 1, data); } }); + if (stationValue.value.id == data.id) { + stationValue.value = data; + } } }); }); @@ -169,10 +172,10 @@ } // 鏌ヨ鎿嶄綔 const handleQuery = async () => { - var listplc = await listWcsPlc({ type: 1 }); + const listplc = await listWcsPlc({ type: 1 }); lineOptions.value = listplc.data.result; lineValue.value = listplc.data.result[0].id; - var res = await listWcsDevice(); + const res = await listWcsDevice(); listStackingMachineData.value = res.data.result.filter(s => s.type == 0); const listConveyorLineData = res.data.result.filter(s => s.type == 1); listplc.data.result.forEach(s => { -- Gitblit v1.8.0