操作调整

This commit is contained in:
fan 2020-06-12 16:15:20 +08:00
parent 71a99f225c
commit 8fc521a780
2 changed files with 38 additions and 81 deletions

View File

@ -238,125 +238,76 @@ export default {
}, },
// //
split() { split() {
const step = { commitOperate(menuOperate.Section.split, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.split.menu.operation,
param: {
sectionCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(step, this.selected);
} }
}); });
}, },
// //
active() { active() {
const step = { commitOperate(menuOperate.Section.active, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.active.menu.operation,
param: {
sectionCode: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(step, this.selected);
} }
}); });
}, },
// //
axlePreReset() { axlePreReset() {
const step = { commitOperate(menuOperate.Section.axlePreReset, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.axlePreReset.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionCmdControl.doShow(operate, this.selected);
this.$refs.sectionCmdControl.doShow(step, this.selected);
} }
}); });
}, },
// //
lock() { lock() {
const step = { commitOperate(menuOperate.Section.lock, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.lock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionControl.doShow(operate, this.selected);
this.$refs.sectionControl.doShow(step, this.selected);
} }
}); });
}, },
// //
unlock() { unlock() {
const step = { commitOperate(menuOperate.Section.unlock, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.unlock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionCmdControl.doShow(operate, this.selected);
this.$refs.sectionCmdControl.doShow(step, this.selected);
} }
}); });
}, },
// //
setSpeed() { setSpeed() {
const step = { commitOperate(menuOperate.Section.setSpeed, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.setSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.speedCmdControl.doShow(operate, this.selected);
this.$refs.speedCmdControl.doShow(step, this.selected);
} }
}); });
}, },
// //
cancelSpeed() { cancelSpeed() {
const step = { commitOperate(menuOperate.Section.cancelSpeed, {sectionCode: this.selected.code}, 0).then(({valid, operate}) => {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Section.cancelSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.speedCmdControl.doShow(operate, this.selected);
Handler.execute(CMD.Section.CMD_QUERY, {}).then(resp => {
const tempData = resp.data;
this.$refs.speedCmdControl.doShow(step, this.selected, tempData);
});
} }
}); });
// const step = {
// start: true,
// code: `${this.selected.code}`,
// operation: OperationEvent.Section.cancelSpeed.menu.operation,
// param: {
// Section_Code: `${this.selected.code}`
// }
// };
// this.$store.dispatch('training/next', step).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// Handler.execute(CMD.Section.CMD_QUERY, {}).then(resp => {
// const tempData = resp.data;
// this.$refs.speedCmdControl.doShow(step, this.selected, tempData);
// });
// }
// });
} }
} }
}; };

View File

@ -18,7 +18,13 @@ class CommandHandle {
Common: { Common: {
Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Train_Init_Plan: {operate: 'Train_Init_Plan', paramList: [{name: 'sectionCode'}, {name: 'serviceNumber'}, {name: 'tripNumber'}]} Train_Init_Plan: {
operate: 'Train_Init_Plan',
paramList: [{name: 'sectionCode'}, {name: 'serviceNumber'}, {name: 'tripNumber'}],
simulationRole: 'Center',
controlMode: ['OperateCenterControl'],
conditionList: []
}
} }
}; };
(list || []).forEach(definition => { (list || []).forEach(definition => {