This commit is contained in:
joylink_cuiweidong 2021-01-05 13:00:25 +08:00
commit 40a367a005
8 changed files with 60 additions and 27 deletions

View File

@ -558,15 +558,29 @@ export default class Switch extends Group {
return this.name.getBoundingRect(); return this.name.getBoundingRect();
} }
getShapeTipPoint() { getShapeTipPoint(opts) {
const text = this.name.getNameText(); let rect;
if (text) { let text;
const rect = text.getBoundingRect();
switch (opts.subDeviceType) {
case 'enabled':
rect = this.enabledName.getBoundingRect();
break;
default:
text = this.name.getNameText();
if (text) {
rect = text.getBoundingRect();
}
break;
}
if (rect) {
return { return {
x: rect.x + rect.width / 2, x: rect.x + rect.width / 2,
y: rect.y y: rect.y
}; };
} }
return null; return null;
} }

View File

@ -481,6 +481,11 @@ export function commitOperate(operate, paramList, over, val) {
step.over = true; step.over = true;
step.cmdType = operate.cmdType; step.cmdType = operate.cmdType;
} }
if (over == 4) {
const codeList = Object.values(paramList);
step.code = codeList[0];
}
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
store.dispatch('training/nextNew', step).then(({ valid }) => { store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {

View File

@ -229,7 +229,6 @@ export default {
operate = { operate = {
send: true, send: true,
operation: eachCmd.operation.code, operation: eachCmd.operation.code,
cmdType: eachCmd.cmdType,
param: eachCmd.param // param: eachCmd.param //
}; };
const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 0}; const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 0};

View File

@ -131,11 +131,16 @@ export default {
const eachCmd = requestList[0]; const eachCmd = requestList[0];
let operate = ''; let operate = '';
if (eachCmd.ciConfirm) { if (eachCmd.ciConfirm) {
operate = { operate = eachCmd.nextStepNotEnd
code: eachCmd.device.code, ? {
operation: eachCmd.operation.code, operation: eachCmd.operation.code,
param: eachCmd.param // param: eachCmd.param //
}; }
: {
code: eachCmd.device.code,
operation: eachCmd.operation.code,
param: eachCmd.param //
};
const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 1}; const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 1};
if (eachCmd.device._type === deviceType.Signal) { if (eachCmd.device._type === deviceType.Signal) {
deviceStatus.isRequestLock = 0; deviceStatus.isRequestLock = 0;

View File

@ -415,8 +415,8 @@ export default {
this.$store.dispatch('menuOperation/pushRequestList', { this.$store.dispatch('menuOperation/pushRequestList', {
device: this.selected, device: this.selected,
operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '终端信号解封'}, operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '终端信号解封'},
ciConfirm: true, param: {signalCode: this.selected.code},
param: {signalCode: this.selected.code} cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
}); });
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: 'Signal', isRequestLock: 1}]); this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: 'Signal', isRequestLock: 1}]);
} else { } else {

View File

@ -294,7 +294,7 @@ export default {
this.$store.dispatch('menuOperation/pushRequestList', { this.$store.dispatch('menuOperation/pushRequestList', {
device: this.selected, device: this.selected,
operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '道岔解锁'}, operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '道岔解锁'},
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, nextStepNotEnd: true,
ciConfirm: true, ciConfirm: true,
param: operate.param param: operate.param
}); });
@ -326,12 +326,23 @@ export default {
// }); // });
// }, // },
enabledConfirm() { enabledConfirm() {
this.$store.dispatch('menuOperation/pushRequestList', { const step = {
device: this.selected, code: this.selected.code,
operation: { code: OperationEvent.Switch.unlock.menu.operation, name: '道岔解锁'}, operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, subType: 'enabled',
param: { params: {switchCode:this.selected.code}
switchCode: this.selected.code };
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/pushRequestList', {
device: this.selected,
operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '道岔解锁'},
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
param: {
switchCode: this.selected.code
}
});
} }
}); });
}, },

View File

@ -306,9 +306,9 @@ export default {
trainingType: 'Switch', trainingType: 'Switch',
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '104', tip: '鼠标右键菜单选择【道岔单解】' }, { deviceType: '02', orderNum: 1, operateCode: '104', tip: '鼠标右键菜单选择【道岔单解】', codeType:'SWITCH' },
{ deviceType: '02', orderNum: 2, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' }, { deviceType: '02', orderNum: 2, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' },
{ deviceType: '02', orderNum: 3, operateCode: '104', tip: '鼠标右键点击【E】选择使能' }, { deviceType: '02', orderNum: 3, operateCode: '104', tip: '鼠标右键点击【E】选择使能', codeType:'SWITCH', subType:'enabled' },
{ deviceType: '02', orderNum: 4, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' } { deviceType: '02', orderNum: 4, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' }
] ]
}, },
@ -377,7 +377,7 @@ export default {
operateType: 'Signal_Block', operateType: 'Signal_Block',
skinCode: '09', skinCode: '09',
trainingName: '信号封锁({5})', trainingName: '信号封锁({5})',
trainingRemark: '信号封锁', trainingRemark: '信号封锁功能',
trainingType: 'Signal', trainingType: 'Signal',
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [
@ -396,9 +396,7 @@ export default {
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '307', tip: '鼠标右键菜单选择【信号解封】' }, { deviceType: '04', orderNum: 1, operateCode: '307', tip: '鼠标右键菜单选择【信号解封】' },
{ deviceType: '04', orderNum: 2, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' }, { deviceType: '04', orderNum: 2, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' }
{ deviceType: '04', orderNum: 3, operateCode: '307', tip: '鼠标右键点击【E】选择使能' },
{ deviceType: '04', orderNum: 4, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' }
] ]
}, },
{ {
@ -432,7 +430,7 @@ export default {
{ {
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: 'CMD_TRAIN_HOLD', operateType: 'Train_Hold',
skinCode: '09', skinCode: '09',
trainingName: '列车扣车({5})', trainingName: '列车扣车({5})',
trainingRemark: '列车扣车功能', trainingRemark: '列车扣车功能',
@ -446,7 +444,7 @@ export default {
{ {
maxDuration: 15, maxDuration: 15,
minDuration: 8, minDuration: 8,
operateType: 'CMD_TRAIN_CANCEL_HOLD', operateType: 'Train_Cancel_Hold',
skinCode: '09', skinCode: '09',
trainingName: '列车放行({5})', trainingName: '列车放行({5})',
trainingRemark: '列车放行功能', trainingRemark: '列车放行功能',

View File

@ -30,6 +30,7 @@ class ValidateHandler {
judge (operate) { judge (operate) {
const steps = Handler.getSteps(); const steps = Handler.getSteps();
const order = Handler.getOrder(); const order = Handler.getOrder();
let valid = false; let valid = false;
if (operate.over && steps.length == 1) { // 右键菜单直接发送校验 if (operate.over && steps.length == 1) { // 右键菜单直接发送校验
if (operate && steps[0] && if (operate && steps[0] &&