新建车站以后 无法点击其他的东西 bug 调整

This commit is contained in:
joylink_cuiweidong 2021-01-13 17:34:57 +08:00
parent ac6f3673d4
commit 99644039d3
3 changed files with 30 additions and 5 deletions

View File

@ -150,6 +150,14 @@ class SkinCode extends defaultStyle {
fillColor:'#ff0', fillColor:'#ff0',
strokeColor:'#fff', strokeColor:'#fff',
width:1 width:1
},
text:{
fontSize: 8, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
} }
} }
}; };

View File

@ -1,11 +1,11 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Polyline from 'zrender/src/graphic/shape/Polyline'; import Polyline from 'zrender/src/graphic/shape/Polyline';
import Isogon from 'zrender/src/graphic/shape/Isogon'; import Isogon from 'zrender/src/graphic/shape/Isogon';
import Text from 'zrender/src/graphic/Text';
import BezierCurve from 'zrender/src/graphic/shape/BezierCurve'; import BezierCurve from 'zrender/src/graphic/shape/BezierCurve';
import JTriangle from '../../utils/JTriangle'; import JTriangle from '../../utils/JTriangle';
import {segmentsIntr} from '@/utils/index'; import {segmentsIntr} from '@/utils/index';
import store from '@/store/index'; import store from '@/store/index';
import { Triangle } from 'three';
/** 创建区段线集合*/ /** 创建区段线集合*/
export default class ELines extends Group { export default class ELines extends Group {
@ -30,8 +30,6 @@ export default class ELines extends Group {
} }
createCross() { createCross() {
// name
// namePosition
const model = this.model.modelData; const model = this.model.modelData;
const style = this.model.style; const style = this.model.style;
const relateSectionList = model.relateSectionList; const relateSectionList = model.relateSectionList;
@ -42,8 +40,6 @@ export default class ELines extends Group {
const endPointB = sectionB.points[sectionB.points.length - 1]; const endPointB = sectionB.points[sectionB.points.length - 1];
const startPointB = sectionB.points[0]; const startPointB = sectionB.points[0];
const result = segmentsIntr(startPointA, endPointA, startPointB, endPointB); const result = segmentsIntr(startPointA, endPointA, startPointB, endPointB);
const points = [
];
// this.cross = new Polyline({ // this.cross = new Polyline({
// zlevel: this.zlevel, // zlevel: this.zlevel,
// z: this.z + 5, // z: this.z + 5,
@ -126,8 +122,27 @@ export default class ELines extends Group {
fill:style.Section.cross.centerSquare.defaultColor 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.crossSection);
this.add(this.centerSquare); this.add(this.centerSquare);
this.add(this.crossText);
} }
createLine() { createLine() {

View File

@ -400,6 +400,8 @@ export default {
models.push(sectionModel); models.push(sectionModel);
}); });
this.$emit('updateMapModel', models); this.$emit('updateMapModel', models);
this.field = '';
this.$emit('deviceSelect', '');
this.addModel = { this.addModel = {
modelList: [], modelList: [],
positionY: 0 positionY: 0