From bb204dd72ab783c54d9d158142183198aafd5d56 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 6 Mar 2020 20:47:39 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=88=97=E8=BD=A6=20=E8=B7=B3=E5=81=9C=20?= =?UTF-8?q?=E6=89=A3=E8=BD=A6=20=E8=BD=A6=E9=97=A8=20=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/bejing_01.js | 13 ------ src/jmapNew/config/skinCode/chengdu_01.js | 27 +---------- src/jmapNew/config/skinCode/chengdu_03.js | 27 +---------- src/jmapNew/config/skinCode/ningbo_01.js | 35 ++------------ src/jmapNew/shape/Train/index.js | 56 +++++++++++++---------- 5 files changed, 38 insertions(+), 120 deletions(-) diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index a31ff309a..03e6c8f8d 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -632,24 +632,11 @@ class SkinCode extends defaultStyle { trainRColor: '#A0522D' } ], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM - runControlStatus: [ - { status: '01', hShow: false, sShow: false }, - { status: '02', hShow: true, sShow: false }, - { status: '03', hShow: false, sShow: true } - ], // 设置运行控制状态类型 01正常 02扣车 03停跳 - doorStatus: [ - {status: true, dShow: false}, - {status: false, dShow: true} - ], // 设置车门状态类型 true车门关闭且锁闭 communicationStatus: [ {status: 'CBTC', trainColor: '#725A64'}, {status: 'ITC', trainColor: '#C0C0C0'}, {status: 'IL', trainColor: '#C0C0C0'} ], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL - alarmStatus: [ - { status: '01', aShow: false }, - { status: '02', aShow: true } - ], // 设置报警状态 01不报警 02报警 serverNoType: [ { type: '01', showColor: '#FFFFFF' }, { type: '02', showColor: '#FFF000' } diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 93ae793ac..ead8d4f72 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -573,36 +573,11 @@ class SkinCode extends defaultStyle { trainRColor: '#A0522D' } ], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM - runControlStatus: [ - { - status: '01', - hShow: false, - sShow: false - }, - { - status: '02', - hShow: true, - sShow: false - }, - { - status: '03', - hShow: false, - sShow: true - } - ], // 设置运行控制状态类型 01正常 02扣车 03停跳 - doorStatus: [ - {status: true, dShow: false}, - {status: false, dShow: true} - ], // 设置车门状态类型 true车门关闭且锁闭 communicationStatus: [ {status: 'CBTC', trainColor: '#000099'}, {status: 'ITC', trainColor: '#747474'}, {status: 'IL', trainColor: '#747474'} - ], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL - alarmStatus: [ - {status: '01', aShow: false}, - {status: '02', aShow: true} - ] // 设置报警状态 01不报警 02报警 + ] // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL } }; } diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 72b5297d2..6dd0bff81 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -610,36 +610,11 @@ class SkinCode extends defaultStyle { trainRColor: '#FF0000' } ], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM - runControlStatus: [ - { - status: '01', - hShow: false, - sShow: false - }, - { - status: '02', - hShow: true, - sShow: false - }, - { - status: '03', - hShow: false, - sShow: true - } - ], // 设置运行控制状态类型 01正常 02扣车 03停跳 - doorStatus: [ - {status: true, dShow: false}, - {status: false, dShow: true} - ], // 设置车门状态类型 true车门关闭且锁闭 communicationStatus: [ {status: 'CBTC', trainColor: '#000099'}, {status: 'ITC', trainColor: '#747474'}, {status: 'IL', trainColor: '#747474'} - ], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL - alarmStatus: [ - {status: '01', aShow: false}, - {status: '02', aShow: true} - ] // 设置报警状态 01不报警 02报警 + ] // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL } }; } diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 48049fcd5..c1147d784 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -492,10 +492,10 @@ class SkinCode extends defaultStyle { lrPaddingHSDA: 3, // HSDA两边间隔 upPaddingHSDA: 4, // HSDA上边距离 trainHSDATextFontSize: 8, // 列车HDSA字号 - textHContent: '扣', // textH文本 - textSContent: '跳', // textS文本 - textDContent: '门', // textD文本 - textAContent: '警' // textA文本 + textHContent: 'H', // textH文本 + textSContent: 'S', // textS文本 + textDContent: 'D', // textD文本 + textAContent: 'A' // textA文本 }, trainNumber: { targetCodePrefix: '000', // 目的地码前缀 @@ -617,33 +617,8 @@ class SkinCode extends defaultStyle { // trainRColor: '#A0522D' // } ], // 列车运行模式对应车头颜色 ATO自动驾驶模式AM ATP监控下的人工驾驶模式CM 限制人工驾驶模式RM 非限制人工驾驶模式NRM - runControlStatus: [ - { - status: '01', - hShow: false, - sShow: false - }, - { - status: '02', - hShow: true, - sShow: false - }, - { - status: '03', - hShow: false, - sShow: true - } - ], // 设置运行控制状态类型 01正常 02扣车 03停跳 - doorStatus: [ - { status: true, dShow: false }, - { status: false, dShow: true } - ], // 设置车门状态类型 true车门关闭且锁闭 communicationStatus: [ - ], // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL - alarmStatus: [ - { status: '01', aShow: false }, - { status: '02', aShow: true } - ] // 设置报警状态 01不报警 02报警 + ] // 设置通信状态 cbtc级别CBTC 点式通信ITC 联锁级IL } }; } diff --git a/src/jmapNew/shape/Train/index.js b/src/jmapNew/shape/Train/index.js index 0bd0a63cc..71f8e42ee 100644 --- a/src/jmapNew/shape/Train/index.js +++ b/src/jmapNew/shape/Train/index.js @@ -71,7 +71,6 @@ export default class Train extends Group { directionType: model.directionType, directionCode: model.directionCode, sectionModel: model.sectionModel, - runControlStatus: model.runControlStatus, runStatus: model.runStatus, fontSize: this.fontSize, nameFormat: this.nameFormat, @@ -122,6 +121,8 @@ export default class Train extends Group { if (train.physicalCode && train.offsetp) { const data = train.physicalCode; const oldmodel = store.getters['map/getDeviceByCode'](data); + oldmodel.offsetp = train.offsetp; + oldmodel.right = train.right; let models = []; const model = deepAssign(oldmodel, {_type: 'Section'}); // 修改元素model models = [model]; @@ -252,27 +253,31 @@ export default class Train extends Group { }); } } - // 设置运行控制状态类型 - setRunControlStatus(status) { - if (this.style.Train.trainStatusStyle.runControlStatus.length > 0) { - this.style.Train.trainStatusStyle.runControlStatus.some((item) => { - if (status === item.status) { - this.trainB && this.trainB.setHShow(item.hShow); - this.trainB && this.trainB.setSShow(item.sShow); - return true; - } - }); + + // 设置扣车状态 + setHoldStatus(status) { + if (status) { + this.trainB && this.trainB.setHShow(true); + } else { + this.trainB && this.trainB.setHShow(false); } } + + // 设置跳停状态 + setJumpStatus(status) { + if (status) { + this.trainB && this.trainB.setSShow(true); + } else { + this.trainB && this.trainB.setSShow(false); + } + } + // 设置车门状态类型 setDoorStatus(status) { - if (this.style.Train.trainStatusStyle.doorStatus.length > 0) { - this.style.Train.trainStatusStyle.doorStatus.some((item) => { - if (status === item.status) { - this.trainB && this.trainB.setDShow(item.dShow); - return true; - } - }); + if (status) { + this.trainB && this.trainB.setDShow(true); + } else { + this.trainB && this.trainB.setDShow(false); } } // 设置通信状态类型 @@ -288,13 +293,10 @@ export default class Train extends Group { } // 设置报警状态 setAlarmStatus(status) { - if (this.style.Train.trainStatusStyle.alarmStatus.length > 0) { - this.style.Train.trainStatusStyle.alarmStatus.some((item) => { - if (status === item.status) { - this.trainB && this.trainB.setAShow(item.aShow); - return true; - } - }); + if (status) { + this.trainB && this.trainB.setAShow(true); + } else { + this.trainB && this.trainB.setAShow(false); } } setTrainTypeStatus(type) { @@ -323,11 +325,15 @@ export default class Train extends Group { this.setCommunicationStatus(model.runLevel); // this.setTrainTypeStatus(model.type); 配合早晚点设置 this.setDoorStatus(model.doorCloseLock); + this.setAlarmStatus(model.alarmStatus); + this.setHoldStatus(model.hold); + this.setJumpStatus(model.jump); const style = this.style; if (style.Section.trainPosition.display) { this.updateSection(); } + } // let points = []; // if (model) { From e1fccdeb2aa4761dc7ae9aa8651a960a87940a0c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 6 Mar 2020 20:57:24 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Train/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jmapNew/shape/Train/index.js b/src/jmapNew/shape/Train/index.js index 71f8e42ee..82d26edd4 100644 --- a/src/jmapNew/shape/Train/index.js +++ b/src/jmapNew/shape/Train/index.js @@ -274,8 +274,12 @@ export default class Train extends Group { // 设置车门状态类型 setDoorStatus(status) { - if (status) { - this.trainB && this.trainB.setDShow(true); + if (status != undefined) { + if (status) { + this.trainB && this.trainB.setDShow(false); + } else { + this.trainB && this.trainB.setDShow(true); + } } else { this.trainB && this.trainB.setDShow(false); } From f3d152bdfc6f114a6f863641e7d0d78c77fbc2a8 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 6 Mar 2020 21:26:58 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Train/EMouse.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/jmapNew/shape/Train/EMouse.js b/src/jmapNew/shape/Train/EMouse.js index b4d8d7211..e67c3e42c 100644 --- a/src/jmapNew/shape/Train/EMouse.js +++ b/src/jmapNew/shape/Train/EMouse.js @@ -27,9 +27,26 @@ class EMouse extends Group { } let text = ''; if (LangStorage.getLang() == 'en') { - text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.runControlStatus == '01' ? 'Normal' : this.device.model.runControlStatus == '03' ? 'Skip to continue moving' : 'Detained'}\n Stationary: ${this.device.model.runStatus == '02' ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`; + text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n + Train Trip No.: ${this.device.model.tripNumber}\n + Destination: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n + Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n + Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n + Crew No.: \n Start Station: \n Terminal Station: \n + Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n + Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n + Detained: ${!this.device.model.hold ? 'Normal' : 'Detained'}\n + \n 跳停状态: ${!this.device.model.jump ? 'Normal' : 'Skip to continue moving'} + Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n + Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`; } else { - text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`; + text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber} + \n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber} + \n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'} + \n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''} + \n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ !this.device.model.hold ? '正常' : '扣车'} + \n 跳停状态: ${!this.device.model.jump ? '正常' : '跳停'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'} + \n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`; } // 文字描述 this.arrowText = new Text({ From 157a505e72ed9e5f90e3026b177420cd9ff9bf21 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 6 Mar 2020 21:31:07 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Train/EMouse.js | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/jmapNew/shape/Train/EMouse.js b/src/jmapNew/shape/Train/EMouse.js index e67c3e42c..f0a1ab761 100644 --- a/src/jmapNew/shape/Train/EMouse.js +++ b/src/jmapNew/shape/Train/EMouse.js @@ -27,26 +27,9 @@ class EMouse extends Group { } let text = ''; if (LangStorage.getLang() == 'en') { - text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n - Train Trip No.: ${this.device.model.tripNumber}\n - Destination: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n - Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n - Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n - Crew No.: \n Start Station: \n Terminal Station: \n - Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n - Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n - Detained: ${!this.device.model.hold ? 'Normal' : 'Detained'}\n - \n 跳停状态: ${!this.device.model.jump ? 'Normal' : 'Skip to continue moving'} - Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n - Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`; + text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${this.device.model.directionType == '02' ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${!this.device.model.hold ? 'Normal' : 'Detained'}\n \n 跳停状态: ${!this.device.model.jump ? 'Normal' : 'Skip to continue moving'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`; } else { - text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber} - \n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber} - \n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'} - \n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''} - \n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ !this.device.model.hold ? '正常' : '扣车'} - \n 跳停状态: ${!this.device.model.jump ? '正常' : '跳停'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'} - \n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`; + text = `列车类型: ${trainType} \n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ !this.device.model.hold ? '正常' : '扣车'}\n 跳停状态: ${!this.device.model.jump ? '正常' : '跳停'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`; } // 文字描述 this.arrowText = new Text({ From a1416b9a23c281f1aa22e8a3453b79140b9c0d47 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Sat, 7 Mar 2020 11:05:38 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=88=E5=B0=94?= =?UTF-8?q?=E6=BB=A8=E7=BA=BF=E8=B7=AF=E6=89=A3=E8=BD=A6=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/chengdu_03.js | 2 +- src/jmapNew/shape/StationStand/EDetain.js | 10 +++++----- src/jmapNew/shape/StationStand/index.js | 18 +++++++++++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) 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); }