From 3fe9ffd4514926d8feb23c401429e5125df40051 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 19 Aug 2019 13:21:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=88=97?= =?UTF-8?q?=E8=BD=A6=E4=BF=A1=E6=81=AF=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BA=BA?= =?UTF-8?q?=E5=B7=A5=E8=BD=A6=E6=98=BE=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmap/config/skinCode/bejing_01.js | 12 +++++++++++- src/jmap/config/skinCode/chengdu_03.js | 8 +++++++- src/jmap/config/skinCode/fuzhou_01.js | 4 ++++ src/jmap/shape/Train/EMouse.js | 9 ++++++++- src/jmap/shape/Train/TrainBody.js | 12 +----------- src/jmap/shape/Train/index.js | 9 +++++++++ 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/jmap/config/skinCode/bejing_01.js b/src/jmap/config/skinCode/bejing_01.js index 4b03834b3..04744768b 100644 --- a/src/jmap/config/skinCode/bejing_01.js +++ b/src/jmap/config/skinCode/bejing_01.js @@ -407,7 +407,17 @@ class SkinCode extends defaultStyle { trainBody: { trainBodyLineWidth: 0.1, // 车身line宽 changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 - specialTrainType: [], // 特殊列车类型需设置显示格式 + specialTrainType: [ + { + type: '03', + serviceNumber: 'M0', + nameFormat: 'serviceNumber:groupNumber' + }, + { + type: '02', + nameFormat: 'targetCode:groupNumber' + } + ], // 特殊列车类型需设置显示格式 lrPadding: 4, // 两边间隔 upPadding: 4, // 上边距离 trainBodyFillColor: '#725A64', // 列车车身填充颜色 diff --git a/src/jmap/config/skinCode/chengdu_03.js b/src/jmap/config/skinCode/chengdu_03.js index c795b3cb1..e830934da 100644 --- a/src/jmap/config/skinCode/chengdu_03.js +++ b/src/jmap/config/skinCode/chengdu_03.js @@ -369,7 +369,13 @@ class SkinCode extends defaultStyle { trainBody: { trainBodyLineWidth: 1, // 车身line宽 changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 - specialTrainType: [], // 特殊列车类型需设置显示格式 + specialTrainType: [ + { + type: '03', + serviceNumber: '---', + nameFormat: 'groupNumber:serviceNumber' + } + ], // 特殊列车类型需设置显示格式 lrPadding: 4, // 两边间隔 upPadding: 4, // 上边距离 trainBodyFillColor: '#000099', // 列车车身填充颜色 diff --git a/src/jmap/config/skinCode/fuzhou_01.js b/src/jmap/config/skinCode/fuzhou_01.js index f5233389e..5d813cb5c 100644 --- a/src/jmap/config/skinCode/fuzhou_01.js +++ b/src/jmap/config/skinCode/fuzhou_01.js @@ -320,6 +320,10 @@ class SkinCode extends defaultStyle { type: '03', serviceNumber: 'MM', nameFormat: 'serviceNumber:groupNumber' + }, + { + type: '02', + nameFormat: 'targetCode:groupNumber' } ], // 特殊列车类型需设置显示格式 lrPadding: 1, // 两边间隔 diff --git a/src/jmap/shape/Train/EMouse.js b/src/jmap/shape/Train/EMouse.js index e8cb3b4be..a382a64b8 100644 --- a/src/jmap/shape/Train/EMouse.js +++ b/src/jmap/shape/Train/EMouse.js @@ -17,6 +17,13 @@ class EMouse extends Group { case '05': destinationText = '严重晚点'; break; default: destinationText = '未知'; break; } + let trainType = ''; + switch (this.device.model.type) { + case '01': trainType = '计划车'; break; + case '02': trainType = '头码车'; break; + case '03': trainType = '人工车'; break; + default: trainType = '未知'; break; + } // 文字描述 this.arrowText = new Text({ zlevel: this.device.model.zlevel, @@ -24,7 +31,7 @@ class EMouse extends Group { style: { x: this.device.model.point.x + 50, y: this.device.model.point.y + 25, - text: `列车类型: 计划车\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.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`, textFill: '#000', textAlign: 'letf', textFont: 10 + 'px consolas', diff --git a/src/jmap/shape/Train/TrainBody.js b/src/jmap/shape/Train/TrainBody.js index de2e42324..bc9534d8f 100644 --- a/src/jmap/shape/Train/TrainBody.js +++ b/src/jmap/shape/Train/TrainBody.js @@ -96,7 +96,7 @@ export default class TrainBody extends Group { textAlign: 'middle', textVerticalAlign: 'top' }) : ''; - let serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号) + const serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号) const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode ?(model.directionCode||style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber) :model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号 @@ -155,16 +155,6 @@ export default class TrainBody extends Group { textAlign: 'left', textVerticalAlign: 'top' }); - // 根据列车类型设置显示格式 - if ( style.Train.trainBody.specialTrainType.length > 0) { - style.Train.trainBody.specialTrainType.some((item) =>{ - if (model.type === item.type) { - serviceNumber = item.serviceNumber; - this.nameFormat = item.nameFormat; - return true; - } - }); - } this.formatChangePosition(model, style); this.add(this.trainBodyBox); if (style.Train.common.haveTextHSDA) { diff --git a/src/jmap/shape/Train/index.js b/src/jmap/shape/Train/index.js index 5ee1e3417..b1e8c1413 100644 --- a/src/jmap/shape/Train/index.js +++ b/src/jmap/shape/Train/index.js @@ -19,6 +19,15 @@ export default class Train extends Group { this.fontSize = style.Train.common.useSelfText?style.Train.common.nameFontSize || style.Train.common.trainTextFontSize:model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize; this.newScale = this.fontSize / style.Train.common.trainTextFontSize; this.nameFormat = style.Train.common.useSelfFormat?style.Train.trainBody.trainNameFormat:model.nameFormat || style.Train.trainBody.trainNameFormat; + if ( style.Train.trainBody.specialTrainType.length > 0) { + style.Train.trainBody.specialTrainType.some((item) =>{ + if (model.type === item.type) { + this.nameFormat = item.nameFormat; + model.serviceNumber = item.serviceNumber?item.serviceNumber : model.serviceNumber; + return true; + } + }); + } this.create(); this.setState(model); } From a669d093b150577fcec75fb19c24dd6b1dd91958 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 19 Aug 2019 13:27:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=85=A8=E5=B1=80loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/demonstration/detail/index.vue | 1 - src/views/exam/detail/examDetail.vue | 1 - src/views/lesson/trainingmanage/index.vue | 7 ------- 3 files changed, 9 deletions(-) diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 12b2f8f4e..f76309737 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -291,7 +291,6 @@ export default { this.$router.push({ path: `${UrlConfig.display}/demon`, query: query }); launchFullscreen(); }).catch(error => { - this.loading.close(); this.$messageBox(`创建仿真失败: ${error.message}`); }); }, diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue index 4e786ed21..9d2f354ba 100644 --- a/src/views/exam/detail/examDetail.vue +++ b/src/views/exam/detail/examDetail.vue @@ -180,7 +180,6 @@ export default { await this.$store.dispatch('exam/setTotalTime', this.userExam.duration); await this.$store.dispatch('trainingList/setTrainingList', list); } catch (error) { - this.loading.close(); // 判断是否有考试权限,如果没有权限则跳到购买页面,否则报错 if (error.code === 500004) { this.$confirm('无此课程的考试权限,请前往购买!', '提示', { diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue index 0b35d655e..1a2cbcce8 100644 --- a/src/views/lesson/trainingmanage/index.vue +++ b/src/views/lesson/trainingmanage/index.vue @@ -258,12 +258,6 @@ export default { this.$refs.draftTrain.show({ event: '03', title: '删除自动生成实训' }); }, demoDisplay(index, node) { - this.loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); trainingNotify({ trainingId: node.id }).then(resp => { /** 区分演示和正式,需要在演示时设置lessonId为0*/ const query = { group: resp.data, trainingId: node.id, lessonId: 0 }; @@ -271,7 +265,6 @@ export default { launchFullscreen(); }).catch(error => { this.$messageBox(`创建仿真失败: ${error.message}`); - this.loading.close(); }); },