调整现地操作

This commit is contained in:
fan 2020-03-17 09:25:40 +08:00
parent 7fce0afd5a
commit b06b2b58e2
2 changed files with 61 additions and 50 deletions

View File

@ -51,44 +51,6 @@ export default {
oldSelected:null,
menuNormal: {
Local: [
// {
// label: '',
// handler: this.arrangementRoute,
// cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
// // auth: { station: false, center: true }
// },
// {
// label: '',
// handler: this.cancelTrainRoute,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
// // auth: { station: false, center: true }
// },
// {
// label: '',
// handler: this.reopenSignal,
// cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
// // auth: { station: false, center: true }
// },
// {
// type: 'separator'
// },
// {
// label: '',
// handler: this.humanControl,
// cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
// // auth: { station: false, center: true }
// },
// {
// label: '',
// handler: this.atsAutoControl,
// cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
// // auth: { station: false, center: true }
// },
// {
// label: '',
// handler: this.detail,
// cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
// }
],
Center: [
{

View File

@ -196,7 +196,7 @@ export default {
case this.Signal.arrangementRoute.button.operation: //
return CMD.Signal.CMD_SIGNAL_SET_ROUTE;
case this.Signal.guide.button.operation: //
return CMD.Section.CMD_SIGNAL_ROUTE_GUIDE;
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
case this.Signal.reopenSignal.button.operation:
return CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
}
@ -219,14 +219,15 @@ export default {
},
methods: {
passWordCommit(data) {
console.log(data);
const operate = {
type: 'mbm',
operation: data.operateNext
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
@ -395,6 +396,58 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
console.log(operate);
},
handleGuideRoute(deviceList) {
if (deviceList.length === 1) {
let route = '';
this.routeList.forEach(item => {
if (item.startSignalCode === deviceList[0].code && this.routeData[item.code].lock) {
route = item;
}
});
if (!route) {
const operate = {
type: 'mbm',
operation: this.$store.state.menuOperation.buttonOperation,
operateNext: this.Command.close.password.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.password.doShow(operate);
}
});
} else {
const operate = {
send: true,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType,
param: {routeCode: route.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.operation = '0';
this.$refs.password.doShow(operate);
}
});
}
} else if (deviceList.length === 2) {
const operate = {
send: true,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType,
param: ''
};
this.routeList.forEach(item => {
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
operate.param = {routeCode: item.code};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
}
});
console.log(operate, '222222222222');
}
},
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
@ -411,19 +464,15 @@ export default {
this.handelFunctionButton(model, subType);
} else if (this.$store.state.menuOperation.buttonOperation === this.MixinCommand.totalCancel.button.operation) {
this.handelTotalCancel(model, subType);
} else if (this.$store.state.menuOperation.buttonOperation === this.Signal.guide.button.operation) {
if (model._type !== 'Signal') {
return;
}
this.handleGuideRoute(this.deviceList);
} else {
const operate = this.handelOperate(model);
if (this.cmdTypeList.indexOf(model._type) >= 0) {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
if (this.operation == this.Signal.guide.button.operation) { //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.operation = '0';
this.$refs.password.doShow(operate);
}
}
});
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
} else {
Handler.clear(); //
this.$store.dispatch('menuOperation/setButtonOperation', null);