大铁线路调整2

This commit is contained in:
fan 2022-04-18 14:57:12 +08:00
parent 7fbe309f70
commit 6ed22109af
3 changed files with 28 additions and 9 deletions

View File

@ -194,7 +194,7 @@ export default class SaidLamp extends Group {
}
}
// 设置状态 498
// 设置状态
setState(model) {
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {

View File

@ -132,6 +132,8 @@ export default {
{ name: '闭塞', value: 'Occlusion' },
{ name: '接发车箭头', value: 'PickOrDepartArrow' }
],
hasDirectionList: ['SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist', 'PickAssist', 'Recovery', 'Accident', 'Occlusion', 'PickOrDepartArrow'],
directionList: [{label: 'X',value: 'X'},{label: 'XF',value: 'XF'},{label: 'XD',value: 'XD'}, {label:'S',value:'S'},{label:'SF',value:'SF'},{label:'SD',value: 'SD'}],
editModel:getModel('ControlLamp'),
addModel:getModel('ControlLamp'),
field: ''
@ -164,6 +166,7 @@ export default {
{ prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup' },
{ prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup'},
{ prop: 'right', label: '朝右:', type: 'checkbox', isHidden: this.editModel.type !== 'PickOrDepartArrow' },
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.hasDirectionList.includes(this.editModel.type) },
{ prop: 'switchCode', label: '所属道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: this.editModel.type !== 'SwitchFault', hover: this.hover, buttonType: 'switchSelectCode', buttonShowType: this.isButtonType },
{ prop:'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList}
]
@ -188,6 +191,7 @@ export default {
] },
{ prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup' },
{ prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup'},
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.hasDirectionList.includes(this.addModel.type) },
{ prop: 'switchCode', label: '所属道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: this.addModel.type !== 'SwitchFault', hover: this.hover, buttonType: 'switchSelectCode', buttonShowType: this.isButtonType }
]
}
@ -217,6 +221,9 @@ export default {
],
switchCode: [
{ required: true, message: '请选择所属道岔!', trigger: 'change'}
],
direction: [
{ required: true, message: '请选择方向!', trigger: 'change'}
]
};
},

View File

@ -56,6 +56,7 @@ export default {
signalCode: '',
sectionCode: '',
switchCode: '',
direction: '',
position: {
x: 0,
y: 0
@ -93,6 +94,7 @@ export default {
{ value: 'CHANGE_DIRECTION', label: '改方按钮' }
],
centralizedStationList: [], //
directionList: [{label:'X',value:'X'},{label:'XF',value:'XF'},{label:'XD',value:'XD'},{label:'S',value:'S'},{label:'SF',value:'SF'},{label:'SD',value:'SD'}],
rules: {
code: [
{ required: true, message: this.$t('rules.selectText'), trigger: 'blur' }
@ -117,6 +119,9 @@ export default {
],
'position.y': [
{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }
],
direction: [
{ required: true, message: '请选择方向', trigger: 'change' }
]
}
};
@ -151,6 +156,7 @@ export default {
{ prop: 'signalCode', label: '关联信号机:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.signalList, hover: this.hover, buttonType: 'linkSignal', buttonShowType: this.isLinkSignalShow, isHidden: !this.isLinkSignal },
{ prop: 'sectionCode', label: '关联区段:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.sectionList, hover: this.hover, buttonType: 'linkSection', buttonShowType: this.isLinkSectionShow, isHidden: !this.isLinkSection },
{ prop: 'switchCode', label: '关联道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchList, hover: this.hover, buttonType: 'linkSwitch', buttonShowType: this.isLinkSwitchShow, isHidden: !this.isLinkSwitch },
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.isLinkDirection },
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
@ -205,6 +211,9 @@ export default {
},
isLinkSwitch() {
return this.editModel.type === 'FLEXIBLE';
},
isLinkDirection() {
return ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION'].includes(this.editModel.type);
}
},
methods: {
@ -233,6 +242,7 @@ export default {
this.editModel.signalCode = '';
this.editModel.switchCode = '';
this.editModel.sectionCode = '';
this.editModel.direction = '';
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
} else if (this.field === 'linkSignal' && selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
@ -278,11 +288,13 @@ export default {
},
updateMapModel(data) {
if (this.isLinkSignal) {
data.sectionCode = ''; data.switchCode = '';
data.sectionCode = ''; data.switchCode = ''; data.direction = '';
} else if (this.isLinkSection) {
data.signalCode = ''; data.switchCode = '';
data.signalCode = ''; data.switchCode = ''; data.direction = '';
} else if (this.isLinkSwitch) {
data.signalCode = ''; data.sectionCode = '';
data.signalCode = ''; data.sectionCode = ''; data.direction = '';
} else if (this.isLinkDirection) {
data.sectionCode = ''; data.signalCode = ''; data.switchCode = '';
}
this.$emit('updateMapModel', data);
}