操作弹框自动关闭
This commit is contained in:
parent
fe46019070
commit
e9ddf033a3
@ -159,7 +159,7 @@
|
||||
import { Turnout } from 'src/graphics/turnout/Turnout';
|
||||
import { useLineStore } from 'src/stores/line-store';
|
||||
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
||||
import { Dialog } from 'quasar';
|
||||
import { Dialog, DialogChainObject } from 'quasar';
|
||||
import { TurnoutStates } from 'src/drawApp/graphics/TurnoutInteraction';
|
||||
import TurnoutOperation from 'src/components/draw-app/dialogs/TurnoutOperation.vue';
|
||||
import { JlGraphic } from 'jl-graphic';
|
||||
@ -225,10 +225,12 @@ onUnmounted(() => {
|
||||
});
|
||||
|
||||
const options = [{ label: '设置参数' }];
|
||||
let turnoutOpreratDialogInstance: DialogChainObject | null = null;
|
||||
function doTurnoutOperation(item: { label: string }) {
|
||||
if (!lineStore.simulationId) return;
|
||||
if (item.label == '设置参数') {
|
||||
Dialog.create({
|
||||
if (turnoutOpreratDialogInstance) return;
|
||||
turnoutOpreratDialogInstance = Dialog.create({
|
||||
title: '道岔设置参数',
|
||||
message: '',
|
||||
component: TurnoutOperation,
|
||||
@ -239,6 +241,8 @@ function doTurnoutOperation(item: { label: string }) {
|
||||
},
|
||||
cancel: true,
|
||||
persistent: true,
|
||||
}).onCancel(() => {
|
||||
turnoutOpreratDialogInstance = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -257,4 +261,10 @@ function updateState(newVal: TurnoutStates) {
|
||||
turnoutState.value = newVal.clone() as TurnoutStates;
|
||||
forcePosition.value = turnoutState.value.param.forcePosition;
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (turnoutOpreratDialogInstance) {
|
||||
turnoutOpreratDialogInstance?.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -22,11 +22,10 @@ import {
|
||||
TurnoutSectionHitArea,
|
||||
} from 'src/graphics/turnout/TurnoutDrawAssistant';
|
||||
import { useLineStore } from 'src/stores/line-store';
|
||||
import { SetSwitchParams, setSwitchPosition } from 'src/api/Simulation';
|
||||
import { Dialog, Notify } from 'quasar';
|
||||
import AddTrainDialog from '../../components/draw-app/dialogs/AddTrainDialog.vue';
|
||||
import { addTrain } from 'src/api/Simulation';
|
||||
import { errorNotify, successNotify } from 'src/utils/CommonNotify';
|
||||
import { successNotify } from 'src/utils/CommonNotify';
|
||||
import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting';
|
||||
import TurnoutOperation from 'src/components/draw-app/dialogs/TurnoutOperation.vue';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
|
Loading…
Reference in New Issue
Block a user