From 1a6142861a89ed723a7d91dc746cd3e3839a800c Mon Sep 17 00:00:00 2001 From: Yuan Date: Thu, 7 Dec 2023 10:00:57 +0800 Subject: [PATCH] =?UTF-8?q?ibp=E9=92=A5=E5=8C=99=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Simulation.ts | 2 +- src/drawApp/graphics/IbpKeyInteraction.ts | 2 +- src/stores/ibp-store.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/Simulation.ts b/src/api/Simulation.ts index b2d6e85..34ed9d6 100644 --- a/src/api/Simulation.ts +++ b/src/api/Simulation.ts @@ -131,7 +131,7 @@ export interface IbpKeyOperationParams { mapId: number; stationId: string; gear: number; - keyCode: string; + keyId: string; } export async function ibpKeyOperation(params: IbpKeyOperationParams) { diff --git a/src/drawApp/graphics/IbpKeyInteraction.ts b/src/drawApp/graphics/IbpKeyInteraction.ts index 5e496ea..cbc02a5 100644 --- a/src/drawApp/graphics/IbpKeyInteraction.ts +++ b/src/drawApp/graphics/IbpKeyInteraction.ts @@ -101,6 +101,6 @@ export class IbpKeyInteraction extends GraphicInteractionPlugin { onClick(e: FederatedMouseEvent): void { const g = e.target as IbpKey; const changeState = useIbpStore().ibpKeyOperation; - changeState(g.datas.code, g.state.gear === 0 ? 1 : 0); + changeState(g.datas.id, g.state.gear === 0 ? 1 : 0); } } diff --git a/src/stores/ibp-store.ts b/src/stores/ibp-store.ts index e735b9c..e86501b 100644 --- a/src/stores/ibp-store.ts +++ b/src/stores/ibp-store.ts @@ -76,9 +76,9 @@ export const useIbpStore = defineStore('ibp', { stationId: this.stationId, }); }, - async ibpKeyOperation(keyCode: string, gear: number) { + async ibpKeyOperation(keyId: string, gear: number) { return await ibpKeyOperation({ - keyCode, + keyId, gear, mapId: Number(this.mapId), simulationId: this.simulationId,