This commit is contained in:
joylink_fanyuhong 2020-02-18 14:45:42 +08:00
commit 7cc0246adf
4 changed files with 69 additions and 46 deletions

View File

@ -55,8 +55,8 @@ export default {
selected: null,
operation: null,
stationName: '',
signalName: ''
signalName: '',
operateName:''
};
},
computed: {
@ -70,7 +70,8 @@ export default {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
// if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
if (this.operateName == CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE.value) {
return '取消列车进路';
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
return '信号关灯';
@ -100,6 +101,7 @@ export default {
}
}
this.operation = operate.operation;
this.operateName = operate.operateName;
}
this.dialogShow = true;
this.$nextTick(function () {
@ -113,7 +115,8 @@ export default {
mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
// if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
if (this.operateName == CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE.value) {
/** 取消列车进路*/
this.cancelTrainRoute();
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
@ -138,10 +141,10 @@ export default {
cancelTrainRouteFunc() {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
operation:this.operation,
// operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;

View File

@ -230,7 +230,8 @@ export default {
if (this.row && this.row.canSetting) {
const operate = {
over: true,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
// operation: OperationEvent.Signal.arrangementRoute.menu.operation,
operate:this.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
param: {
routeCode: this.row.code

View File

@ -253,49 +253,64 @@ export default {
},
//
arrangementRoute() {
const operate = {
start: true,
// send: true,
code: this.selected.code,
// type: MapDeviceType.Signal.type,
// label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
param: {
signalCode: `${this.selected.code}`
}
};
const command = MenuContextHandler.getCommandByCmdType(CMD.Signal.CMD_SIGNAL_SET_ROUTE);
if (command) {
const operate = {
start: true,
// send: true,
code: this.selected.code,
// type: MapDeviceType.Signal.type,
// label: MapDeviceType.Signal.label,
operation:command.id,
// operation: OperationEvent.Signal.arrangementRoute.menu.operation,
param: {
signalCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
const routes = [];
this.routeList.forEach(elem => {
if (elem.startSignalCode === this.selected.code) {
routes.push(elem);
}
});
this.$refs.routeSelection.doShow(operate, this.selected, routes);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
const routes = [];
this.routeList.forEach(elem => {
if (elem.startSignalCode === this.selected.code) {
routes.push(elem);
}
});
this.$refs.routeSelection.doShow(operate.operation, this.selected, routes);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
} else {
this.$refs.noticeInfo.doShow({}, '该指令不存在');
console.error('该指令不存在,可能是指令字典里面没有该指令,可能是指令每句里面没有该指令');
}
},
//
cancelTrainRoute() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
param: {
signalCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
});
const command = MenuContextHandler.getCommandByCmdType(CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE);
if (command) {
const operate = {
start: true,
code: this.selected.code,
operation:command.id,
operateName:command.operate,
// operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
param: {
signalCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
}
});
} else {
this.$refs.noticeInfo.doShow({}, '该指令不存在');
console.error('该指令不存在,可能是指令字典里面没有该指令,可能是指令每句里面没有该指令');
}
},
// //
// lock() {

View File

@ -121,6 +121,10 @@ class MenuContextHandler {
return menu;
}
getCommandByCmdType(cmdType) {
return CommandHandler.getDefinition(cmdType);
}
menuBarConvert(menu, mode) {
if (menu) {
if (mode === OperateMode.NORMAL) {