地图绘图代码调整

This commit is contained in:
joylink_cuiweidong 2020-07-14 14:27:35 +08:00
parent d18b440c24
commit 99b622ef24
9 changed files with 59 additions and 79 deletions

View File

@ -469,7 +469,11 @@ export default {
}, },
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
this.$emit('selectFiled', this.field); if (this.field) {
this.$emit('deviceSelect', 'ControlDraft');
} else {
this.$emit('deviceSelect', '');
}
}, },
deleteOverlab(list, index) { deleteOverlab(list, index) {
list.splice(index, 1); list.splice(index, 1);

View File

@ -267,7 +267,11 @@ export default {
}, },
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
this.$emit('saidLampHover', this.field); if (this.field) {
this.$emit('deviceSelect', 'ControlLamp');
} else {
this.$emit('deviceSelect', '');
}
}, },
handleIndicatorLightList(indicatorLightList) { handleIndicatorLightList(indicatorLightList) {
this.atsControlList = []; this.atsControlList = [];

View File

@ -128,7 +128,11 @@ export default {
}, },
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
this.$emit('espCode', this.field); if (this.field) {
this.$emit('deviceSelect', 'Esp');
} else {
this.$emit('deviceSelect', '');
}
}, },
deviceSelect(selected) { deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Esp'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Esp'.toUpperCase()) {
@ -140,7 +144,8 @@ export default {
this.addModel.standCode = selected.code; this.addModel.standCode = selected.code;
this.activeName = 'second'; this.activeName = 'second';
this.field = ''; this.field = '';
this.$emit('espCode', ''); // this.$emit('espCode', '');
this.$emit('deviceSelect', '');
} }
}, },
hasPSD(data) { hasPSD(data) {

View File

@ -28,15 +28,7 @@
:selected="selected" :selected="selected"
@updateMapModel="updateMapModel" @updateMapModel="updateMapModel"
@setCenter="setCenter" @setCenter="setCenter"
@fieldSelect="fieldSelect" @deviceSelect="deviceSelect"
@fieldSelectSwitchSection="fieldSelectSwitchSection"
@stationSectionCode="stationEnabledTab"
@signalSectionCode="selectEnabledTab"
@standStationCode="standStationTab"
@selectFiled="selectFiled"
@psdCode="psdTab"
@espCode="esqTab"
@saidLampHover="saidLampTab"
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -74,9 +66,7 @@ import ControlLamp from './controlLamp';
import SplitStation from './splitStation'; import SplitStation from './splitStation';
import Arrow from './arrow'; import Arrow from './arrow';
import SplitScreen from './splitScreen'; import SplitScreen from './splitScreen';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import { ViewMode } from '@/scripts/ConstDic';
export default { export default {
name: 'MapOperate', name: 'MapOperate',
@ -144,21 +134,12 @@ export default {
{label:'站间分隔', name:'SplitStation', menus:SplitStation}, {label:'站间分隔', name:'SplitStation', menus:SplitStation},
{label:'箭头', name:'Arrow', menus:Arrow} {label:'箭头', name:'Arrow', menus:Arrow}
], ],
feild: '', selectDevice:'',
singlaType: '',
stationType: '',
switchType: '',
stationStandType:'',
psdType: '',
controlType: '',
ViewMode: ViewMode,
enabledTab: 'Section', enabledTab: 'Section',
autoSaveTask: null,
show: { show: {
mapEditShow: false, mapEditShow: false,
mapPaintShow: true mapPaintShow: true
}, },
oldDevice: null,
projectType: true projectType: true
}; };
}, },
@ -203,55 +184,21 @@ export default {
handleSelectControlPage(device) { handleSelectControlPage(device) {
const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle']; const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle'];
const type = device._type; const type = device._type;
if (this.stationType) { if (this.selectDevice) {
this.enabledTab = 'Station'; this.enabledTab = this.selectDevice;
} else if (this.switchType) { } else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock' || type == 'StationTurnBack') {
this.enabledTab = 'Switch';
} else if (this.singlaType) {
this.enabledTab = 'Signal';
} else if (this.stationStandType) {
this.enabledTab = 'StationStand';
} else if (this.psdType) {
this.enabledTab = 'Psd';
} else if (this.esqType) {
this.enabledTab = 'Esp';
} else if (this.feild) {
this.enabledTab = 'Section';
} else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock' || type == 'StationTurnBack' || this.controlType) {
this.enabledTab = 'ControlDraft'; this.enabledTab = 'ControlDraft';
} else if (controlLampTypeList.includes(type) || this.saidLampType) { } else if (controlLampTypeList.includes(type)) {
this.enabledTab = 'ControlLamp'; this.enabledTab = 'ControlLamp';
} else { } else {
this.enabledTab = type; this.enabledTab = type;
} }
}, },
selectFiled(type) {
this.controlType = type; deviceSelect(type) {
}, this.selectDevice = type;
esqTab(type) {
this.esqType = type;
},
psdTab(type) {
this.psdType = type;
},
saidLampTab(type) {
this.saidLampType = type;
},
standStationTab(type) {
this.stationStandType = type;
},
stationEnabledTab(type) {
this.stationType = type;
},
selectEnabledTab(type) {
this.singlaType = type;
},
fieldSelect(type) {
this.feild = type;
},
fieldSelectSwitchSection(type) {
this.switchType = type;
}, },
handleSelectLogicalView(handle) { handleSelectLogicalView(handle) {
this.$emit('handleSelectLogicalView', handle); this.$emit('handleSelectLogicalView', handle);
}, },

View File

@ -211,7 +211,11 @@ export default {
}, },
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
this.$emit('psdCode', this.field); if (this.field) {
this.$emit('deviceSelect', 'Psd');
} else {
this.$emit('deviceSelect', '');
}
}, },
deviceSelect(selected) { deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) {
@ -223,7 +227,7 @@ export default {
this.addModel.standCode = selected.code; this.addModel.standCode = selected.code;
this.activeName = 'second'; this.activeName = 'second';
this.field = ''; this.field = '';
this.$emit('psdCode', ''); this.$emit('deviceSelect', '');
} }
}, },
create() { create() {

View File

@ -436,27 +436,27 @@ export default {
this.$refs.splitOrMerge.addModel.code = selected.code; this.$refs.splitOrMerge.addModel.code = selected.code;
this.activeName = 'three'; this.activeName = 'three';
this.field = ''; this.field = '';
this.$emit('fieldSelect', ''); this.$emit('deviceSelect', '');
} else if (this.field.toUpperCase() === 'leftSectionCode'.toUpperCase()) { } else if (this.field.toUpperCase() === 'leftSectionCode'.toUpperCase()) {
this.$refs.splitOrMerge.mergeModel.lsectioncode = selected.code; this.$refs.splitOrMerge.mergeModel.lsectioncode = selected.code;
this.activeName = 'three'; this.activeName = 'three';
this.field = ''; this.field = '';
this.$emit('fieldSelect', ''); this.$emit('deviceSelect', '');
} else if (this.field.toUpperCase() === 'rightSectionCode'.toUpperCase()) { } else if (this.field.toUpperCase() === 'rightSectionCode'.toUpperCase()) {
this.$refs.splitOrMerge.mergeModel.rsectioncode = selected.code; this.$refs.splitOrMerge.mergeModel.rsectioncode = selected.code;
this.activeName = 'three'; this.activeName = 'three';
this.field = ''; this.field = '';
this.$emit('fieldSelect', ''); this.$emit('deviceSelect', '');
} else if (this.field.toUpperCase() === 'getSectionStart'.toUpperCase()) { } else if (this.field.toUpperCase() === 'getSectionStart'.toUpperCase()) {
this.$refs.create.createModel.leftSectionCode = selected.code; this.$refs.create.createModel.leftSectionCode = selected.code;
this.activeName = 'second'; this.activeName = 'second';
this.field = ''; this.field = '';
this.$emit('fieldSelect', ''); this.$emit('deviceSelect', '');
} else if (this.field.toUpperCase() === 'getSectionEnd'.toUpperCase()) { } else if (this.field.toUpperCase() === 'getSectionEnd'.toUpperCase()) {
this.$refs.create.createModel.rightSectionCode = selected.code; this.$refs.create.createModel.rightSectionCode = selected.code;
this.activeName = 'second'; this.activeName = 'second';
this.field = ''; this.field = '';
this.$emit('fieldSelect', ''); this.$emit('deviceSelect', '');
} else if (this.field.toUpperCase() === 'sectionTypeCode'.toUpperCase()) { } else if (this.field.toUpperCase() === 'sectionTypeCode'.toUpperCase()) {
this.$refs.batchSettings.formModel.modelList.push(selected.code); this.$refs.batchSettings.formModel.modelList.push(selected.code);
this.activeName = 'five'; this.activeName = 'five';
@ -468,7 +468,11 @@ export default {
}, },
hover(field) { hover(field) {
this.field = field == this.field ? '' : field; this.field = field == this.field ? '' : field;
this.$emit('fieldSelect', this.field); if (this.field) {
this.$emit('deviceSelect', 'Section');
} else {
this.$emit('deviceSelect', '');
}
}, },
addPoint(index) { addPoint(index) {
const data = { x: 0, y: 0 }; const data = { x: 0, y: 0 };

View File

@ -365,12 +365,16 @@ export default {
} }
this.activeName = 'second'; this.activeName = 'second';
this.field = ''; this.field = '';
this.$emit('signalSectionCode', ''); this.$emit('deviceSelect', '');
} }
}, },
signalSectionCode(field) { signalSectionCode(field) {
this.field = field; this.field = field;
this.$emit('signalSectionCode', field); if (this.field) {
this.$emit('deviceSelect', 'Signal');
} else {
this.$emit('deviceSelect', '');
}
}, },
updateMapModel(model) { updateMapModel(model) {
this.$emit('updateMapModel', model); this.$emit('updateMapModel', model);

View File

@ -288,7 +288,11 @@ export default {
}, },
hover(field) { hover(field) {
this.field = field == this.field ? '' : field; this.field = field == this.field ? '' : field;
this.$emit('standStationCode', this.field); if (this.field) {
this.$emit('deviceSelect', 'StationStand');
} else {
this.$emit('deviceSelect', '');
}
}, },
changeStation(station) { changeStation(station) {
this.editModel.deviceStationCode = this.getDeviceStationCode(station); this.editModel.deviceStationCode = this.getDeviceStationCode(station);

View File

@ -55,7 +55,11 @@ export default {
}, },
hover(field) { hover(field) {
this.field = field == this.field ? '' : field; this.field = field == this.field ? '' : field;
this.$emit('fieldSelectSwitchSection', this.field); if (this.field) {
this.$emit('deviceSelect', 'Switch');
} else {
this.$emit('deviceSelect', '');
}
}, },
deviceSelect(selected) { deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'relevanceSwitchList'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'relevanceSwitchList'.toUpperCase()) {