diff --git a/src/views/newMap/newMapdraft/dataRelation/index.vue b/src/views/newMap/newMapdraft/dataRelation/index.vue index 852c0a480..1c579bfc0 100644 --- a/src/views/newMap/newMapdraft/dataRelation/index.vue +++ b/src/views/newMap/newMapdraft/dataRelation/index.vue @@ -142,7 +142,7 @@ export default { this.$emit('showMap'); }, initLoad() { - if (this.enabledTab === 'route') { + if (this.enabledTab === 'route' || this.enabledTab == 'runLevel') { this.$refs[this.enabledTabMenu[this.enabledTab]].initLoad(); } }, @@ -164,13 +164,14 @@ export default { drawMap() { this.$refs.routeOperate.batchSectionListFocus(false); this.$refs.signalOperate.batchSectionListFocus(false); + this.$refs.runLevelOperate.batchSectionListFocus(false); this.$emit('selectView', 'draft'); }, tabBeforeLeave(activeName, oldActiveName) { - if (activeName === 'route' || activeName === 'signal') { + if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel') { this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true); } - if (oldActiveName === 'route' || oldActiveName === 'signal') { + if (oldActiveName === 'route' || oldActiveName === 'signal' || activeName == 'runLevel') { this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false); } } diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index 6b63c56a9..9ec827105 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -67,7 +67,7 @@ - + { return this.translate(row.right, 'PermissionUseList'); }, + columnValue: (row) => { return this.translate(row.right); }, tagType: (row) => { return 'success'; } }, + { + title: '站间距离', + prop: 'distance' + }, { title: '第一等级时间', prop: 'l1' @@ -169,11 +173,12 @@ export default { return getRunLevelList(this.mapInfo.id, params); } }, - translate(rowData, listName) { - const obj = this[listName].filter((item) => { - return item.value === rowData; - }); - return obj && obj.label; + translate(rowData) { + if (rowData) { + return '向右'; + } else { + return '向左'; + } }, acquireMapList() { // 地图名称列表 diff --git a/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/index.vue b/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/index.vue index 888de5cee..f886e589d 100644 --- a/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/index.vue +++ b/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/index.vue @@ -73,11 +73,17 @@ export default { this.$refs.routeEdit.clear(); } }, + initLoad() { + this.$refs.routeEdit.batchSectionListFocus(true); + }, setSelected(selected) { this.$refs.routeEdit.setSelected(selected); }, setCenter(code) { this.$emit('setCenter', code); + }, + batchSectionListFocus(flag) { + this.$refs.routeEdit.batchSectionListFocus(flag); } } }; diff --git a/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/route.vue index 1d207cf30..10b174e98 100644 --- a/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/route.vue @@ -67,10 +67,6 @@ - - - m - 生成等级 @@ -137,6 +133,10 @@ + + + m + s @@ -233,9 +233,6 @@ export default { ], endSectionCode: [ { required: true, message: '请选择末端区段', trigger: 'change' } - ], - distance: [ - { required: true, message: '请输入站间距离', trigger: 'blur' } ] } }; @@ -286,6 +283,22 @@ export default { if (this.addModel.startStationCode && val) { this.getStationDistance(); } + }, + 'addModel.startSectionCode': function(val, old) { + if (old) { + this.changeSectionSelected(old, false, 'routePhysicalSection'); + } + if (val) { + this.changeSectionSelected(val, true, 'routePhysicalSection'); + } + }, + 'addModel.endSectionCode': function(val, old) { + if (old) { + this.changeSectionSelected(old, false, 'routePhysicalSection'); + } + if (val) { + this.changeSectionSelected(val, true, 'routePhysicalSection'); + } } }, methods: { @@ -305,10 +318,28 @@ export default { this.addModel.l3 = res.data.l3; this.addModel.l4 = res.data.l4; this.addModel.l5 = res.data.l5; + this.addModel.distance = res.data.distance; } } }); }, + batchSectionListFocus(flag) { + this.changeSectionSelected(this.addModel.endSectionCode, flag, 'routePhysicalSection'); + this.changeSectionSelected(this.addModel.startSectionCode, flag, 'routePhysicalSection'); + }, + changeSectionSelected(val, flag, type) { + if (val) { + const section = this.$store.getters['map/getDeviceByCode'](val); + if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) { + section.logicSectionCodeList.forEach( (logicSectionCode) => { + const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode); + logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : ''); + }); + } else { + section && section.instance.drawBatchSelected(flag, flag ? type : ''); + } + } + }, save() { this.loading = true; if (this.editShow) { @@ -342,7 +373,7 @@ export default { startSectionCode: '', startStationCode: '', right: false, - distance: '', + distance: 0, l1: 0, l2: 0, l3: 0,