Browse Source

fix: 左下角进行中状态未复位

master
zhangjiming 5 months ago
parent
commit
fe37dd7096
  1. 21
      src/views/components/Footer.vue
  2. 10
      src/views/graphite/index.vue

21
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();
});
});

10
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];

Loading…
Cancel
Save