diff --git a/.env b/.env index b7f7c2a..1783b63 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -VITE_API_HOST=127.0.0.1 +VITE_API_HOST=192.168.1.119 VITE_API_PORT=8080 VITE_WS_PATH=/ws \ No newline at end of file diff --git a/src/services/globalCmd/globalCmd.ts b/src/services/globalCmd/globalCmd.ts index 19bb440..ac6b844 100644 --- a/src/services/globalCmd/globalCmd.ts +++ b/src/services/globalCmd/globalCmd.ts @@ -40,9 +40,16 @@ export type OperationCmd = | "openClaw" // 张开夹爪 | "closeClaw" // 收合夹爪 | "moveMachineArm" // 移动机械臂 - | "moveTube"; // 移动试管 + | "moveTube" // 移动试管 + | 'openDoor' //开门 + | 'closeDoor' //关门 export function debugCmd(params: { command: OperationCmd; params: Record }) { const commandId = addTxnRecord({ ...params, category: "debug" }); return httpRequest>({ url: "/api/cmd/", params: { ...params, commandId }, method: "POST" }); } + +export function taskCmd(params: { command: OperationCmd; params: Record }) { + const commandId = addTxnRecord({ ...params, category: "task" }); + return httpRequest>({ url: "/api/cmd/", params: { ...params, commandId }, method: "POST" }); +} diff --git a/src/services/txn.ts b/src/services/txn.ts index c6f9f73..868bd5f 100644 --- a/src/services/txn.ts +++ b/src/services/txn.ts @@ -22,7 +22,13 @@ type DebugCmdRecord = { params: Record; }; -type TxnRecord = DebugCmdRecord; // | xxxRecord +type TaskCmdRecord = { + category: "task"; + command: OperationCmd; + params: Record; +} + +type TxnRecord = DebugCmdRecord | TaskCmdRecord const txnCmdMap: Record = {}; diff --git a/src/views/graphite/components/AddLiquid.vue b/src/views/graphite/components/AddLiquid.vue index 6445f64..10477bf 100644 --- a/src/views/graphite/components/AddLiquid.vue +++ b/src/views/graphite/components/AddLiquid.vue @@ -14,6 +14,7 @@
已选择{{ selectedTubeList.length }}个试管
+
@@ -60,7 +61,7 @@