diff --git a/src/jmap/config/deviceStyle.js b/src/jmap/config/deviceStyle.js index adef27cac..93bc1b125 100644 --- a/src/jmap/config/deviceStyle.js +++ b/src/jmap/config/deviceStyle.js @@ -2,7 +2,7 @@ const mapDeviceStyle = { // '01': 'chengdu_04', '02': 'fuzhou_01', '03': 'bejing_01', - // '03': 'chengdu_03', + '04': 'chengdu_03', '05': 'batong_01' // 暂时没有画北京八通线 }; diff --git a/src/jmap/config/skinStyle/bejing_01.js b/src/jmap/config/skinStyle/bejing_01.js index eef14b29b..b217a529d 100644 --- a/src/jmap/config/skinStyle/bejing_01.js +++ b/src/jmap/config/skinStyle/bejing_01.js @@ -285,7 +285,8 @@ class SkinStyle extends defaultStyle { this[deviceType.Switch] = { text: { - distance: 2, // 道岔名称与区段距离 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + offset: {x: -15, y: -10}, // 道岔名称与区段距离 fontSize: 10, // 字体大小 fontWeight: 'normal', // 字体粗细 borderColor: '#FE0000', // 道岔边框颜色 diff --git a/src/jmap/config/skinStyle/chengdu_03.js b/src/jmap/config/skinStyle/chengdu_03.js index 9e35d8aa0..ad9c8ac37 100644 --- a/src/jmap/config/skinStyle/chengdu_03.js +++ b/src/jmap/config/skinStyle/chengdu_03.js @@ -58,6 +58,7 @@ class SkinStyle extends defaultStyle { textVerticalAlign: 'middle' // 文字垂直对齐方式 }, destinationText: { + opposite: true, // 对称相反 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 distance: 12, // 文字离区段距离 fontSize: 11, // 字体大小 @@ -281,7 +282,8 @@ class SkinStyle extends defaultStyle { this[deviceType.Switch] = { text: { - distance: 2, // 道岔名称与区段距离 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + offset: {x: 5, y: -10}, // 道岔名称与区段距离 fontSize: 11, // 字体大小 fontWeight: 'normal', // 字体粗细 borderColor: '#FE0000', // 道岔边框颜色 diff --git a/src/jmap/config/skinStyle/fuzhou_01.js b/src/jmap/config/skinStyle/fuzhou_01.js index fd389602a..c42e96ba7 100644 --- a/src/jmap/config/skinStyle/fuzhou_01.js +++ b/src/jmap/config/skinStyle/fuzhou_01.js @@ -261,7 +261,8 @@ class SkinStyle extends defaultStyle { this[deviceType.Switch] = { text: { - distance: 2, // 道岔名称与区段距离 + position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 + offset: {x: 5, y: 10}, // 道岔名称与区段距离 fontSize: 10, // 字体大小 fontWeight: 'normal', // 字体粗细 borderColor: '#FE0000', // 道岔边框颜色 diff --git a/src/jmap/shape/LcControl/index.js b/src/jmap/shape/LcControl/index.js index 7aed8e788..65757d39c 100644 --- a/src/jmap/shape/LcControl/index.js +++ b/src/jmap/shape/LcControl/index.js @@ -57,7 +57,6 @@ export default class LcControl extends Group { // 设置状态 setState(model) { - this.model = model; } createMouseEvent() { diff --git a/src/jmap/shape/LimitControl/index.js b/src/jmap/shape/LimitControl/index.js index e4cd7428c..17484ba58 100644 --- a/src/jmap/shape/LimitControl/index.js +++ b/src/jmap/shape/LimitControl/index.js @@ -57,7 +57,6 @@ export default class LimitControl extends Group { // 设置状态 setState(model) { - this.model = model; } createMouseEvent() { diff --git a/src/jmap/shape/Line/index.js b/src/jmap/shape/Line/index.js index eca8c0cdc..05be49bec 100644 --- a/src/jmap/shape/Line/index.js +++ b/src/jmap/shape/Line/index.js @@ -49,7 +49,6 @@ export default class Line2 extends Group { } setState(model) { - this.model = model; this.setLineType(model.type); } } diff --git a/src/jmap/shape/Link/index.js b/src/jmap/shape/Link/index.js index e09c61599..b2962e75a 100644 --- a/src/jmap/shape/Link/index.js +++ b/src/jmap/shape/Link/index.js @@ -46,7 +46,6 @@ class Link extends Group { } setState(model) { - this.model = model; } tipBasePoint() { diff --git a/src/jmap/shape/Section/index.js b/src/jmap/shape/Section/index.js index e52727064..8445fb8f8 100644 --- a/src/jmap/shape/Section/index.js +++ b/src/jmap/shape/Section/index.js @@ -224,8 +224,8 @@ export default class Section extends Group { // 计算区段坐标位置 const x = Math.min(model.points[0].x, model.points[model.points.length - 1].x) + Math.abs(model.points[model.points.length - 1].x - model.points[0].x) / 2; const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2; - const drict = model.trainPosType != '01' ? 1 : -1; const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); + const drict = model.trainPosType != '01' ? 1 : -1; /** 区段名称*/ if (model.nameShow) { let tempx = x; @@ -235,7 +235,7 @@ export default class Section extends Group { if (model.type == '02') { const opposite = style.Section.logicText.opposite ? -1: 1; tempx += traingle.getSin(style.Section.logicText.distance); - tempy += traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite*drict); + tempy += traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict); this.name = new ETextName({ zlevel: this.zlevel, z: this.z + 2, @@ -255,7 +255,7 @@ export default class Section extends Group { } else { const opposite = style.Section.text.opposite ? -1: 1; tempx += traingle.getSin(style.Section.text.distance); - tempy += traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite*drict); + tempy += traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict); this.name = new ETextName({ zlevel: this.zlevel, z: this.z + 2, @@ -298,7 +298,7 @@ export default class Section extends Group { if (model.isStandTrack && model.standTrackNameShow) { const opposite = style.Section.standText.opposite ? -1: 1; const tempx = x + traingle.getSin(style.Section.standText.distance); - const tempy = y + traingle.getCos(style.Section.standText.distance) * (style.Section.standText.position || opposite*drict); + const tempy = y + traingle.getCos(style.Section.standText.distance) * (style.Section.standText.position || opposite * drict); this.standTrackText = new ETextName({ zlevel: this.zlevel, z: this.z + 2, @@ -321,7 +321,7 @@ export default class Section extends Group { if (model.isReentryTrack && model.reentryTrackNameShow) { const opposite = style.Section.reentryText.opposite ? -1: 1; const tempx = x + traingle.getSin(style.Section.reentryText.distance); - const tempy = y + traingle.getCos(style.Section.reentryText.distance) * (style.Section.reentryText.position || opposite*drict); + const tempy = y + traingle.getCos(style.Section.reentryText.distance) * (style.Section.reentryText.position || opposite * drict); this.reentryTrackText = new ETextName({ zlevel: this.zlevel, z: this.z + 2, @@ -344,7 +344,7 @@ export default class Section extends Group { if (model.isTransferTrack && model.transferTrackNameShow) { const opposite = style.Section.transferText.opposite ? -1: 1; const tempx = x + traingle.getSin(style.Section.transferText.distance); - const tempy = y + traingle.getCos(style.Section.transferText.distance) * (style.Section.transferText.position || opposite*drict); + const tempy = y + traingle.getCos(style.Section.transferText.distance) * (style.Section.transferText.position || opposite * drict); this.transferTrackText = new ETextName({ zlevel: this.zlevel, z: this.z + 2, @@ -728,7 +728,7 @@ export default class Section extends Group { /** 设置状态*/ setState(model) { - this.model = model; + // this.model = model; this.recover(); switch (model.status) { case '00': /** 未定义*/ diff --git a/src/jmap/shape/Signal/EMouse.js b/src/jmap/shape/Signal/EMouse.js index cd6ad0083..2ab1e3bec 100644 --- a/src/jmap/shape/Signal/EMouse.js +++ b/src/jmap/shape/Signal/EMouse.js @@ -54,6 +54,9 @@ export default class EMouse extends Group { mouseout(e) { this.nameRect.hide(); this.lampRect.hide(); + this.device.lamps.forEach(elem => { + elem.setBorderColor(this.style.Signal.lamp.borderColor); + }); this.device.setState(this.device.model); } } diff --git a/src/jmap/shape/Signal/ESigLamp.js b/src/jmap/shape/Signal/ESigLamp.js index bf0828788..1e38cdba6 100644 --- a/src/jmap/shape/Signal/ESigLamp.js +++ b/src/jmap/shape/Signal/ESigLamp.js @@ -27,7 +27,7 @@ class ESigLamp extends Group { style: { lineWidth: style.Signal.lamp.borderWidth, fill: style.backgroundColor, - stroke: style.Signal.post.standardColor + stroke: style.Signal.lamp.borderColor } }); diff --git a/src/jmap/shape/Signal/index.js b/src/jmap/shape/Signal/index.js index b020811f5..cf380ea09 100644 --- a/src/jmap/shape/Signal/index.js +++ b/src/jmap/shape/Signal/index.js @@ -433,7 +433,6 @@ class Signal extends Group { } setState(model) { - this.model = model; this.recover(); /** 设置状态 (点灯类型)*/ switch (model.status) { diff --git a/src/jmap/shape/Station/index.js b/src/jmap/shape/Station/index.js index 51876658d..61ce44964 100644 --- a/src/jmap/shape/Station/index.js +++ b/src/jmap/shape/Station/index.js @@ -72,7 +72,6 @@ export default class Station extends Group { // eslint-disable-next-line no-unused-vars setState(model) { - this.model = model; } getShapeTipPoint() { diff --git a/src/jmap/shape/StationControl/index.js b/src/jmap/shape/StationControl/index.js index dee41cabb..c76c3a9cc 100644 --- a/src/jmap/shape/StationControl/index.js +++ b/src/jmap/shape/StationControl/index.js @@ -105,7 +105,6 @@ export default class StationControl extends Group { // 设置状态 setState(model) { - this.model = model; switch (model.status) { case '00': // 无状态 this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor); diff --git a/src/jmap/shape/StationCounter/index.js b/src/jmap/shape/StationCounter/index.js index 2f4949562..2c9390a97 100644 --- a/src/jmap/shape/StationCounter/index.js +++ b/src/jmap/shape/StationCounter/index.js @@ -81,7 +81,6 @@ export default class StationCounter extends Group { } setState(model) { - this.model = model; } getShapeTipPoint() { diff --git a/src/jmap/shape/StationDelayUnlock/index.js b/src/jmap/shape/StationDelayUnlock/index.js index 61e6d6e7b..03074ebec 100644 --- a/src/jmap/shape/StationDelayUnlock/index.js +++ b/src/jmap/shape/StationDelayUnlock/index.js @@ -95,7 +95,6 @@ export default class StationDelayUnlock extends Group { } setState(model) { - this.model = model; switch (model.status) { case '01': this.delayClose(); break; // 关闭 case '02': this.delayUnlock(); break; // 延迟解锁 diff --git a/src/jmap/shape/StationStand/index.js b/src/jmap/shape/StationStand/index.js index 6fcf12ed5..ea827fb39 100644 --- a/src/jmap/shape/StationStand/index.js +++ b/src/jmap/shape/StationStand/index.js @@ -310,7 +310,6 @@ class StationStand extends Group { } setState(model) { - this.model = model; this.recover(); switch (model.status) { case '01': /** 空闲*/ diff --git a/src/jmap/shape/Switch/ESwName.js b/src/jmap/shape/Switch/ESwName.js index 41628028a..cdcfe3d91 100644 --- a/src/jmap/shape/Switch/ESwName.js +++ b/src/jmap/shape/Switch/ESwName.js @@ -24,7 +24,7 @@ class ESwName extends Group { fontFamily: style.textFontFormat, text: model.name, textAlign: model.triangle.drictx === 1 ? 'left' : 'right', - textVerticalAlign: model.triangle.dricty === 1 ? 'top' : 'bottom', + textVerticalAlign: 'middle', textFill: style.textFontColor } }); diff --git a/src/jmap/shape/Switch/index.js b/src/jmap/shape/Switch/index.js index 26ebc7797..4f703f574 100644 --- a/src/jmap/shape/Switch/index.js +++ b/src/jmap/shape/Switch/index.js @@ -123,8 +123,9 @@ export default class Switch extends Group { const arrowTextX = model.intersection.x + 10; const arrowTextY = model.intersection.y + 15; - const nameTextX = model.namePosition.x + model.intersection.x + this.triangle.drictx * (style.Section.line.width * 3 + style.Switch.text.distance) * this.triangle.getCotRate(); - const nameTextY = model.namePosition.y + model.intersection.y + this.triangle.dricty * (style.Switch.text.distance); + const nameTextX = model.namePosition.x + model.intersection.x + directx * (style.Section.line.width * 3 + style.Switch.text.offset.x) * this.triangle.getCotRate(); + const nameTextY = model.namePosition.y + model.intersection.y + style.Switch.text.offset.y * (style.Switch.text.position || directy); + this.name = new ESwName({ zlevel: this.zlevel, z: this.z, @@ -368,7 +369,6 @@ export default class Switch extends Group { } setState(model) { - this.model = model; this.setLocateType(model); switch (model.status) { case '01': diff --git a/src/jmap/shape/Text/index.js b/src/jmap/shape/Text/index.js index d3388e9ec..08b27ddf3 100644 --- a/src/jmap/shape/Text/index.js +++ b/src/jmap/shape/Text/index.js @@ -40,6 +40,5 @@ export default class Text2 extends Group { } setState(model) { - this.model = model; } } diff --git a/src/jmap/shape/TrainWindow/index.js b/src/jmap/shape/TrainWindow/index.js index fc3fdf151..4daaf6b98 100644 --- a/src/jmap/shape/TrainWindow/index.js +++ b/src/jmap/shape/TrainWindow/index.js @@ -62,7 +62,6 @@ class TrainWindow extends Group { // 设置状态 setState(model) { - this.model = model; this.setTrainWindowEventShow(model.trainWindowShow); } setTrainWindowEventShow(show) { diff --git a/src/jmap/shape/ZcControl/index.js b/src/jmap/shape/ZcControl/index.js index 09619d10e..0dd3d4dda 100644 --- a/src/jmap/shape/ZcControl/index.js +++ b/src/jmap/shape/ZcControl/index.js @@ -57,7 +57,6 @@ export default class ZcControl extends Group { // 设置状态 setState(model) { - this.model = model; } createMouseEvent() { if (this.style.ZcControl.mouseOverStyle) { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index b9b16ba69..d47f9f2bc 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,7 +2,7 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { - // BASE_API = 'https://joylink.club/jlcloud' + // BASE_API = 'https://joylink.club/jlcloud'; BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9010' // 袁琪 // BASE_API = 'http://192.168.3.6:9010'; // 旭强