This commit is contained in:
zyy 2020-01-08 17:50:22 +08:00
commit 2e042b9fee
3 changed files with 399 additions and 368 deletions

View File

@ -80,263 +80,270 @@ import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/Co
import ConfirmControl from './childDialog/confirmControl';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteHandControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operation: null,
selection: [],
stationName: '',
signalName: '',
allSelect: false
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId;
}
}
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
}
},
commitDisabled() {
let disabled = true;
if (this.selection && this.selection.length) {
disabled = false;
}
name: 'RouteHandControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operation: null,
selection: [],
stationName: '',
signalName: '',
allSelect: false
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId;
} else {
return '';
}
}
},
domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
} else {
return '';
}
},
commitDisabled() {
let disabled = true;
if (this.selection && this.selection.length) {
disabled = false;
}
return disabled;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
return disabled;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
elem.check = false;
elem.disabled = false;
//
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
elem.check = false;
elem.disabled = false;
//
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
elem.controlType != '01') {
elem.disabled = true;
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
elem.disabled = true;
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
elem.controlType == '01') {
elem.disabled = true;
}
});
}
elem.disabled = true;
}
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
}
let num = 0;
this.allSelect = false;
this.tempData.forEach(item => {
if (item.check) {
num++;
if (num == this.tempData.length) {
this.allSelect = true;
}
}
});
},
allSelectChange() {
if (this.allSelect) {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = true;
}
});
} else {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = false;
}
});
}
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
repeat: true,
type: MapDeviceType.Signal.type,
operation: '',
val: this.serializeCodeListWithSeparator('::'),
selection: selection
};
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
}
let num = 0;
this.allSelect = false;
this.tempData.forEach(item => {
if (item.check) {
num++;
if (num == this.tempData.length) {
this.allSelect = true;
}
}
});
},
allSelectChange() {
if (this.allSelect) {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = true;
}
});
} else {
this.tempData.forEach(item => {
if (!item.disabled) {
item.check = false;
}
});
}
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
repeat: true,
type: MapDeviceType.Signal.type,
operation: '',
val: this.serializeCodeListWithSeparator('::'),
selection: selection
};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(`请选择一条数据`);
}
},
commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
this.atsAutoControl();
}
},
//
humanControl() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.humanControl.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(`请选择一条数据`);
}
},
commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
this.atsAutoControl();
}
},
//
humanControl() {
const operate = {
over: true,
// type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.humanControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
//
atsAutoControl() {
const operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.atsAutoControl.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
//
atsAutoControl() {
const operate = {
over: true,
// type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -145,11 +145,11 @@ export default {
}
],
menuForce: [
{
label: '设置计轴失效',
handler: this.alxeFailure
// disabledCallback: MenuDisabledState.Section.alxeFailure
}
// {
// label: '',
// handler: this.alxeFailure
// // disabledCallback: MenuDisabledState.Section.alxeFailure
// }
]
};
},
@ -199,39 +199,40 @@ export default {
this.$refs.popMenu.close();
}
},
//
alxeFailure() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.alxeFailure.menu.operation
};
// //
// alxeFailure() {
// const operate = {
// start: true,
// code: this.selected.code,
// operation: OperationEvent.Section.alxeFailure.menu.operation,
// param: {
// Section_Code: `${this.selected.code}`
// }
// };
mouseCancelState(this.selected);
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
},
// mouseCancelState(this.selected);
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// } else {
// this.$refs.noticeInfo.doShow(operate);
// }
// }).catch(() => {
// this.$refs.noticeInfo.doShow(operate);
// });
// },
//
fault() {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.fault.menu.operation
operation: OperationEvent.Section.fault.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected);
@ -251,11 +252,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.split.menu.operation
operation: OperationEvent.Section.split.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
@ -266,11 +268,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.alxeEffective.menu.operation
operation: OperationEvent.Section.alxeEffective.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.alxeEffective.doShow(operate, this.selected);
@ -282,11 +285,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.active.menu.operation
operation: OperationEvent.Section.active.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
@ -298,11 +302,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.axlePreReset.menu.operation
operation: OperationEvent.Section.axlePreReset.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected);
@ -314,9 +319,10 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.lock.menu.operation
operation: OperationEvent.Section.lock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
@ -330,11 +336,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.unlock.menu.operation
operation: OperationEvent.Section.unlock.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionCmdControl.doShow(operate, this.selected);
@ -359,11 +366,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.setSpeed.menu.operation
operation: OperationEvent.Section.setSpeed.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedLimitControl.doShow(operate, this.selected);
@ -393,11 +401,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.newtrain.menu.operation
operation: OperationEvent.Section.newtrain.menu.operation,
param: {
Section_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainCreate.doShow(operate, this.selected);

View File

@ -174,15 +174,16 @@ export default {
setStoppage() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.stoppage.menu.operation
operation: OperationEvent.Switch.stoppage.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ADD_FAULT,
param: {
Switch_Code: `${this.selected.code}`
}
};
mouseCancelState(this.selected);
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
@ -196,15 +197,16 @@ export default {
cancelStoppage() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.cancelStoppage.menu.operation
operation: OperationEvent.Switch.cancelStoppage.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_REMOVE_FAULT,
param: {
Switch_Code: `${this.selected.code}`
}
};
mouseCancelState(this.selected);
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
@ -219,11 +221,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.lock.menu.operation
operation: OperationEvent.Switch.lock.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
@ -235,11 +238,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.unlock.menu.operation
operation: OperationEvent.Switch.unlock.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
@ -251,11 +255,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.block.menu.operation
operation: OperationEvent.Switch.block.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
@ -267,11 +272,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.unblock.menu.operation
operation: OperationEvent.Switch.unblock.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
@ -283,11 +289,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.turnoutForce.menu.operation
operation: OperationEvent.Switch.turnoutForce.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
@ -299,13 +306,14 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.turnout.menu.operation
operation: OperationEvent.Switch.turnout.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
if (operate.operation) {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
@ -318,11 +326,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.fault.menu.operation
operation: OperationEvent.Switch.fault.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
@ -335,11 +344,12 @@ export default {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.cancelSpeed.menu.operation
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
const tempData = response.data;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -353,11 +363,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.split.menu.operation
operation: OperationEvent.Switch.split.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
@ -369,11 +380,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.active.menu.operation
operation: OperationEvent.Switch.active.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
@ -385,11 +397,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.axlePreReset.menu.operation
operation: OperationEvent.Switch.axlePreReset.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchCmdControl.doShow(operate, this.selected);
@ -401,11 +414,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.setSpeed.menu.operation
operation: OperationEvent.Switch.setSpeed.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.speedLimitControl.doShow(operate, this.selected);
@ -417,11 +431,12 @@ export default {
const operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.alxeEffective.menu.operation
operation: OperationEvent.Switch.alxeEffective.menu.operation,
param: {
Switch_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.alxeEffective.doShow(operate, this.selected);