diff --git a/src/jmapNew/shape/graph/Train/index.js b/src/jmapNew/shape/graph/Train/index.js index ca28c0d7f..3e6fd7864 100644 --- a/src/jmapNew/shape/graph/Train/index.js +++ b/src/jmapNew/shape/graph/Train/index.js @@ -248,16 +248,26 @@ export default class Train extends Group { } } // 设置列车停止方向类型 - setDirectionStopType(right) { + setDirectionStopType(right, flag) { if (this.style.Train.trainStatusStyle.directionStopType.length > 0) { this.style.Train.trainStatusStyle.directionStopType.forEach((item) => { if (right == item.type) { if (this.style.Train.trainHead.directionStopType == 'special') { - this.trainL && this.trainL.setArrowShow(item.lineLShow); - this.trainR && this.trainR.setArrowShow(item.lineRShow); + if (flag) { + this.trainL && this.trainL.setArrowShow(!item.lineLShow); + this.trainR && this.trainR.setArrowShow(!item.lineRShow); + } else { + this.trainL && this.trainL.setArrowShow(item.lineLShow); + this.trainR && this.trainR.setArrowShow(item.lineRShow); + } } else { - this.trainL && this.trainL.setLineShow(item.lineLShow); - this.trainR && this.trainR.setLineShow(item.lineRShow); + if (flag) { + this.trainL && this.trainL.setLineShow(!item.lineLShow); + this.trainR && this.trainR.setLineShow(!item.lineRShow); + } else { + this.trainL && this.trainL.setLineShow(item.lineLShow); + this.trainR && this.trainR.setLineShow(item.lineRShow); + } this.triangle && this.triangle.setStopShow(true); // 停车 } return true; @@ -268,7 +278,7 @@ export default class Train extends Group { // 设置运行状态 setRunStatus(status, flag) { if (status) { - this.setDirectionStopType(this.model.right); // 设置运行方向状态类型 + this.setDirectionStopType(this.model.right, flag); // 设置运行方向状态类型 } else { this.setDirectionType(this.model.right, flag); // 设置运行方向状态类型 }