diff --git a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue index b9ff2bb1e..d5f92089e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue @@ -1,7 +1,41 @@ @@ -47,6 +67,9 @@ export default { data() { return { stationCode: '', + belongStationCode: '', + activeName: 'first', + showList: [], modelList: [ { type: 'Section', @@ -63,6 +86,13 @@ export default { name: '信号机列表', list: [] } + ], + modelSignalList: [ + { + type: 'Signal', + name: '信号机列表', + list: [] + } ] }; }, @@ -86,8 +116,16 @@ export default { // this.$emit('setCenter', code); // this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); // }, + handleClick() { + if (this.activeName === 'first') { + this.showList = this.modelList; + } else { + this.showList = this.modelSignalList; + } + }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) { + this.activeName = 'first'; this.clearModelList(); let count = 0; this.seclectDeviceList.forEach(item => { @@ -99,6 +137,7 @@ export default { this.modelList[1].list.push(item); } else if (item._type == 'Signal') { this.modelList[2].list.push(item); + this.modelSignalList[0].list.push(item); } if (item.stationCode == this.seclectDeviceList[0].stationCode) { count++; @@ -109,12 +148,16 @@ export default { } else { this.stationCode = ''; } + this.belongStationCode = this.stationList[0].code; + this.showList = this.modelList; } }, clearModelList() { + this.showList = []; this.modelList.forEach(item => { item.list = []; }); + this.modelSignalList[0].list = []; }, // 删除当前选中 delList(model, list) { @@ -152,9 +195,24 @@ export default { this.stationCode = ''; } }, + handleBelongStationCode() { + if (this.belongStationCode && this.modelSignalList[0].list.length) { + const models = []; + this.modelSignalList[0].list.forEach(item => { + const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.code)); + Model.belongStationCode = this.belongStationCode; + models.push(Model); + }); + this.$emit('updateMapModel', models); + this.$message.success('设置所属车站成功!'); + this.belongStationCode = ''; + } + }, clearList() { // 清空数据 this.stationCode = ''; + this.belongStationCode = ''; this.$store.commit('map/setSeclectDeviceList', []); + this.showList = []; this.modelList = [ { type: 'Section', @@ -172,6 +230,13 @@ export default { list: [] } ]; + this.modelSignalList = [ + { + type: 'Signal', + name: '信号机列表', + list: [] + } + ]; }, mouseenter(model) { if (model._type == 'Section') { diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 3470f9dfd..32ab899ba 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -147,6 +147,7 @@ export default { item: [ { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }, { prop: 'interlockStationCode', label: '所属联锁站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.ciStationList}, + { prop: 'belongStationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.stationList }, { prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' }, { prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList, hover: this.hover, buttonType: 'signalSection', buttonShowType: this.signalSectionShow }, { prop: 'sectionOffset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }