ibp按钮操作接口修改

This commit is contained in:
Yuan 2023-12-07 09:09:43 +08:00
parent 72bd566c6c
commit b9285d0f65
3 changed files with 6 additions and 6 deletions

View File

@ -105,7 +105,7 @@ export async function setSwitchPosition(data: SetSwitchParams) {
}
export interface IbpButtonOperationParams {
buttonCode: string;
buttonId: string;
down: boolean;
mapId: number;
simulationId: string;

View File

@ -136,23 +136,23 @@ export class IbpButtonInteraction extends GraphicInteractionPlugin<IBPButton> {
const g = e.target as IBPButton;
const changeState = useIbpStore().ibpButtonOperation;
if (g.datas.isSelfReset) {
changeState(g.datas.code, true);
changeState(g.datas.id, true);
} else {
changeState(g.datas.code, !g.state.down);
changeState(g.datas.id, !g.state.down);
}
}
onMouseUp(e: FederatedMouseEvent) {
const changeState = useIbpStore().ibpButtonOperation;
const g = e.target as IBPButton;
if (g.datas.isSelfReset) {
changeState(g.datas.code, false);
changeState(g.datas.id, false);
}
}
onMouseLeave(e: FederatedMouseEvent) {
const changeState = useIbpStore().ibpButtonOperation;
const g = e.target as IBPButton;
if (g.datas.isSelfReset) {
changeState(g.datas.code, false);
changeState(g.datas.id, false);
}
}
}

View File

@ -69,7 +69,7 @@ export const useIbpStore = defineStore('ibp', {
},
async ibpButtonOperation(id: string, down: boolean) {
return await ibpButtonOperation({
buttonCode: id,
buttonId: id,
down,
mapId: Number(this.mapId),
simulationId: this.simulationId,