From 143f35a222db81fa682398dd2d668c5afe22ae4e Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 19 Dec 2019 16:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E7=89=A9=E7=90=86=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E5=88=97=E8=A1=A8=E8=BF=9E=E7=BB=AD=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Section/index.js | 15 +- src/utils/baseUrl.js | 4 +- .../newMap/newMapdraft/dataRelation/index.vue | 11 +- .../dataRelation/protectoperate/detail.vue | 157 ------- .../dataRelation/protectoperate/index.vue | 84 ---- .../dataRelation/protectoperate/route.vue | 413 ------------------ .../dataRelation/routeoperate/index.vue | 3 + .../dataRelation/routeoperate/route.vue | 27 +- .../newMap/newMapdraft/mapoperate/section.vue | 1 + .../mapoperate/section/logicBlock.vue | 5 + 10 files changed, 58 insertions(+), 662 deletions(-) delete mode 100644 src/views/newMap/newMapdraft/dataRelation/protectoperate/detail.vue delete mode 100644 src/views/newMap/newMapdraft/dataRelation/protectoperate/index.vue delete mode 100644 src/views/newMap/newMapdraft/dataRelation/protectoperate/route.vue diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index dbc5fb279..8deec902a 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -22,6 +22,7 @@ export default class Section extends Group { this.model = model; this.style = style; this.selected = false; // 绘图选中状态 + this.batchSelected = false; // 绘图批量选中状态 this.create(); this.createMouseEvent(); this.setState(model); @@ -853,7 +854,15 @@ export default class Section extends Group { drawSelected(selected) { this.selected = selected; if (selected) { - this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); + !this.batchSelected && this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); + } else { + !this.batchSelected && this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); + } + } + drawBatchSelected(selected) { + this.batchSelected = selected; + if (selected) { + this.section && this.section.setStyle({stroke: 'rgba(255,255,0,0.6)'}); } else { this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); } @@ -862,8 +871,8 @@ export default class Section extends Group { checkIsDrawMap() { const path = window.location.href; if (path.includes('/map/draw')) { - this.on('mouseout', () => { !this.selected && this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); }); - this.on('mouseover', () => { this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); }); + this.on('mouseout', () => { !this.batchSelected && !this.selected && this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); }); + this.on('mouseover', () => { !this.batchSelected && this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); }); } } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 79d1c6346..1e9afea51 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,11 +3,11 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - BASE_API = 'http://192.168.3.82:9000'; // 杜康 + // BASE_API = 'http://192.168.3.82:9000'; // 杜康 } else { BASE_API = process.env.VUE_APP_BASE_API; } diff --git a/src/views/newMap/newMapdraft/dataRelation/index.vue b/src/views/newMap/newMapdraft/dataRelation/index.vue index 1528f1c41..4b6e73b40 100644 --- a/src/views/newMap/newMapdraft/dataRelation/index.vue +++ b/src/views/newMap/newMapdraft/dataRelation/index.vue @@ -12,7 +12,7 @@ {{ $t('map.drawMap') }} {{ $t('map.viewLayer') }} - + - -
- -
-
- - - diff --git a/src/views/newMap/newMapdraft/dataRelation/protectoperate/index.vue b/src/views/newMap/newMapdraft/dataRelation/protectoperate/index.vue deleted file mode 100644 index 086e26408..000000000 --- a/src/views/newMap/newMapdraft/dataRelation/protectoperate/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - diff --git a/src/views/newMap/newMapdraft/dataRelation/protectoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/protectoperate/route.vue deleted file mode 100644 index a7bc14665..000000000 --- a/src/views/newMap/newMapdraft/dataRelation/protectoperate/route.vue +++ /dev/null @@ -1,413 +0,0 @@ - - - diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/index.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/index.vue index 33ace43fb..6934ae5b6 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/index.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/index.vue @@ -79,6 +79,9 @@ export default { }, setCenter(code) { this.$emit('setCenter', code); + }, + routeSectionListFocus(flag) { + this.$refs.routeEdit.routeSectionListFocus(flag); } } }; diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index e28089fcf..bf42ca694 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -350,9 +350,24 @@ export default { this.addModel.name = val; } }, - 'addModel.routeSectionList': function(val) { + 'addModel.routeSectionList': function(val, old) { + if (old && old.length) { + old.forEach((item) => { + const section = this.$store.getters['map/getDeviceByCode'](item); + section.instance.drawBatchSelected(false); + }); + } if (val && val.length) { this.$refs.protect.addModel.unlockSectionCode = val[val.length - 1]; + val.forEach((item) => { + const section = this.$store.getters['map/getDeviceByCode'](item); + if (section.logicSectionCodeList && section.logicSectionCodeList.length) { + section.logicSectionCodeList.forEach( (logicSectionCode) => { + this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(true); + }); + } + section.instance.drawBatchSelected(true); + }); } } }, @@ -466,6 +481,12 @@ export default { this.protectData = resp.data.list[0]; }); }, + routeSectionListFocus(flag) { + this.addModel.routeSectionList.forEach((item) => { + const section = this.$store.getters['map/getDeviceByCode'](item); + section.instance.drawBatchSelected(flag); + }); + }, setSelected(selected) { if (selected) { if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'startSignalCode'.toUpperCase()) { @@ -473,8 +494,10 @@ export default { } else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'endSignalCode'.toUpperCase()) { this.addModel.endSignalCode = selected.code; } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeSectionList'.toUpperCase()) { - if (this.addModel.routeSectionList.indexOf(selected.code) === -1) { + if ((selected.type === '01' || selected.type === '03') && this.addModel.routeSectionList.indexOf(selected.code) === -1) { this.addModel.routeSectionList.push(selected.code); + } else if (selected.type === '02' && this.addModel.routeSectionList.indexOf(selected.parentCode) === -1) { + this.addModel.routeSectionList.push(selected.parentCode); } } else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeSwitchList'.toUpperCase()) { this.routeCode = selected.code; diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index ed572ea5c..750899510 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -240,6 +240,7 @@ export default { kmRangeLeft: 0, region: '', logicSectionNum: [], + logicSectionCodeList: [], logicSectionShow: false, // 是否显示逻辑区段 standTrack: false, // 是否站台轨 standTrackName: '', diff --git a/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue b/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue index 5140b5ed6..bb26e36ad 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue @@ -88,6 +88,10 @@ export default { counts += parseInt(ele.num); }); if (count === 0 || allNotZeros) { + const logicSectionCodeList = []; + models.forEach(item=> { + logicSectionCodeList.push(item.code); + }); this.sectionList.forEach(section => { // 删除之前的逻辑区段 if (section.type === '02' && section.parentCode == this.editModel.code) { models.push(deepAssign(section, {_dispose: true})); @@ -97,6 +101,7 @@ export default { logicSectionNumList = []; } this.editModel.logicSectionNum = [...logicSectionNumList]; + this.editModel.logicSectionCodeList = logicSectionCodeList; models.push(this.editModel); this.$emit('updateMapModel', models); } else {