This commit is contained in:
zyy 2019-08-05 17:29:33 +08:00
commit d819a27f94
23 changed files with 24 additions and 30 deletions

View File

@ -2,7 +2,7 @@ const mapDeviceStyle = {
// '01': 'chengdu_04', // '01': 'chengdu_04',
'02': 'fuzhou_01', '02': 'fuzhou_01',
'03': 'bejing_01', '03': 'bejing_01',
// '03': 'chengdu_03', '04': 'chengdu_03',
'05': 'batong_01' // 暂时没有画北京八通线 '05': 'batong_01' // 暂时没有画北京八通线
}; };

View File

@ -285,7 +285,8 @@ class SkinStyle extends defaultStyle {
this[deviceType.Switch] = { this[deviceType.Switch] = {
text: { text: {
distance: 2, // 道岔名称与区段距离 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: -15, y: -10}, // 道岔名称与区段距离
fontSize: 10, // 字体大小 fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色 borderColor: '#FE0000', // 道岔边框颜色

View File

@ -58,6 +58,7 @@ class SkinStyle extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式 textVerticalAlign: 'middle' // 文字垂直对齐方式
}, },
destinationText: { destinationText: {
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离 distance: 12, // 文字离区段距离
fontSize: 11, // 字体大小 fontSize: 11, // 字体大小
@ -281,7 +282,8 @@ class SkinStyle extends defaultStyle {
this[deviceType.Switch] = { this[deviceType.Switch] = {
text: { text: {
distance: 2, // 道岔名称与区段距离 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 5, y: -10}, // 道岔名称与区段距离
fontSize: 11, // 字体大小 fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色 borderColor: '#FE0000', // 道岔边框颜色

View File

@ -261,7 +261,8 @@ class SkinStyle extends defaultStyle {
this[deviceType.Switch] = { this[deviceType.Switch] = {
text: { text: {
distance: 2, // 道岔名称与区段距离 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 5, y: 10}, // 道岔名称与区段距离
fontSize: 10, // 字体大小 fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色 borderColor: '#FE0000', // 道岔边框颜色

View File

@ -57,7 +57,6 @@ export default class LcControl extends Group {
// 设置状态 // 设置状态
setState(model) { setState(model) {
this.model = model;
} }
createMouseEvent() { createMouseEvent() {

View File

@ -57,7 +57,6 @@ export default class LimitControl extends Group {
// 设置状态 // 设置状态
setState(model) { setState(model) {
this.model = model;
} }
createMouseEvent() { createMouseEvent() {

View File

@ -49,7 +49,6 @@ export default class Line2 extends Group {
} }
setState(model) { setState(model) {
this.model = model;
this.setLineType(model.type); this.setLineType(model.type);
} }
} }

View File

@ -46,7 +46,6 @@ class Link extends Group {
} }
setState(model) { setState(model) {
this.model = model;
} }
tipBasePoint() { tipBasePoint() {

View File

@ -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 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 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 traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1;
/** 区段名称*/ /** 区段名称*/
if (model.nameShow) { if (model.nameShow) {
let tempx = x; let tempx = x;
@ -235,7 +235,7 @@ export default class Section extends Group {
if (model.type == '02') { if (model.type == '02') {
const opposite = style.Section.logicText.opposite ? -1: 1; const opposite = style.Section.logicText.opposite ? -1: 1;
tempx += traingle.getSin(style.Section.logicText.distance); 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({ this.name = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 2, z: this.z + 2,
@ -255,7 +255,7 @@ export default class Section extends Group {
} else { } else {
const opposite = style.Section.text.opposite ? -1: 1; const opposite = style.Section.text.opposite ? -1: 1;
tempx += traingle.getSin(style.Section.text.distance); 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({ this.name = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 2, z: this.z + 2,
@ -298,7 +298,7 @@ export default class Section extends Group {
if (model.isStandTrack && model.standTrackNameShow) { if (model.isStandTrack && model.standTrackNameShow) {
const opposite = style.Section.standText.opposite ? -1: 1; const opposite = style.Section.standText.opposite ? -1: 1;
const tempx = x + traingle.getSin(style.Section.standText.distance); 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({ this.standTrackText = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 2, z: this.z + 2,
@ -321,7 +321,7 @@ export default class Section extends Group {
if (model.isReentryTrack && model.reentryTrackNameShow) { if (model.isReentryTrack && model.reentryTrackNameShow) {
const opposite = style.Section.reentryText.opposite ? -1: 1; const opposite = style.Section.reentryText.opposite ? -1: 1;
const tempx = x + traingle.getSin(style.Section.reentryText.distance); 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({ this.reentryTrackText = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 2, z: this.z + 2,
@ -344,7 +344,7 @@ export default class Section extends Group {
if (model.isTransferTrack && model.transferTrackNameShow) { if (model.isTransferTrack && model.transferTrackNameShow) {
const opposite = style.Section.transferText.opposite ? -1: 1; const opposite = style.Section.transferText.opposite ? -1: 1;
const tempx = x + traingle.getSin(style.Section.transferText.distance); 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({ this.transferTrackText = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 2, z: this.z + 2,
@ -728,7 +728,7 @@ export default class Section extends Group {
/** 设置状态*/ /** 设置状态*/
setState(model) { setState(model) {
this.model = model; // this.model = model;
this.recover(); this.recover();
switch (model.status) { switch (model.status) {
case '00': /** 未定义*/ case '00': /** 未定义*/

View File

@ -54,6 +54,9 @@ export default class EMouse extends Group {
mouseout(e) { mouseout(e) {
this.nameRect.hide(); this.nameRect.hide();
this.lampRect.hide(); this.lampRect.hide();
this.device.lamps.forEach(elem => {
elem.setBorderColor(this.style.Signal.lamp.borderColor);
});
this.device.setState(this.device.model); this.device.setState(this.device.model);
} }
} }

View File

@ -27,7 +27,7 @@ class ESigLamp extends Group {
style: { style: {
lineWidth: style.Signal.lamp.borderWidth, lineWidth: style.Signal.lamp.borderWidth,
fill: style.backgroundColor, fill: style.backgroundColor,
stroke: style.Signal.post.standardColor stroke: style.Signal.lamp.borderColor
} }
}); });

View File

@ -433,7 +433,6 @@ class Signal extends Group {
} }
setState(model) { setState(model) {
this.model = model;
this.recover(); this.recover();
/** 设置状态 (点灯类型)*/ /** 设置状态 (点灯类型)*/
switch (model.status) { switch (model.status) {

View File

@ -72,7 +72,6 @@ export default class Station extends Group {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
setState(model) { setState(model) {
this.model = model;
} }
getShapeTipPoint() { getShapeTipPoint() {

View File

@ -105,7 +105,6 @@ export default class StationControl extends Group {
// 设置状态 // 设置状态
setState(model) { setState(model) {
this.model = model;
switch (model.status) { switch (model.status) {
case '00': // 无状态 case '00': // 无状态
this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor); this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor);

View File

@ -81,7 +81,6 @@ export default class StationCounter extends Group {
} }
setState(model) { setState(model) {
this.model = model;
} }
getShapeTipPoint() { getShapeTipPoint() {

View File

@ -95,7 +95,6 @@ export default class StationDelayUnlock extends Group {
} }
setState(model) { setState(model) {
this.model = model;
switch (model.status) { switch (model.status) {
case '01': this.delayClose(); break; // 关闭 case '01': this.delayClose(); break; // 关闭
case '02': this.delayUnlock(); break; // 延迟解锁 case '02': this.delayUnlock(); break; // 延迟解锁

View File

@ -310,7 +310,6 @@ class StationStand extends Group {
} }
setState(model) { setState(model) {
this.model = model;
this.recover(); this.recover();
switch (model.status) { switch (model.status) {
case '01': /** 空闲*/ case '01': /** 空闲*/

View File

@ -24,7 +24,7 @@ class ESwName extends Group {
fontFamily: style.textFontFormat, fontFamily: style.textFontFormat,
text: model.name, text: model.name,
textAlign: model.triangle.drictx === 1 ? 'left' : 'right', textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
textVerticalAlign: model.triangle.dricty === 1 ? 'top' : 'bottom', textVerticalAlign: 'middle',
textFill: style.textFontColor textFill: style.textFontColor
} }
}); });

View File

@ -123,8 +123,9 @@ export default class Switch extends Group {
const arrowTextX = model.intersection.x + 10; const arrowTextX = model.intersection.x + 10;
const arrowTextY = model.intersection.y + 15; 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 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 + this.triangle.dricty * (style.Switch.text.distance); const nameTextY = model.namePosition.y + model.intersection.y + style.Switch.text.offset.y * (style.Switch.text.position || directy);
this.name = new ESwName({ this.name = new ESwName({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
@ -368,7 +369,6 @@ export default class Switch extends Group {
} }
setState(model) { setState(model) {
this.model = model;
this.setLocateType(model); this.setLocateType(model);
switch (model.status) { switch (model.status) {
case '01': case '01':

View File

@ -40,6 +40,5 @@ export default class Text2 extends Group {
} }
setState(model) { setState(model) {
this.model = model;
} }
} }

View File

@ -62,7 +62,6 @@ class TrainWindow extends Group {
// 设置状态 // 设置状态
setState(model) { setState(model) {
this.model = model;
this.setTrainWindowEventShow(model.trainWindowShow); this.setTrainWindowEventShow(model.trainWindowShow);
} }
setTrainWindowEventShow(show) { setTrainWindowEventShow(show) {

View File

@ -57,7 +57,6 @@ export default class ZcControl extends Group {
// 设置状态 // 设置状态
setState(model) { setState(model) {
this.model = model;
} }
createMouseEvent() { createMouseEvent() {
if (this.style.ZcControl.mouseOverStyle) { if (this.style.ZcControl.mouseOverStyle) {

View File

@ -2,7 +2,7 @@
export function getBaseUrl() { export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { 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 = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9010' // 袁琪 // BASE_API = 'http://192.168.3.5:9010' // 袁琪
// BASE_API = 'http://192.168.3.6:9010'; // 旭强 // BASE_API = 'http://192.168.3.6:9010'; // 旭强