代码调整

This commit is contained in:
joylink_cuiweidong 2021-01-22 19:18:16 +08:00
parent 052b1c3688
commit 8eee00f454
4 changed files with 44 additions and 32 deletions

View File

@ -44,8 +44,8 @@
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
list: [
// 控制模式
{
// 控制模式
{
maxDuration: 15,
minDuration: 8,
operateType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL.value,
@ -55,11 +55,11 @@ export default {
trainingType: 'ControlConvertMenu',
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '2993', tip: '鼠标左键点击【功能按钮】' },
{ deviceType: '04', orderNum: 2, operateCode: '2993', tip: '鼠标左键点击【站控】', codeType:'STATION', subType:'substation' }
{ deviceType: '04', orderNum: 1, operateCode: '2993', tip: '鼠标左键点击【功能按钮】' },
{ deviceType: '04', orderNum: 2, operateCode: '2993', tip: '鼠标左键点击【站控】', codeType:'STATION', subType:'substation' }
]
},
{
},
{
maxDuration: 15,
minDuration: 8,
operateType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL.value,
@ -70,10 +70,10 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '2993', tip: '鼠标左键点击【功能按钮】' },
{ deviceType: '04', orderNum: 2, operateCode: '2993', tip: '鼠标左键点击【紧急站控】', codeType:'STATION', subType:'emergency' }
{ deviceType: '04', orderNum: 2, operateCode: '2993', tip: '鼠标左键点击【紧急站控】', codeType:'STATION', subType:'emergency' }
]
},
{
},
{
maxDuration: 15,
minDuration: 8,
operateType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL.value,
@ -84,9 +84,9 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '2993', tip: '鼠标左键点击【功能按钮】' },
{ deviceType: '04', orderNum: 2, operateCode: '2993', tip: '鼠标左键点击【中控】', codeType:'STATION', subType:'center' }
{ deviceType: '04', orderNum: 2, operateCode: '2993', tip: '鼠标左键点击【中控】', codeType:'STATION', subType:'center' }
]
},
},
// 信号机列表
{
maxDuration: 15,
@ -114,11 +114,11 @@ export default {
trainingType: 'Signal',
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3010', tip: '鼠标左键点击【排列进路】' },
{ deviceType: '04', orderNum: 1, operateCode: '3010', tip: '鼠标左键点击【排列进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3010', tip: '鼠标左键点击【{5}】', codeType:'START_SIGNAL' },
{ deviceType: '04', orderNum: 3, operateCode: '3010', tip: '鼠标左键点击【{5}】', codeType:'END_SIGNAL' }
]
},
},
{
maxDuration: 15,
@ -151,8 +151,8 @@ export default {
{ deviceType: '04', orderNum: 3, operateCode: '0011', tip: '输入密码123点击【确定】按钮' },
{ deviceType: '04', orderNum: 4, operateCode: '3080', tip: '鼠标左键点击【{5}】', codeType:'END_SIGNAL' }
]
},
// {
},
// {
// maxDuration: 15,
// minDuration: 8,
// operateType: CMD.Signal.CMD_STATION_SET_MASTER_GUIDE_LOCK.value,
@ -317,7 +317,7 @@ export default {
minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING.value,
skinCode: '04',
trainingName: '进路收人工控({5})',
trainingName: '进路收人工控({3})',
trainingRemark: '进路收人工控',
trainingType: 'Signal',
productTypes: ['02'],
@ -338,7 +338,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3140', tip: '鼠标左键点击【人工控】' },
{ deviceType: '04', orderNum: 2, operateCode: '3140', tip: '鼠标左键点击【{3}】', codeType:'SIGNAL' }
{ deviceType: '04', orderNum: 2, operateCode: '3140', tip: '鼠标左键点击【{5}】', codeType:'SIGNAL' }
]
},
{
@ -346,7 +346,7 @@ export default {
minDuration: 8,
operateType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING.value,
skinCode: '04',
trainingName: '进路交自动控({5})',
trainingName: '进路交自动控({3})',
trainingRemark: '进路交自动控',
trainingType: 'Signal',
productTypes: ['02'],
@ -367,7 +367,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3150', tip: '鼠标左键点击【自动控】' },
{ deviceType: '04', orderNum: 2, operateCode: '3150', tip: '鼠标左键点击【{3}】', codeType:'SIGNAL' }
{ deviceType: '04', orderNum: 2, operateCode: '3150', tip: '鼠标左键点击【{5}】', codeType:'SIGNAL' }
]
},
{
@ -660,8 +660,8 @@ export default {
{ deviceType: '06', orderNum: 2, operateCode: '5051', tip: '鼠标左键点击【上行全线】按钮', val: '02' },
{ deviceType: '06', orderNum: 3, operateCode: '508', tip: '鼠标左键点击【确定】按钮' }
]
},
{
},
{
maxDuration: 15,
minDuration: 8,
operateType: CMD.Stand.CMD_STAND_SET_JUMP_STOP.value,
@ -688,8 +688,8 @@ export default {
{ deviceType: '06', orderNum: 1, operateCode: '502', tip: '鼠标右键菜单选择【跳停】' },
{ deviceType: '06', orderNum: 2, operateCode: '502', tip: '鼠标左键点击【确定】按钮' }
]
},
{
},
{
maxDuration: 15,
minDuration: 8,
operateType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP.value,
@ -716,7 +716,7 @@ export default {
{ deviceType: '06', orderNum: 1, operateCode: '503', tip: '鼠标右键菜单选择【取消跳停】' },
{ deviceType: '06', orderNum: 2, operateCode: '503', tip: '鼠标左键点击【确定】按钮' }
]
},
},
{
maxDuration: 15,
minDuration: 8,

View File

@ -182,8 +182,8 @@ export default {
initMenu() {
//
if (this.selected.type != '04') {
// this.menu = this.menuNormal.Center;
this.menu = MenuContextHandler.covert2(this.menuNormal);
// this.menu = this.menuNormal.Center;
this.menu = MenuContextHandler.covert2(this.menuNormal);
} else {
this.menu = [];
}

View File

@ -60,8 +60,8 @@ class MenuContextHandler {
return result;
}
covert2(menuList) {
const selected = this.getCurrentStateObject();
covert2(menuList) {
const selected = this.getCurrentStateObject();
let menu = [];
const control = this.getStationControl(selected);
if (control && !store.state.scriptRecord.audioPlay) {
@ -77,10 +77,21 @@ class MenuContextHandler {
menu = [];
}
}
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.children && elem.children.length > 0) {
elem.children.forEach(each=>{
this.covertEachCommand(each, type, selected, status, false);
});
} else {
this.covertEachCommand(elem, type, selected, status, false);
}
});
}
}
}
return menu;
}
}
covert(menuList) {
const selected = this.getCurrentStateObject();
@ -115,7 +126,7 @@ class MenuContextHandler {
return menu;
}
covertEachCommand(elem, type, selected, status) {
covertEachCommand(elem, type, selected, status, isSettingCommand = true) {
if (elem.type === 'separator') {
elem.show = true;
return;
@ -132,7 +143,9 @@ class MenuContextHandler {
elem.disabled = true;
}
} else {
elem.show = false;
if (isSettingCommand) {
elem.show = false;
}
}
}

View File

@ -461,7 +461,6 @@ export default {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const data = Object.assign({_type: this.editModel.type}, this.editModel);
console.log(data, '=====');
this.$emit('updateMapModel', data);
this.field = '';
}