From d5539a986b402aa1af11a93b49f72f3f202a3778 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Fri, 28 Feb 2020 11:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E8=AE=A1=E5=88=92=E8=A1=8C=E8=BD=A6?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 1abad25) --- src/i18n/langs/en/error.js | 9 ++++++++- src/i18n/langs/zh/error.js | 9 ++++++++- src/jmapNew/theme/beijing_01/planConvert.js | 16 ++++++++-------- src/jmapNew/theme/chengdu_03/planConvert.js | 16 ++++++++-------- src/jmapNew/theme/ningbo_01/planConvert.js | 16 ++++++++-------- src/utils/baseUrl.js | 2 +- .../newMap/displayNew/demon/runPlanView.vue | 5 +++-- src/views/newMap/displayNew/menuDemon.vue | 14 ++++++++++++++ src/views/newMap/displayNew/menuScript.vue | 14 ++++++++++++++ src/views/newMap/jointTrainingNew/menuDemon.vue | 14 ++++++++++++++ 10 files changed, 86 insertions(+), 29 deletions(-) diff --git a/src/i18n/langs/en/error.js b/src/i18n/langs/en/error.js index 280bc3515..0936ed8b0 100644 --- a/src/i18n/langs/en/error.js +++ b/src/i18n/langs/en/error.js @@ -108,5 +108,12 @@ export default { getRealDeviceFailed: 'Failed to get real device failed', mapDataError: 'Map data error', runningChartDataError: 'Running chart data error', - runningChartIsNotLoaded: 'Running chart is not loaded' + runningChartIsNotLoaded: 'Running chart is not loaded', + runningDataError: 'Running data error', + systemError: 'System error', + simulationDoesNotExist: 'Simulation does not exist', + simulationOperationIsNotDefined: 'The simulation operation is not defined', + simulationOperationFailed: 'The simulation operation failed', + operationConflict: 'Operation conflict', + simulationOperationProcessingMethodNotFound: 'Simulation operation processing method not found' }; diff --git a/src/i18n/langs/zh/error.js b/src/i18n/langs/zh/error.js index 266f43af4..c9f694983 100644 --- a/src/i18n/langs/zh/error.js +++ b/src/i18n/langs/zh/error.js @@ -108,5 +108,12 @@ export default { getRealDeviceFailed: '获取真实设备失败!', mapDataError: '地图数据错误', runningChartDataError: '运行图数据错误', - runningChartIsNotLoaded: '运行图未加载' + runningChartIsNotLoaded: '运行图未加载', + runningDataError: '运行数据错误', + systemError: '系统错误', + simulationDoesNotExist: '仿真不存在', + simulationOperationIsNotDefined: '仿真操做未定义', + simulationOperationFailed: '仿真操做执行失败', + operationConflict: '操做冲突', + simulationOperationProcessingMethodNotFound: '仿真操做处理方法未找到' }; diff --git a/src/jmapNew/theme/beijing_01/planConvert.js b/src/jmapNew/theme/beijing_01/planConvert.js index f105f3c41..dfbd15bb6 100644 --- a/src/jmapNew/theme/beijing_01/planConvert.js +++ b/src/jmapNew/theme/beijing_01/planConvert.js @@ -113,7 +113,7 @@ export default { pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; pointdata.directionCode = train.directionCode; - pointdata.coord = [train.stationTimeList[1].secondTime || train.stationTimeList[1].second, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; + pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ opt.markPointData.push(createMartPoint(pointdata)); @@ -125,10 +125,10 @@ export default { train.stationTimeList.forEach((elem, index) => { idx = index; if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode || - index == train.stationTimeList.length - 2 && (train.stationTimeList[index].secondTime || train.stationTimeList[index].second) != (train.stationTimeList[index + 1].secondTime|| train.stationTimeList[index + 1].secondTime) || + index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime || index > 0 && index < train.stationTimeList.length - 1) { const aa = `${train.directionCode}${train.tripNumber}`; - opt.data.push([elem.secondTime || elem.second, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); + opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); } }); @@ -138,8 +138,8 @@ export default { nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1]; num = this.computedReentryNumber(train.tripNumber); const aa = `${train.directionCode}${train.tripNumber}`; - opt.data.push([lastPoint.secondTime || lastPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]); - opt.data.push([nextPoint.secondTime || nextPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]); + opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]); + opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]); } /** 如果是备用车,按车次添加线*/ @@ -201,21 +201,21 @@ export default { runPlanData[elem.serviceNumber][elem.tripNumber].push(elem); runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => { - return parseInt(a.secondTime || a.second) - parseInt(b.secondTime || b.second); + return parseInt(a.secondTime) - parseInt(b.secondTime); }); /** 如果此记录车组号的数据为第一条时,则打上标签*/ if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { serie.markPoint.data.push(createMartPoint({ directionCode: elem.directionCode, - coord: [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], + coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`, color: lineStyle.color || '#000' })); } /** 计算折返点*/ - var nextPoint = [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode]; + var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode]; if (serie.data.length > 0) { var lastPoint = serie.data[serie.data.length - 1]; if (lastPoint[2] !== nextPoint[2]) { diff --git a/src/jmapNew/theme/chengdu_03/planConvert.js b/src/jmapNew/theme/chengdu_03/planConvert.js index 2834ae7a8..495dc4e68 100644 --- a/src/jmapNew/theme/chengdu_03/planConvert.js +++ b/src/jmapNew/theme/chengdu_03/planConvert.js @@ -93,7 +93,7 @@ export default { pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; pointdata.directionCode = train.directionCode; - pointdata.coord = [train.stationTimeList[1].secondTime || train.stationTimeList[1].second, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; + pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ opt.markPointData.push(createMartPoint(pointdata)); @@ -105,10 +105,10 @@ export default { train.stationTimeList.forEach((elem, index) => { idx = index; if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode || - index == train.stationTimeList.length - 2 && (train.stationTimeList[index].secondTime || train.stationTimeList[index].second) != (train.stationTimeList[index + 1].secondTime || train.stationTimeList[index + 1].second) || + index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime || index > 0 && index < train.stationTimeList.length - 1) { const aa = `${train.directionCode}${train.tripNumber}`; - opt.data.push([elem.secondTime || elem.second, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); + opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); } }); @@ -118,8 +118,8 @@ export default { nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1]; num = this.computedReentryNumber(train.tripNumber); const aa = `${train.directionCode}${train.tripNumber}`; - opt.data.push([lastPoint.secondTime || lastPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]); - opt.data.push([nextPoint.secondTime || nextPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]); + opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]); + opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]); } /** 如果是备用车,按车次添加线*/ @@ -179,21 +179,21 @@ export default { runPlanData[elem.serviceNumber][elem.tripNumber].push(elem); runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => { - return parseInt(a.secondTime || a.second) - parseInt(b.secondTime || b.second); + return parseInt(a.secondTime) - parseInt(b.secondTime); }); /** 如果此记录车组号的数据为第一条时,则打上标签*/ if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { serie.markPoint.data.push(createMartPoint({ directionCode: elem.directionCode, - coord: [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], + coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`, color: lineStyle.color || '#000' })); } /** 计算折返点*/ - var nextPoint = [parseInt(elem.secondTime || elem.second), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode]; + var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode]; if (serie.data.length > 0) { var lastPoint = serie.data[serie.data.length - 1]; if (lastPoint[2] !== nextPoint[2]) { diff --git a/src/jmapNew/theme/ningbo_01/planConvert.js b/src/jmapNew/theme/ningbo_01/planConvert.js index 84a0e00d3..cd986201b 100644 --- a/src/jmapNew/theme/ningbo_01/planConvert.js +++ b/src/jmapNew/theme/ningbo_01/planConvert.js @@ -138,7 +138,7 @@ export default { pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; pointdata.directionCode = train.directionCode; - pointdata.coord = [train.stationTimeList[1].secondTime || train.stationTimeList[1].second, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; + pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ opt.markPointData.push(createMartPoint(pointdata)); @@ -150,10 +150,10 @@ export default { train.stationTimeList.forEach((elem, index) => { idx = index; if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode || - index == train.stationTimeList.length - 2 && (train.stationTimeList[index].second||train.stationTimeList[index].secondTime) != (train.stationTimeList[index + 1].second || train.stationTimeList[index + 1].secondTime) || + index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime || index > 0 && index < train.stationTimeList.length - 1) { const aa = `${train.directionCode}${train.tripNumber}`; - opt.data.push([elem.secondTime || elem.second, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); + opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); } }); @@ -162,8 +162,8 @@ export default { lastPoint = train.stationTimeList[idx - 1]; nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1]; num = this.computedReentryNumber(train.tripNumber); - opt.data.push([lastPoint.secondTime || lastPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode]); - opt.data.push([nextPoint.secondTime || nextPoint.second, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode]); + opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode]); + opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode]); } /** 如果是备用车,按车次添加线*/ @@ -222,21 +222,21 @@ export default { runPlanData[elem.serviceNumber][elem.tripNumber].push(elem); runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => { - return parseInt(a.second || a.secondTime) - parseInt(b.second || b.secondTime); + return parseInt(a.secondTime) - parseInt(b.secondTime); }); /** 如果此记录车组号的数据为第一条时,则打上标签*/ if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { serie.markPoint.data.push(createMartPoint({ directionCode: elem.directionCode, - coord: [parseInt(elem.second || elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], + coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`, color: lineStyle.color || '#000' })); } /** 计算折返点*/ - var nextPoint = [parseInt(elem.second || elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode]; + var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode]; if (serie.data.length > 0) { var lastPoint = serie.data[serie.data.length - 1]; if (lastPoint[2] !== nextPoint[2]) { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 93d80dbd2..506eafc22 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,7 +3,7 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 diff --git a/src/views/newMap/displayNew/demon/runPlanView.vue b/src/views/newMap/displayNew/demon/runPlanView.vue index 77e5df00d..8ac7d5f2d 100644 --- a/src/views/newMap/displayNew/demon/runPlanView.vue +++ b/src/views/newMap/displayNew/demon/runPlanView.vue @@ -235,7 +235,6 @@ if (this.myChart && this.myChart.isDisposed) { this.myChart.clear(); } - let startValue = 3600 + this.PlanConvert.TranslationTime; const offsetTime = 3600; const initTime = toTimeStamp(formatDuring(this.$store.state.training.initTime)); @@ -254,7 +253,6 @@ reject(error); } }); - }, updateRunPlanData(data) { const stations = this.$store.state.runPlan.stations; @@ -267,6 +265,9 @@ } }); } + if (data[0]) { + data[0].secondTime = data[0].second; + } this.series = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap, planData, this.series, { color: '#FF00DE', width: 0.5 } ); diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 85d6c5219..02eb77f64 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -173,6 +173,20 @@ export default { this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed')); } else if (error.code == '5003') { this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '5004') { + this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '5000') { + this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4000') { + this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4001') { + this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4002') { + this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4003') { + this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4004') { + this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed')); } }); }, diff --git a/src/views/newMap/displayNew/menuScript.vue b/src/views/newMap/displayNew/menuScript.vue index ea9551efa..9ee7c62c3 100644 --- a/src/views/newMap/displayNew/menuScript.vue +++ b/src/views/newMap/displayNew/menuScript.vue @@ -114,6 +114,20 @@ export default { this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed')); } else if (error.code == '5003') { this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '5004') { + this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '5000') { + this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4000') { + this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4001') { + this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4002') { + this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4003') { + this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4004') { + this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed')); } }); }, diff --git a/src/views/newMap/jointTrainingNew/menuDemon.vue b/src/views/newMap/jointTrainingNew/menuDemon.vue index 94bd72bea..c3e3fdc82 100644 --- a/src/views/newMap/jointTrainingNew/menuDemon.vue +++ b/src/views/newMap/jointTrainingNew/menuDemon.vue @@ -296,6 +296,20 @@ export default { this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed')); } else if (error.code == '5003') { this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '5004') { + this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '5000') { + this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4000') { + this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4001') { + this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4002') { + this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4003') { + this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed')); + } else if (error.code == '4004') { + this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed')); } }); },