From 99644039d365858e44981bf8c2a56ad03ae7bd4a Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 13 Jan 2021 17:34:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=BD=A6=E7=AB=99=E4=BB=A5?= =?UTF-8?q?=E5=90=8E=20=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=9A=84=E4=B8=9C=E8=A5=BF=20bug=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/nanjing_02.js | 8 ++++++ src/jmapNew/shape/Section/ELines.js | 25 +++++++++++++++---- .../newMap/newMapdraft/mapoperate/station.vue | 2 ++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index 4da8522ae..844f85233 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -150,6 +150,14 @@ class SkinCode extends defaultStyle { fillColor:'#ff0', strokeColor:'#fff', width:1 + }, + text:{ + fontSize: 8, // 字体大小 + fontWeight: 'normal', // 字体粗细 + fontColor: '#FFFFFF', // 字体颜色 + textAlign: 'center', // 水平对齐方式 + textPosition: 'inside', // 文字位置 + textVerticalAlign: 'middle' // 文字垂直对齐方式 } } }; diff --git a/src/jmapNew/shape/Section/ELines.js b/src/jmapNew/shape/Section/ELines.js index a4997f5f1..74c7cf603 100644 --- a/src/jmapNew/shape/Section/ELines.js +++ b/src/jmapNew/shape/Section/ELines.js @@ -1,11 +1,11 @@ import Group from 'zrender/src/container/Group'; import Polyline from 'zrender/src/graphic/shape/Polyline'; import Isogon from 'zrender/src/graphic/shape/Isogon'; +import Text from 'zrender/src/graphic/Text'; import BezierCurve from 'zrender/src/graphic/shape/BezierCurve'; import JTriangle from '../../utils/JTriangle'; import {segmentsIntr} from '@/utils/index'; import store from '@/store/index'; -import { Triangle } from 'three'; /** 创建区段线集合*/ export default class ELines extends Group { @@ -30,8 +30,6 @@ export default class ELines extends Group { } createCross() { - // name - // namePosition const model = this.model.modelData; const style = this.model.style; const relateSectionList = model.relateSectionList; @@ -42,8 +40,6 @@ export default class ELines extends Group { const endPointB = sectionB.points[sectionB.points.length - 1]; const startPointB = sectionB.points[0]; const result = segmentsIntr(startPointA, endPointA, startPointB, endPointB); - const points = [ - ]; // this.cross = new Polyline({ // zlevel: this.zlevel, // z: this.z + 5, @@ -126,8 +122,27 @@ export default class ELines extends Group { fill:style.Section.cross.centerSquare.defaultColor } }); + + this.crossText = new Text({ + zlevel: this.zlevel, + z: this.z + 8, + style: { + x: result.x + model.namePosition.x, + y: result.y + model.namePosition.y, + fontWeight: style.Section.cross.text.fontWeight, + fontSize: style.Section.cross.text.fontSize, + fontFamily: style.Section.cross.text.fontFamily || style.fontFamily, + text: model.name, + textFill:style.Section.cross.text.fontColor, + textAlign: style.Section.cross.text.textAlign, + textPosition: style.Section.cross.text.textPosition, + textVerticalAlign: style.Section.cross.text.textVerticalAlign + } + }); + this.add(this.crossSection); this.add(this.centerSquare); + this.add(this.crossText); } createLine() { diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index a9352152a..f63b4fb6b 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -400,6 +400,8 @@ export default { models.push(sectionModel); }); this.$emit('updateMapModel', models); + this.field = ''; + this.$emit('deviceSelect', ''); this.addModel = { modelList: [], positionY: 0