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) {
this.operate = operate || {};
this.operation = operate.operation;
if (operate.operateNext) {
this.operation = operate.operateNext;
}
this.dialogShow = true;
this.checkHasInput = false;
this.$nextTick(function () {

View File

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

View File

@ -71,7 +71,7 @@ export default {
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3080', tip: '鼠标左键点击【引导进路】' },
{ 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' }
]
},
@ -99,9 +99,9 @@ export default {
trainingType: 'Signal',
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3030', tip: '鼠标左键点击【总取消】' },
{ deviceType: '04', orderNum: 2, operateCode: '3030', tip: '输入密码123点击【确定】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '3030', tip: '鼠标左键点击【{5}】按钮', codeType:'SIGNAL' }
{ deviceType: '04', orderNum: 1, operateCode: '2994', tip: '鼠标左键点击【总取消】' },
{ deviceType: '04', orderNum: 2, operateCode: '0011', tip: '输入密码123点击【确定】按钮' },
{ deviceType: '04', orderNum: 3, operateCode: '2994', tip: '鼠标左键点击【{5}】按钮', codeType:'SIGNAL' }
]
},
{ // 不生成实训
@ -148,7 +148,7 @@ export default {
{ deviceType: '04', orderNum: 2, operateCode: '304', tip: '鼠标左键点击【确定】按钮' }
]
},
{
{ // 不生成实训
maxDuration: 8,
minDuration: 5,
operateType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL.value,
@ -177,7 +177,7 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '306', tip: '输入密码123点击【确定】按钮' }
]
},
{
{ // 不生成实训
maxDuration: 15,
minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_BLOCK.value,
@ -206,7 +206,7 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '307', tip: '输入密码123点击【确认】按钮' }
]
},
{
{ // 不生成实训
maxDuration: 15,
minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_UNBLOCK.value,
@ -217,7 +217,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ 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' }
]
},
@ -403,7 +403,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ 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' }
]
},
@ -462,7 +462,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ 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' }
]
},
@ -508,7 +508,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ 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' }
]
},

View File

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