From 778a05f391f4e08ce2d69dbda9a46bb8b5b078c3 Mon Sep 17 00:00:00 2001
From: IPC-610 <IPC-610@DESKTOP-6LEOOS3>
Date: 星期二, 15 十月 2024 16:42:40 +0800
Subject: [PATCH] 修改工作台输送线状态实时更新问题

---
 Web/src/views/device/deviceInfo/index.vue |   36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/Web/src/views/device/deviceInfo/index.vue b/Web/src/views/device/deviceInfo/index.vue
index cac9429..7b827eb 100644
--- a/Web/src/views/device/deviceInfo/index.vue
+++ b/Web/src/views/device/deviceInfo/index.vue
@@ -1,5 +1,5 @@
 <template>
-	<div class="sys-user-container">
+	<div class="sys-user-container" style="overflow: hidden;">
 		<el-row>
 			<el-col :span="3">
 				<el-collapse v-model="activeName">
@@ -19,6 +19,10 @@
 						<el-card class="box-card" shadow="hover" style="margin-top: 3px;">
 							<el-switch v-model="state.boDemo" active-text="" inactive-text="婕旂ず妯″紡"
 								@change="handleSwitchChange('boDemo', $event)"></el-switch>
+						</el-card>
+						<el-card class="box-card" shadow="hover" style="margin-top: 3px;">
+							<el-switch v-model="state.boDrumReversal" active-text="" inactive-text="婊氬姩鍙嶈浆"
+								@change="handleSwitchChange('boDrumReversal', $event)"></el-switch>
 						</el-card>
 					</el-collapse-item>
 
@@ -81,6 +85,7 @@
 import { listStatus, listPosition } from '/@/api/wcs/wcsPlc';
 import { signalR } from './signalR';
 import { cellsDataLine, cellsDataOne, cellsDataTwo, cellsDataThree } from './data';
+import { ElMessage } from "element-plus";
 
 const state = ref<any>({});
 const stackers = ref<any>({});
@@ -100,13 +105,14 @@
 			if (foundCell) {
 				//淇敼楂樺害
 				foundCell.BoxHeight = s.boxHeight;
+				foundCell.EndLocat = s.endLocat;
 			}
 		}
 		else if (s.type == 1) {
 			// 鏇存柊杈撻�佺嚎鏁版嵁
-			updateCellData(cellsDataOne, s);
-			updateCellData(cellsDataTwo, s);
-			updateCellData(cellsDataThree, s);
+			updateCellData(cellsDataOne.value, s);
+			updateCellData(cellsDataTwo.value, s);
+			updateCellData(cellsDataThree.value, s);
 		}
 	});
 };
@@ -135,15 +141,20 @@
 	signalR.off('UpdateService');
 	signalR.on('UpdateService', (data: any) => {
 		state.value = data;
+		if (data.error) {
+			ElMessage({
+				message: data.error,
+				type: "error",
+			});
+		}
 	});
 	signalR.off('PublicPosition');
 	signalR.on('PublicPosition', (data: any) => {
-
 		if (data.type == 1) {
 			// 鏇存柊杈撻�佺嚎鏁版嵁
-			updateCellData(cellsDataOne, data);
-			updateCellData(cellsDataTwo, data);
-			updateCellData(cellsDataThree, data);
+			updateCellData(cellsDataOne.value, data);
+			updateCellData(cellsDataTwo.value, data);
+			updateCellData(cellsDataThree.value, data);
 		}
 		else if (data.type == 0) {
 			// 鏇存柊鍫嗗灈鏈烘暟鎹�
@@ -166,6 +177,7 @@
 	debugger;
 	const foundCell = cellsDataLine.value.find(cell => cell.Code === data.stationNum);
 	if (foundCell) {
+		foundCell.EndLocat = data.endLocat;
 		const startHeight = foundCell.BoxHeight;
 		const targetHeight = data.boxHeight;
 		const duration = 1000; // 鍔ㄧ敾鎸佺画鏃堕棿锛堟绉掞級
@@ -204,7 +216,7 @@
 const activeName = ['1', '2', '3'];
 
 //杈撻�佺嚎鏁版嵁
-let cellsData = ref(cellsDataOne);
+let cellsData = cellsDataOne.value;
 
 
 // 灞傚钩闈㈢姸鎬�
@@ -216,8 +228,8 @@
 
 //鍒囨崲灞傚钩闈�
 function floorTogglePlain(buttonNumber) {
-	const floorData = [cellsDataOne, cellsDataTwo, cellsDataThree];
-
+	const floorData = [cellsDataOne.value, cellsDataTwo.value, cellsDataThree.value];
+	debugger;
 	if (buttonNumber >= 1 && buttonNumber <= 3) {
 		const index = buttonNumber - 1;
 		floorStates.value = {
@@ -225,7 +237,7 @@
 			isPlain2: index !== 1,
 			isPlain3: index !== 2
 		};
-		cellsData.value = floorData[index];
+		cellsData = floorData[index];
 	}
 }
 </script>

--
Gitblit v1.8.0