From fe37dd709606c6ceef7f675d31358b584e859b3a Mon Sep 17 00:00:00 2001 From: zhangjiming Date: Wed, 26 Feb 2025 17:27:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A6=E4=B8=8B=E8=A7=92=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=AD=E7=8A=B6=E6=80=81=E6=9C=AA=E5=A4=8D=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/Footer.vue | 21 --------------------- src/views/graphite/index.vue | 10 ++++++++++ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/views/components/Footer.vue b/src/views/components/Footer.vue index 3caa6ce..e17fcac 100644 --- a/src/views/components/Footer.vue +++ b/src/views/components/Footer.vue @@ -55,26 +55,6 @@ function testStatus() { } } onMounted(() => { - const wsClient = createWebSocket(sharedWsUrl); - const subscription = wsClient.dataOb.subscribe(data => { - if (data.type === "cmd") { - const cmdInfo = peekTxnRecord(data.data.commandId, "task"); - if (cmdInfo) { - if ( - cmdInfo.command === "openDoor" || - cmdInfo.command === "closeDoor" || - cmdInfo.command === "startShakeUp" || - cmdInfo.command === "injectFluid" || - cmdInfo.command === "moveToActionArea" || - cmdInfo.command === "moveToHeatArea" - ) { - setOnGoingStatus("idle"); - } - } - } - }); - wsClient.connect(); - const subscription2 = onGoingStatusOb.subscribe(status => { if (status === "idle") { statusStr.value = "等待指令"; @@ -94,7 +74,6 @@ onMounted(() => { }); onUnmounted(() => { - subscription.unsubscribe(); subscription2.unsubscribe(); }); }); diff --git a/src/views/graphite/index.vue b/src/views/graphite/index.vue index d218507..d72d81e 100644 --- a/src/views/graphite/index.vue +++ b/src/views/graphite/index.vue @@ -162,6 +162,16 @@ onMounted(() => { if (data.type === "cmd") { const cmdInfo = getTxnRecord(data.data.commandId, "task"); if (cmdInfo) { + if ( + cmdInfo.command === "openDoor" || + cmdInfo.command === "closeDoor" || + cmdInfo.command === "startShakeUp" || + cmdInfo.command === "injectFluid" || + cmdInfo.command === "moveToActionArea" || + cmdInfo.command === "moveToHeatArea" + ) { + setOnGoingStatus("idle"); + } const command:any = cmdInfo.command; //@ts-ignore const cmdName = CmdDescMap[command];