This commit is contained in:
joylink_cuiweidong 2020-07-01 11:27:25 +08:00
commit 778bd7568b
4 changed files with 65 additions and 27 deletions

View File

@ -121,6 +121,9 @@ export default {
doShow(operate) { doShow(operate) {
this.operate = operate || {}; this.operate = operate || {};
this.operation = operate.operation; this.operation = operate.operation;
if (operate.operateNext) {
this.operation = operate.operateNext;
}
this.dialogShow = true; this.dialogShow = true;
this.checkHasInput = false; this.checkHasInput = false;
this.$nextTick(function () { this.$nextTick(function () {

View File

@ -139,7 +139,8 @@ export default {
offset: {}, offset: {},
commandTypeList: [], commandTypeList: [],
cmdTypeList: [], cmdTypeList: [],
deviceList: [] deviceList: [],
routeListFilter: []
}; };
}, },
computed: { computed: {
@ -222,7 +223,7 @@ export default {
methods: { methods: {
passWordCommit(data) { passWordCommit(data) {
const operate = { const operate = {
operation: data.operation operation: data.operateNext
}; };
this.trainingOperation(operate); this.trainingOperation(operate);
}, },
@ -276,7 +277,7 @@ export default {
const operate = { const operate = {
operation: operation operation: operation
}; };
const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, this.Switch.unlock.button.operation, this.MixinCommand.unblock.button.operation, this.Station.guideLock.button.operation]; const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, this.Switch.unlock.button.operation, this.MixinCommand.unblock.button.operation, this.Station.guideLock.button.operation, this.MixinCommand.totalCancel.button.operation];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.operation = operation; this.operation = operation;
@ -284,6 +285,7 @@ export default {
this.$store.dispatch('menuOperation/setButtonOperation', operation); // this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (operationList.includes(operation)) { if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate); this.$refs.password.doShow(operate);
} }
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -305,42 +307,49 @@ export default {
} }
}, },
arrangementRouteOperation(deviceList) { arrangementRouteOperation(deviceList) {
const routes = [];
const operate = { const operate = {
over: true, operation: this.$store.state.menuOperation.buttonOperation
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: '',
param: ''
}; };
let isArrangementRoute = false; let isArrangementRoute = false;
if (deviceList.length === 1) { if (deviceList.length === 1) {
this.routeListFilter = [];
this.routeList.forEach(item => { this.routeList.forEach(item => {
if (item.startSignalCode === deviceList[0].code) { if (item.startSignalCode === deviceList[0].code) {
if (this.routeData[item.code].setting) { if (this.routeData[item.code].setting) {
isArrangementRoute = true; isArrangementRoute = true;
} }
routes.push(item); this.routeListFilter.push(item);
} }
}); });
const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].code); const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].code);
if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) { if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL; operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
operate.code = deviceList[0].code;
operate.param = {signalCode: deviceList[0].code}; operate.param = {signalCode: deviceList[0].code};
this.deviceList = []; this.deviceList = [];
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => { this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
this.$refs.noticeInfo.doShow(operate, error); this.$refs.noticeInfo.doShow();
});
} else {
operate.code = deviceList[0].code; //
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
this.$refs.noticeInfo.doShow();
}); });
} }
} else if (deviceList.length === 2) { } else if (deviceList.length === 2) {
let flag = false; let flag = false;
this.routeList.forEach(item => { this.routeListFilter.forEach(item => {
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) { if (item.endSignalCode === deviceList[1].code) {
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
operate.code = deviceList[1].code;
operate.param = {routeCode: item.code}; operate.param = {routeCode: item.code};
this.deviceList = []; this.deviceList = [];
flag = true; flag = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => { this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.$refs.noticeInfo.doShow(operate, error.message); this.routeListFilter = [];
}).catch(() => {
this.$refs.noticeInfo.doShow();
}); });
} }
}); });
@ -394,6 +403,7 @@ export default {
handelTotalCancel(model, subType) { handelTotalCancel(model, subType) {
const operate = { const operate = {
over: true, over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation, operation: this.$store.state.menuOperation.buttonOperation,
cmdType: '', cmdType: '',
param: {} param: {}
@ -437,11 +447,13 @@ export default {
}); });
if (!route) { if (!route) {
const operate = { const operate = {
code: deviceList[0].code,
operation: this.$store.state.menuOperation.buttonOperation operation: this.$store.state.menuOperation.buttonOperation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate); this.$refs.password.doShow(operate);
} }
}).catch((error) => { }).catch((error) => {
@ -450,6 +462,7 @@ export default {
} else { } else {
const operate = { const operate = {
over: true, over: true,
code: deviceList[0].code,
operation: this.$store.state.menuOperation.buttonOperation, operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType, cmdType: this.cmdType,
param: {routeCode: route.code} param: {routeCode: route.code}
@ -458,6 +471,7 @@ export default {
if (valid) { if (valid) {
this.deviceList = []; this.deviceList = [];
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate); this.$refs.password.doShow(operate);
} }
}).catch((error) => { }).catch((error) => {
@ -467,6 +481,7 @@ export default {
} else if (deviceList.length === 2) { } else if (deviceList.length === 2) {
const operate = { const operate = {
over: true, over: true,
code: deviceList[1].code,
operation: this.$store.state.menuOperation.buttonOperation, operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType, cmdType: this.cmdType,
param: '' param: ''
@ -511,6 +526,7 @@ export default {
const routeCodeList = []; const routeCodeList = [];
const operate = { const operate = {
over: true, over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation, operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType, cmdType: this.cmdType,
param: {} param: {}
@ -529,6 +545,7 @@ export default {
handelSwitchOperate(model) { handelSwitchOperate(model) {
const operate = { const operate = {
over: true, over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation, operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType, cmdType: this.cmdType,
param: { switchCode: model.code} param: { switchCode: model.code}
@ -541,6 +558,7 @@ export default {
const buttonOperation = this.$store.state.menuOperation.buttonOperation; const buttonOperation = this.$store.state.menuOperation.buttonOperation;
const operate = { const operate = {
over: true, over: true,
code: model.code,
operation: buttonOperation, operation: buttonOperation,
cmdType: '', cmdType: '',
param: {} param: {}
@ -565,6 +583,7 @@ export default {
handelGuideLock(model) { handelGuideLock(model) {
const operate = { const operate = {
over: true, over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation, operation: this.$store.state.menuOperation.buttonOperation,
cmdType: '', cmdType: '',
param: {stationCode: model.stationCode} param: {stationCode: model.stationCode}
@ -578,6 +597,18 @@ export default {
this.$refs.noticeInfo.doShow(operate, error.message); this.$refs.noticeInfo.doShow(operate, error.message);
}); });
}, },
handelFaultSection(model) {
const operate = {
over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
param: {sectionCode: model.code}
};
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
selectedChange() { selectedChange() {
// //
const buttonOperation = this.$store.state.menuOperation.buttonOperation; const buttonOperation = this.$store.state.menuOperation.buttonOperation;
@ -609,6 +640,8 @@ export default {
this.handelBlockOrUnblock(model); this.handelBlockOrUnblock(model);
} else if (buttonOperation === this.Station.guideLock.button.operation) { } else if (buttonOperation === this.Station.guideLock.button.operation) {
this.handelGuideLock(model); this.handelGuideLock(model);
} else if (buttonOperation === this.Section.fault.button.operation) {
this.handelFaultSection(model);
} else { } else {
Handler.clear(); // Handler.clear(); //
this.$store.dispatch('menuOperation/setButtonOperation', null); this.$store.dispatch('menuOperation/setButtonOperation', null);

View File

@ -71,7 +71,7 @@ export default {
stepVOList: [ stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3080', tip: '鼠标左键点击【引导进路】' }, { deviceType: '04', orderNum: 1, operateCode: '3080', tip: '鼠标左键点击【引导进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3080', tip: '鼠标左键点击【{5}】', codeType:'START_SIGNAL'}, // 进路编号值不正确 { deviceType: '04', orderNum: 2, operateCode: '3080', tip: '鼠标左键点击【{5}】', codeType:'START_SIGNAL'}, // 进路编号值不正确
{ deviceType: '04', orderNum: 3, operateCode: '3080', tip: '输入密码123点击【确定】按钮' }, { deviceType: '04', orderNum: 3, operateCode: '0011', tip: '输入密码123点击【确定】按钮' },
{ deviceType: '04', orderNum: 4, operateCode: '3080', tip: '鼠标左键点击【{5}】', codeType:'END_SIGNAL' } { deviceType: '04', orderNum: 4, operateCode: '3080', tip: '鼠标左键点击【{5}】', codeType:'END_SIGNAL' }
] ]
}, },
@ -99,9 +99,9 @@ export default {
trainingType: 'Signal', trainingType: 'Signal',
productTypes: ['01'], productTypes: ['01'],
stepVOList: [ stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3030', tip: '鼠标左键点击【总取消】' }, { deviceType: '04', orderNum: 1, operateCode: '2994', tip: '鼠标左键点击【总取消】' },
{ deviceType: '04', orderNum: 2, operateCode: '3030', tip: '输入密码123点击【确定】按钮' }, { deviceType: '04', orderNum: 2, operateCode: '0011', tip: '输入密码123点击【确定】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '3030', tip: '鼠标左键点击【{5}】按钮', codeType:'SIGNAL' } { deviceType: '04', orderNum: 3, operateCode: '2994', tip: '鼠标左键点击【{5}】按钮', codeType:'SIGNAL' }
] ]
}, },
{ // 不生成实训 { // 不生成实训
@ -148,7 +148,7 @@ export default {
{ deviceType: '04', orderNum: 2, operateCode: '304', tip: '鼠标左键点击【确定】按钮' } { deviceType: '04', orderNum: 2, operateCode: '304', tip: '鼠标左键点击【确定】按钮' }
] ]
}, },
{ { // 不生成实训
maxDuration: 8, maxDuration: 8,
minDuration: 5, minDuration: 5,
operateType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL.value, operateType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL.value,
@ -177,7 +177,7 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '306', tip: '输入密码123点击【确定】按钮' } { deviceType: '04', orderNum: 3, operateCode: '306', tip: '输入密码123点击【确定】按钮' }
] ]
}, },
{ { // 不生成实训
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_BLOCK.value, operateType: CMD.Signal.CMD_SIGNAL_BLOCK.value,
@ -206,7 +206,7 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '307', tip: '输入密码123点击【确认】按钮' } { deviceType: '04', orderNum: 3, operateCode: '307', tip: '输入密码123点击【确认】按钮' }
] ]
}, },
{ { // 不生成实训
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_UNBLOCK.value, operateType: CMD.Signal.CMD_SIGNAL_UNBLOCK.value,
@ -217,7 +217,7 @@ export default {
productTypes: ['01'], productTypes: ['01'],
stepVOList: [ stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '2992', tip: '鼠标左键菜单选择【解封】' }, { deviceType: '04', orderNum: 1, operateCode: '2992', tip: '鼠标左键菜单选择【解封】' },
{ deviceType: '04', orderNum: 2, operateCode: '2992', tip: '输入密码123点击【确认】按钮' }, { deviceType: '04', orderNum: 2, operateCode: '0011', tip: '输入密码123点击【确认】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '2992', tip: '鼠标左键点击【{5}】', codeType:'SIGNAL' } { deviceType: '04', orderNum: 3, operateCode: '2992', tip: '鼠标左键点击【{5}】', codeType:'SIGNAL' }
] ]
}, },
@ -403,7 +403,7 @@ export default {
productTypes: ['01'], productTypes: ['01'],
stepVOList: [ stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '1040', tip: '鼠标左键菜单选择【道岔解锁】' }, { deviceType: '02', orderNum: 1, operateCode: '1040', tip: '鼠标左键菜单选择【道岔解锁】' },
{ deviceType: '02', orderNum: 2, operateCode: '1040', tip: '输入密码123点击【确认】按钮' }, { deviceType: '02', orderNum: 2, operateCode: '0011', tip: '输入密码123点击【确认】按钮' },
{ deviceType: '02', orderNum: 3, operateCode: '1040', tip: '鼠标左键点击【{7}】按钮', codeType:'SWITCH' } { deviceType: '02', orderNum: 3, operateCode: '1040', tip: '鼠标左键点击【{7}】按钮', codeType:'SWITCH' }
] ]
}, },
@ -462,7 +462,7 @@ export default {
productTypes: ['01'], productTypes: ['01'],
stepVOList: [ stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '2992', tip: '鼠标左键菜单选择【解封】' }, { deviceType: '02', orderNum: 1, operateCode: '2992', tip: '鼠标左键菜单选择【解封】' },
{ deviceType: '02', orderNum: 2, operateCode: '2992', tip: '输入密码123点击【确认】按钮' }, { deviceType: '02', orderNum: 2, operateCode: '0011', tip: '输入密码123点击【确认】按钮' },
{ deviceType: '02', orderNum: 3, operateCode: '2992', tip: '鼠标左键点击【{7}】按钮', codeType:'SWITCH' } { deviceType: '02', orderNum: 3, operateCode: '2992', tip: '鼠标左键点击【{7}】按钮', codeType:'SWITCH' }
] ]
}, },
@ -508,7 +508,7 @@ export default {
productTypes: ['01'], productTypes: ['01'],
stepVOList: [ stepVOList: [
{ deviceType: '03', orderNum: 1, operateCode: '4020', tip: '鼠标右键菜单选择【区故解】' }, { deviceType: '03', orderNum: 1, operateCode: '4020', tip: '鼠标右键菜单选择【区故解】' },
{ deviceType: '03', orderNum: 2, operateCode: '4020', tip: '输入密码123点击【确认】按钮' }, { deviceType: '03', orderNum: 2, operateCode: '0011', tip: '输入密码123点击【确认】按钮' },
{ deviceType: '03', orderNum: 3, operateCode: '4020', tip: '鼠标左键点击【{9}】', codeType:'SECTION' } { deviceType: '03', orderNum: 3, operateCode: '4020', tip: '鼠标左键点击【{9}】', codeType:'SECTION' }
] ]
}, },

View File

@ -125,7 +125,9 @@ export default {
this.operate = operate || {}; this.operate = operate || {};
this.dialogShow = true; this.dialogShow = true;
this.operation = operate.operation; this.operation = operate.operation;
console.log(this.operation, operate); if (operate.operateNext) {
this.operation = operate.operateNext;
}
this.checkHasInput = false; this.checkHasInput = false;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');