ibp按钮操作接口修改
This commit is contained in:
parent
72bd566c6c
commit
b9285d0f65
@ -105,7 +105,7 @@ export async function setSwitchPosition(data: SetSwitchParams) {
|
||||
}
|
||||
|
||||
export interface IbpButtonOperationParams {
|
||||
buttonCode: string;
|
||||
buttonId: string;
|
||||
down: boolean;
|
||||
mapId: number;
|
||||
simulationId: string;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user