调整福州线路顶部栏显示名称字段

This commit is contained in:
zyy 2020-04-15 14:19:22 +08:00
parent 39d32b8f5c
commit 0091a593e5
21 changed files with 1223 additions and 1201 deletions

View File

@ -230,17 +230,31 @@ export default class Section extends Group {
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 traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1;
/** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/
if (style.Section.logicText.show || style.Section.text.show) {
let tempx = x;
let tempy = y;
// 创建区段名称
if (model.type !== '03') {
if (model.type == '02') {
if (model.type == '01' && style.Section.text.show && model.nameShow) { // 物理区段名称
const opposite = style.Section.text.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.text.distance);
const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y,
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.text.fontColor,
textAlign: style.Section.text.textAlign,
textPosition: style.Section.text.textPosition,
textVerticalAlign: style.Section.text.textVerticalAlign
});
this.add(this.name);
} else if (model.type == '02' && style.Section.logicText.show && model.nameShow) { // 逻辑区段
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);
if (style.Section.logicText.show) {
const tempx = x + traingle.getSin(style.Section.logicText.distance);
const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
@ -258,18 +272,14 @@ export default class Section extends Group {
textVerticalAlign: style.Section.logicText.textVerticalAlign
});
this.add(this.name);
}
} else if (style.Section.text.show && !model.isSwitchSection) {
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);
} else if (model.type == '03' && model.nameShow) { // 道岔计轴区段
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y,
x: x + model.namePosition.x,
y: y + model.namePosition.y + style.Section.text.distance * drict,
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
@ -281,28 +291,6 @@ export default class Section extends Group {
});
this.add(this.name);
}
} else {
if (style.Section.text.show) {
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y + style.Section.text.distance * drict,
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.text.fontColor,
textAlign: style.Section.text.textAlign,
textPosition: style.Section.text.textPosition,
textVerticalAlign: style.Section.text.textVerticalAlign
});
this.add(this.name);
}
}
}
/** 站台轨名称*/
if (model.isStandTrack && model.standTrackNameShow && style.Section.standText.show) {
@ -374,7 +362,7 @@ export default class Section extends Group {
}
/** 目的码名称*/
if (model.destinationCode && style.Section.destinationText.show) {
if (model.destinationCode && model.destinationNameShow && style.Section.destinationText.show) {
const opposite = style.Section.destinationText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.destinationText.distance);
const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict);

View File

@ -60,6 +60,7 @@ export default class Station extends Group {
textFill: model.kmPostFontColor
});
this.add(this.mileageText);
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
}
}

View File

@ -144,6 +144,7 @@ export default class Switch extends Group {
this.add(this.relocShelter);
this.add(this.releaseBackground);
this.add(this.name);
style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide();
}
createLockRect() {

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -190,9 +190,10 @@ export default {
//
nameShow = false;
let standTrackNameShow = false;
let reentryTrackNameShow = false;
let transferTrackNameShow = false;
const standTrackNameShow = this.nameLevels.indexOf(2) !== -1; //
const reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1; //
const transferTrackNameShow = this.nameLevels.indexOf(6) !== -1; //
const destinationNameShow = this.nameLevels.indexOf(10) !== -1;
const sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
@ -213,22 +214,7 @@ export default {
}
}
//
if (elem.isStandTrack) {
standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
}
//
if (elem.isReentryTrack) {
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1;
}
//
if (elem.isTransferTrack) {
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
}
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow, destinationNameShow }));
});
}

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -98,8 +98,7 @@ export default class Section extends Group {
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 traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1;
if (model.type == '01') { // 物理区段名称
if (style.Section.text.show) {
if (model.type == '01' && model.nameShow && style.Section.text.show) { // 物理区段名称
const opposite = style.Section.text.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.text.distance);
const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
@ -120,9 +119,7 @@ export default class Section extends Group {
textVerticalAlign: style.Section.text.textVerticalAlign
});
this.add(this.name);
}
} else if (model.type == '02') { // 逻辑区段
if (style.Section.logicText.show) {
} else if (model.type == '02' && model.nameShow && style.Section.logicText.show) { // 逻辑区段
const opposite = style.Section.logicText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.logicText.distance);
const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
@ -143,8 +140,7 @@ export default class Section extends Group {
textVerticalAlign: style.Section.logicText.textVerticalAlign
});
this.add(this.name);
}
} else if (model.type == '04') { // 道岔计轴区段
} else if (model.type == '04' && model.nameShow) { // 道岔计轴区段
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
@ -234,7 +230,7 @@ export default class Section extends Group {
}
/** 目的码名称*/
if (model.destinationCode && style.Section.destinationText.show) {
if (model.destinationCode && model.destinationNameShow && style.Section.destinationText.show) {
const opposite = style.Section.destinationText.opposite ? -1 : 1;
const tempx = x + traingle.getSin(style.Section.destinationText.distance);
const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict);

View File

@ -82,6 +82,7 @@ export default class Station extends Group {
textFill: model.kmPostFontColor
});
this.add(this.mileageText);
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
if (model.subheadDisplay) { // 副标题
this.subheadText = new ETextName({

View File

@ -161,6 +161,7 @@ export default class Switch extends Group {
this.add(this.sheltertriangle);
this.add(this.releaseBackground);
this.add(this.name);
style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide();
}
createLockRect() {

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示

View File

@ -14,8 +14,12 @@ class Model {
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
};
this['private'][deviceType.Switch] = {
nameShow: true
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
destinationNameShow: true, // 目的地码名称显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示