diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 300562c3a..ae3ba4881 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -857,7 +857,7 @@ export default class Section extends Group { checkIsDrawMap() { const path = window.location.href; if (path.includes('/map/draw')) { - this.highlight = new EHighlight(this.section); + this.highlight = new EHighlight(this); this.add(this.highlight); this.on('mouseout', () => { this.highlight.mouseout(); }); this.on('mouseover', () => { this.highlight.mouseover(); }); diff --git a/src/jmapNew/shape/element/EHighlight.js b/src/jmapNew/shape/element/EHighlight.js index 5c061636a..b0d1e5c9c 100644 --- a/src/jmapNew/shape/element/EHighlight.js +++ b/src/jmapNew/shape/element/EHighlight.js @@ -1,5 +1,6 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; +import Polygon from 'zrender/src/graphic/shape/Polygon'; class EHighlight extends Group { constructor(device) { @@ -11,17 +12,38 @@ class EHighlight extends Group { create() { if (this.device) { const rect = this.device.getBoundingRect(); - this.lineBorder = new Rect({ - zlevel: this.device.zlevel, - z: this.device.z + 1, - shape: rect, - style: { - lineDash: [3, 3], - stroke: '#fff', - fill: 'rgba(204,255,255,0.5)' - } - }); - + if (this.device._type === 'Section') { + const points = []; + this.device.model.points.forEach(item => { + points.unshift([item.x + 2, item.y + 2]); + }); + this.device.model.points.forEach(item => { + points.push([item.x - 2, item.y - 2]); + }); + this.lineBorder = new Polygon({ + zlevel: this.device.zlevel, + z:this.device.z + 1, + shape: { + points: points + }, + style: { + lineDash: [3, 3], + stroke: '#fff', + fill: 'rgba(204,255,255,0.5)' + } + }); + } else { + this.lineBorder = new Rect({ + zlevel: this.device.zlevel, + z: this.device.z + 1, + shape: rect, + style: { + lineDash: [3, 3], + stroke: '#fff', + fill: 'rgba(204,255,255,0.5)' + } + }); + } this.add(this.lineBorder); this.lineBorder.hide(); } diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index ee4edcc74..884a27dd9 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -195,6 +195,11 @@ + + + + +
@@ -235,6 +240,7 @@ export default { TrainPositionTypeList: [], regionList: [], viewSelect: false, + isDelimiter:false, editModel: { code: '', name: '', @@ -807,6 +813,10 @@ export default { region: model.region, relevanceSectionList: [] }; + if(this.isDelimiter){ + data.sepTypeLeft='01'; + data.sepTypeRight='01'; + } return data; }, // 创建逻辑区段