diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 6dd0bff81..34d802344 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -242,7 +242,7 @@ class SkinCode extends defaultStyle { detainCar: { // 扣车 text: '扣', // 扣车显示内容 position: -1, // 扣车方向 - offset: {x: -8, y: -20}, // 扣车偏移量 + offset: {x: -8, y: 13}, // 扣车偏移量 trainColor: '#FFFF00', // 车站扣车颜色 centerTrainColor: '#C0C0C0', // 中心扣车颜色 andCenterTrainColor: '#C0C0C0', // 车站+中心扣车颜色 diff --git a/src/jmapNew/shape/StationStand/EDetain.js b/src/jmapNew/shape/StationStand/EDetain.js index 86cbb0d65..1fbd77f74 100644 --- a/src/jmapNew/shape/StationStand/EDetain.js +++ b/src/jmapNew/shape/StationStand/EDetain.js @@ -42,6 +42,7 @@ class EDetain extends Group { position = -model.width / 4 - gagX; } } + console.log(textName); this.detain = new Text({ zlevel: model.zlevel, z: model.z, @@ -90,14 +91,13 @@ class EDetain extends Group { this.detain.hide(); } - show() { - if (this.model.style.StationStand.common.special) { - this.detain.setStyle('text', 'H'); + show(nameText) { + if (this.model.style.StationStand.common.special && nameText) { + this.detain.setStyle('text', nameText); } else { - this.create('H'); + this.create(); this.detain.show(); } - } } diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index 426ba30bc..49a9e7aae 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -416,19 +416,31 @@ class StationStand extends Group { /** 车站扣车*/ standDetainTrain() { - this.detain && this.detain.show(); + if (this.style.StationStand.common.special) { + this.detain && this.detain.show('H'); + } else { + this.detain && this.detain.show(); + } this.detain && this.detain.setColor(this.style.StationStand.detainCar.detainTrainTextColor); } /** 中心扣车*/ centerDetainTrain() { - this.detain && this.detain.show(); + if (this.style.StationStand.common.special) { + this.detain && this.detain.show('H'); + } else { + this.detain && this.detain.show(); + } this.detain && this.detain.setColor(this.style.StationStand.detainCar.centerTrainColor); } /** 中心+车站扣车*/ standAndCenterDetainTrain() { - this.detain && this.detain.show(); + if (this.style.StationStand.common.special) { + this.detain && this.detain.show('H'); + } else { + this.detain && this.detain.show(); + } this.detain && this.detain.setColor(this.style.StationStand.detainCar.andCenterTrainColor); }