diff --git a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue index 32f6d3af0..3320bcc1f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue @@ -469,7 +469,11 @@ export default { }, hover(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) { list.splice(index, 1); diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index ee82890b3..49876e166 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -267,7 +267,11 @@ export default { }, hover(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) { this.atsControlList = []; diff --git a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue index 743f1a394..13d1081ac 100644 --- a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue @@ -128,7 +128,11 @@ export default { }, hover(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) { if (selected && selected._type.toUpperCase() === 'Esp'.toUpperCase()) { @@ -140,7 +144,8 @@ export default { this.addModel.standCode = selected.code; this.activeName = 'second'; this.field = ''; - this.$emit('espCode', ''); + // this.$emit('espCode', ''); + this.$emit('deviceSelect', ''); } }, hasPSD(data) { diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index 5f52b4ff6..59ceb6cf7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -28,15 +28,7 @@ :selected="selected" @updateMapModel="updateMapModel" @setCenter="setCenter" - @fieldSelect="fieldSelect" - @fieldSelectSwitchSection="fieldSelectSwitchSection" - @stationSectionCode="stationEnabledTab" - @signalSectionCode="selectEnabledTab" - @standStationCode="standStationTab" - @selectFiled="selectFiled" - @psdCode="psdTab" - @espCode="esqTab" - @saidLampHover="saidLampTab" + @deviceSelect="deviceSelect" /> @@ -74,9 +66,7 @@ import ControlLamp from './controlLamp'; import SplitStation from './splitStation'; import Arrow from './arrow'; import SplitScreen from './splitScreen'; - import { EventBus } from '@/scripts/event-bus'; -import { ViewMode } from '@/scripts/ConstDic'; export default { name: 'MapOperate', @@ -144,21 +134,12 @@ export default { {label:'站间分隔', name:'SplitStation', menus:SplitStation}, {label:'箭头', name:'Arrow', menus:Arrow} ], - feild: '', - singlaType: '', - stationType: '', - switchType: '', - stationStandType:'', - psdType: '', - controlType: '', - ViewMode: ViewMode, + selectDevice:'', enabledTab: 'Section', - autoSaveTask: null, show: { mapEditShow: false, mapPaintShow: true }, - oldDevice: null, projectType: true }; }, @@ -203,55 +184,21 @@ export default { handleSelectControlPage(device) { const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle']; const type = device._type; - if (this.stationType) { - this.enabledTab = 'Station'; - } else if (this.switchType) { - 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) { + if (this.selectDevice) { + this.enabledTab = this.selectDevice; + } else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock' || type == 'StationTurnBack') { this.enabledTab = 'ControlDraft'; - } else if (controlLampTypeList.includes(type) || this.saidLampType) { + } else if (controlLampTypeList.includes(type)) { this.enabledTab = 'ControlLamp'; } else { this.enabledTab = type; } }, - selectFiled(type) { - this.controlType = 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; + + deviceSelect(type) { + this.selectDevice = type; }, + handleSelectLogicalView(handle) { this.$emit('handleSelectLogicalView', handle); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue index bbff67677..fbb5b20db 100644 --- a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue @@ -211,7 +211,11 @@ export default { }, hover(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) { if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) { @@ -223,7 +227,7 @@ export default { this.addModel.standCode = selected.code; this.activeName = 'second'; this.field = ''; - this.$emit('psdCode', ''); + this.$emit('deviceSelect', ''); } }, create() { diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index e4f86184d..41024bb4f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -436,27 +436,27 @@ export default { this.$refs.splitOrMerge.addModel.code = selected.code; this.activeName = 'three'; this.field = ''; - this.$emit('fieldSelect', ''); + this.$emit('deviceSelect', ''); } else if (this.field.toUpperCase() === 'leftSectionCode'.toUpperCase()) { this.$refs.splitOrMerge.mergeModel.lsectioncode = selected.code; this.activeName = 'three'; this.field = ''; - this.$emit('fieldSelect', ''); + this.$emit('deviceSelect', ''); } else if (this.field.toUpperCase() === 'rightSectionCode'.toUpperCase()) { this.$refs.splitOrMerge.mergeModel.rsectioncode = selected.code; this.activeName = 'three'; this.field = ''; - this.$emit('fieldSelect', ''); + this.$emit('deviceSelect', ''); } else if (this.field.toUpperCase() === 'getSectionStart'.toUpperCase()) { this.$refs.create.createModel.leftSectionCode = selected.code; this.activeName = 'second'; this.field = ''; - this.$emit('fieldSelect', ''); + this.$emit('deviceSelect', ''); } else if (this.field.toUpperCase() === 'getSectionEnd'.toUpperCase()) { this.$refs.create.createModel.rightSectionCode = selected.code; this.activeName = 'second'; this.field = ''; - this.$emit('fieldSelect', ''); + this.$emit('deviceSelect', ''); } else if (this.field.toUpperCase() === 'sectionTypeCode'.toUpperCase()) { this.$refs.batchSettings.formModel.modelList.push(selected.code); this.activeName = 'five'; @@ -468,7 +468,11 @@ export default { }, hover(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) { const data = { x: 0, y: 0 }; diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 36fbb6690..2020d63ed 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -365,12 +365,16 @@ export default { } this.activeName = 'second'; this.field = ''; - this.$emit('signalSectionCode', ''); + this.$emit('deviceSelect', ''); } }, signalSectionCode(field) { this.field = field; - this.$emit('signalSectionCode', field); + if (this.field) { + this.$emit('deviceSelect', 'Signal'); + } else { + this.$emit('deviceSelect', ''); + } }, updateMapModel(model) { this.$emit('updateMapModel', model); diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index e6e1b5659..2e5a7c574 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -288,7 +288,11 @@ export default { }, hover(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) { this.editModel.deviceStationCode = this.getDeviceStationCode(station); diff --git a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue index d9219949d..4051a269d 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue @@ -55,7 +55,11 @@ export default { }, hover(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) { if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'relevanceSwitchList'.toUpperCase()) {