From f49de44b69924fc3c4dfea159b13a412983b8f93 Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期二, 16 一月 2024 13:52:28 +0800 Subject: [PATCH] 增加交互状态界面 I/O标志缩小增加备注 --- CanadaMes-ui/src/views/Electrical/ServoManualone.vue | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue index 8244745..956ea14 100644 --- a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue +++ b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue @@ -90,6 +90,14 @@ active-class="blue-button" >{{ $t("Speed parameter settings") }}</router-link > + + <router-link + to="/Electrical/InteractionState" + tag="el-button" + type="text" + active-class="blue-button" + >{{ $t("InteractionState") }}</router-link + > </el-breadcrumb> <el-row :gutter="26"> @@ -502,7 +510,7 @@ } if (currentButtonName === "鍥為浂" || currentButtonName === "Home") { - const data3 = []; + const resetButtonValues3 = this.jsonData .map((item) => { const buttonItem3 = item.find( @@ -515,14 +523,14 @@ .filter((value) => value !== null); // 灏嗗緱鍒扮殑鍊兼坊鍔犲埌 data 鏁扮粍涓� - data3.push(resetButtonValues3.flat()); + data.push(resetButtonValues3.flat()); // 鍦� data3 鏁扮粍鍓嶉潰娣诲姞涓や釜绌烘暟缁� - data3.unshift([], [], []); - data3.push([], [], [], []); + data.unshift([], [], []); + data.push([], [], [], []); // 鍒涘缓 jsonObject3 瀵硅薄锛屽苟娣诲姞 data3 灞炴�� - jsonObject = { data: data3 }; + jsonObject = { data }; } if ( currentButtonName === "A01鍗婅嚜鍔�" || @@ -657,6 +665,19 @@ const jsonString = JSON.stringify(jsonObject); console.log("鎵�鏈塗ype涓�0鐨剉alue:", jsonString); socket?.send(jsonString); + + setTimeout(() => { + const reversedData = data.map(values => values.map(value => { + return (!value || value === 0) ? 0 : 0 ; + })); + + const reversedJsonObject = { data: reversedData }; + + // 鎻愪氦鏁版嵁鍒板悗绔� + const reversedJsonString = JSON.stringify(reversedJsonObject); + console.log('鍙嶈浆鍚�:', reversedJsonString); + socket?.send(reversedJsonString); + }, 1000); }, initWebSocket() { -- Gitblit v1.8.0