佛山有轨电车 代码调整

This commit is contained in:
joylink_cuiweidong 2022-12-27 11:14:05 +08:00
parent 43eb3c4a39
commit 39e82e52dd
4 changed files with 19 additions and 1 deletions

View File

@ -243,6 +243,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { SimulationUserType, OperateMode } from '@/scripts/ConstDic';
// import Handler from '@/scripts/cmdPlugin/Handler';
export default {
@ -284,6 +285,10 @@ export default {
this.selectedChange();
}
},
beforeDestroy() {
this.resetMbmButton();
// Handler.clear(); //
},
methods: {
updateButtonShow(val, old) {
if (old) {
@ -305,6 +310,9 @@ export default {
}
}
},
resetMbmButton() {
this.$store.dispatch('menuOperation/setButtonOperation', null);
},
buttonDown(operation) {
const operate = {
operation: operation
@ -316,13 +324,19 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/emitTipFresh');
}
}).catch(res=>{
this.resetMbmButton();
});
},
selectedChange() {
const model = this.$store.state.menuOperation.selected;
if (!model._type) {
// Handler.clear();
this.$store.dispatch('menuOperation/setButtonOperation', null);
if (this.$store.state.training.roles || (this.$store.state.training.simulationUserType === SimulationUserType.TEACHER && this.$store.state.training.operatemode === OperateMode.FAULT)) {
//
} else {
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}
}
}

View File

@ -210,6 +210,7 @@ export default {
commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}).catch(error=>{
console.log(error);
@ -223,6 +224,7 @@ export default {
commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}).catch(error=>{
console.log(error);

View File

@ -294,6 +294,7 @@ export default {
break;
}
}
this.$store.dispatch('menuOperation/setButtonOperation', null);
},
//
arrangementRoute() {

View File

@ -292,6 +292,7 @@ export default {
break;
}
}
this.$store.dispatch('menuOperation/setButtonOperation', null);
},
//
locate(selectType) {