diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index fd349a3ac..8b4d9c50f 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -79,22 +79,31 @@ class SkinCode extends defaultStyle { width: 5, // 区段宽度 beyondWidth: 0, // 区段宽超出宽度 invadeColor: '#FFFFFF', // 区段侵入颜色 - spareColor: '#5578B6', // 区段空闲颜色 - communicationOccupiedColor: 'red', // 区段通信车占用颜色 // 调整 未确定 - unCommunicationOccupiedColor: '#EF72A7', // 区段非通讯车占用颜色 + spareColor: '#C0C0C0', // 区段空闲颜色 + communicationOccupiedColor: '#FE0000', // 区段通信车占用颜色 // 调整 未确定 + unCommunicationOccupiedColor: '#EF72A7', // 区段非通讯车占用颜色 routeLockColor: '#00ff00', // 区段进路锁定颜色 - faultLockColor: 'white', // 区段故障锁定颜色 + faultLockColor: '#81007F', // 区段故障锁定颜色 undefinedColor: '#0071C1', // 区段未定义颜色 protectionLockedColor: '#FFFFFF', // 保护区段锁闭 blockColor: '#d659d6', // 区段封锁颜色(淡紫色) atcExcisionColor: '#A0522D', // 区段atc切除颜色 atsExcisionColor: '#A0522D', // 区段ats切除颜色 - invalidColor: '#AC8F40', // 计轴故障颜色 + invalidColor: '#AC8F40', // 计轴故障颜色 timeReleaseColor: '#3F3F3F', // 区段延时释放颜色 protectiveLockColor: '#03C85C', // 区段保护锁闭 延续保护 protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁 logicalColor: '#FFFF00', // 逻辑区段颜色 (未用) - logicalTextColor: 'white' // 逻辑区段名称颜色 (未用) + logicalTextColor: 'white', // 逻辑区段名称颜色 (未用) + speedLimitColor: '#008081' // 临时限速颜色 + }, + topWithLine: { // 上陪线 + width: 1, + defaultColor: '#8BC4F9' + }, + bottomWithLine: { // 下陪线 + width: 2, + defaultColor: '#03FFF8' }, axle: {}, // 计轴 speedLimit: { // 限速元素 @@ -111,11 +120,11 @@ class SkinCode extends defaultStyle { drogueHeight: 12 // 浮标高度 }, separator: { - z: 6, // 分割符层级 + z: 3, // 分割符层级 width: 1.5, // 分隔符宽度 endWidth: 1.5, // 尽头分隔符宽度 - endColor: '#FFFFFF', // 尽头分隔符颜色 - color: 'white', // 区段边界符颜色 + endColor: '#000000', // 尽头分隔符颜色 + color: '#000000', // 区段边界符颜色 halfHeight: 5 // 区段分隔符高度的一半 }, block: { diff --git a/src/jmapNew/shape/Section/ELines.js b/src/jmapNew/shape/Section/ELines.js index 478d76d73..cdb9f0548 100644 --- a/src/jmapNew/shape/Section/ELines.js +++ b/src/jmapNew/shape/Section/ELines.js @@ -68,23 +68,67 @@ export default class ELines extends Group { }); this.add(this.section); } + if (model.style.Section.topWithLine && !model.isCurve) { + const topPoints = []; + for (let i = 0; i < model.points.length; i++) { + topPoints.push([model.points[i].x, model.points[i].y - model.style.Section.line.width / 2 - model.style.Section.topWithLine.width / 2]); + } + this.topWithSection = new Polyline({ + isLine: true, + zlevel: this.zlevel, + progressive: model.progressive, + z: this.z, + shape: { + points: topPoints + }, + style: { + lineWidth: model.style.Section.topWithLine.width, + stroke: model.style.Section.topWithLine.defaultColor + } + }); + this.add(this.topWithSection); + this.topWithSection.hide(); + } + if (model.style.Section.bottomWithLine && !model.isCurve) { + const bottomPoints = []; + for (let i = 0; i < model.points.length; i++) { + bottomPoints.push([model.points[i].x, model.points[i].y + model.style.Section.line.width / 2 + model.style.Section.bottomWithLine.width / 2]); + } + this.bottomWithSection = new Polyline({ + isLine: true, + zlevel: this.zlevel, + progressive: model.progressive, + z: this.z, + shape: { + points: bottomPoints + }, + style: { + lineWidth: model.style.Section.bottomWithLine.width, + stroke: model.style.Section.bottomWithLine.defaultColor + } + }); + this.add(this.bottomWithSection); + this.bottomWithSection.hide(); + } } } setStyle(styles) { - this.eachChild((child) => { - if (child.setStyle && child.isLine) { - child.setStyle(styles); - } - }); + // this.eachChild((child) => { + // if (child.setStyle && child.isLine) { + // child.setStyle(styles); + // } + // }); + this.section.setStyle(styles); } setZleve(lev) { - this.eachChild((child) => { - if (child.setStyle && child.isLine) { - child.attr('z', lev); - } - }); + // this.eachChild((child) => { + // if (child.setStyle && child.isLine) { + // child.attr('z', lev); + // } + // }); + this.section.attr('z', lev); } hide() { @@ -101,15 +145,22 @@ export default class ELines extends Group { animateStyle(loop, animates) { if (animates && animates.length) { - this.eachChild((child) => { - if (child.animateStyle && child.isLine) { - let an = child.animateStyle(loop); - animates.forEach(elem => { - an = an.when(elem.time, elem.styles); - }); - an.start(); - } - }); + // this.eachChild((child) => { + // if (child.animateStyle && child.isLine) { + // let an = child.animateStyle(loop); + // animates.forEach(elem => { + // an = an.when(elem.time, elem.styles); + // }); + // an.start(); + // } + // }); + if (this.section.animateStyle && this.section.isLine) { + let an = this.section.animateStyle(loop); + animates.forEach(elem => { + an = an.when(elem.item, elem.styles); + }); + an.start(); + } } }