打开列车驾驶台优化
This commit is contained in:
parent
89012e6290
commit
9738678e54
@ -288,8 +288,8 @@ watch(
|
||||
);
|
||||
|
||||
function tccHide() {
|
||||
lineApp.getScene(`tcc${tccStore.tccId}`).unbindDom();
|
||||
tccStore.clearTccParam();
|
||||
lineApp.getScene('tcc').unbindDom();
|
||||
}
|
||||
|
||||
watch(
|
||||
|
@ -25,8 +25,12 @@ export const useTccStore = defineStore('tcc', {
|
||||
getTccScene() {
|
||||
const lineApp = getLineApp();
|
||||
if (!lineApp) throw Error('未初始化app');
|
||||
lineApp.removeScene('tcc');
|
||||
return initTccScene(lineApp, 'tcc');
|
||||
try {
|
||||
return lineApp.getScene(`tcc${this.tccId}`);
|
||||
} catch (error) {
|
||||
const tccScene = initTccScene(lineApp, `tcc${this.tccId}`);
|
||||
return tccScene;
|
||||
}
|
||||
},
|
||||
setTccParam(tccId: number, trainControlMapId: number) {
|
||||
this.tccId = tccId;
|
||||
@ -34,14 +38,13 @@ export const useTccStore = defineStore('tcc', {
|
||||
this.isTccDialogOpen = true;
|
||||
},
|
||||
clearTccParam() {
|
||||
this.tccId = 0;
|
||||
this.trainControlMapId = 0;
|
||||
this.isTccDialogOpen = false;
|
||||
},
|
||||
onMouseUpFromTccHandle() {
|
||||
const simulationId = useLineStore().simulationId;
|
||||
const tccHandle = (getLineApp() as IGraphicApp)
|
||||
.getScene('tcc')
|
||||
.getScene(`tcc${this.tccId}`)
|
||||
.queryStore.queryById<TccHandle>(this.tccHandleId);
|
||||
if (!simulationId) return;
|
||||
const handleVal = Number(
|
||||
@ -61,7 +64,7 @@ export const useTccStore = defineStore('tcc', {
|
||||
},
|
||||
onMouseUpFromTccKeyDir() {
|
||||
const tccKeyDir = (getLineApp() as IGraphicApp)
|
||||
.getScene('tcc')
|
||||
.getScene(`tcc${this.tccId}`)
|
||||
.queryStore.queryById<TccKey>(this.tccKeyDirId);
|
||||
let position = 0;
|
||||
switch (tccKeyDir._tccKey.rotation) {
|
||||
|
Loading…
Reference in New Issue
Block a user