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/haerbin_01/menus/dialog/speedCmdControl.vue b/src/jmapNew/theme/haerbin_01/menus/dialog/speedCmdControl.vue index 6089fe06f..6553f06cd 100644 --- a/src/jmapNew/theme/haerbin_01/menus/dialog/speedCmdControl.vue +++ b/src/jmapNew/theme/haerbin_01/menus/dialog/speedCmdControl.vue @@ -25,7 +25,8 @@ - + + diff --git a/src/jmapNew/theme/ningbo_01/planConvert.js b/src/jmapNew/theme/ningbo_01/planConvert.js index b1c9d3902..cd986201b 100644 --- a/src/jmapNew/theme/ningbo_01/planConvert.js +++ b/src/jmapNew/theme/ningbo_01/planConvert.js @@ -119,7 +119,6 @@ export default { /** 将后台数据解析成图表*/ convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) { var models = []; - if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) { /** 按服务遍历数据*/ data.serviceNumberDataList.forEach((service) => { @@ -203,7 +202,6 @@ export default { if (!runPlanData[elem.serviceNumber]) { /** 创建一个新服务号标记*/ runPlanData[elem.serviceNumber] = {}; - /** 不存在此服务号,则需要创建一条新的line*/ series.push(createSeriesModel({ zlevel: 1, diff --git a/src/store/modules/runplan.js b/src/store/modules/runplan.js index 491789fa0..4886c71aa 100644 --- a/src/store/modules/runplan.js +++ b/src/store/modules/runplan.js @@ -12,7 +12,8 @@ const runPlan = { selected: {}, // 选择的对象 width: 800, // 运行图canvas 容器 宽度 height: 600, // 运行图canvas 容器 高度 - refreshCount: 0 // 刷新页面重新加载 + refreshCount: 0, // 刷新页面重新加载 + setInitialPlanData: {} // 运行图原始数据 }, getters: { stations: (state) => { @@ -61,6 +62,19 @@ const runPlan = { setStations: (state, stations) => { state.stations = stations; }, + setInitialPlanData: (state, data) => { + state.initialPlanData = {}; + if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) { + const serviceList = data.serviceNumberDataList; + serviceList.forEach((service, i) => { + const trainList = service.tripNumberDataList; + state.initialPlanData[service.serviceNumber] = { oldIndex: i, serviceNumber: service.serviceNumber, backup: service.backup, trainMap: {} }; + trainList.forEach((train, j) => { + state.initialPlanData[service.serviceNumber].trainMap[`${train.directionCode}${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList }; + }); + }); + } + }, setPlanData: (state, data) => { state.planData = data; state.editData = {}; @@ -119,6 +133,10 @@ const runPlan = { setPlanData: ({ commit }, data) => { commit('setPlanData', data); }, + /** 设置初始运行图数据 */ + setInitialPlanData: ({ commit }, data) => { + commit('setInitialPlanData', data); + }, /** 增加服务号*/ addserviceNumber: ({ commit }, serviceNumber) => { commit('addserviceNumber', serviceNumber); diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 7fbc857b4..1efba2242 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -25,6 +25,7 @@ function handle(state, data) { break; case 'Simulation_RunFact': // 仿真-列车实际到发车站消息 let runFactMsg = msg; + console.log(msg, '----------------'); if (runFactMsg.constructor !== Array ) { runFactMsg = [msg]; } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 39bbea8fe..506eafc22 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -8,7 +8,7 @@ export function getBaseUrl() { // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 - BASE_API = 'http://b29z135112.zicp.vip'; + // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 } else { diff --git a/src/views/newMap/displayNew/demon/runPlanView.vue b/src/views/newMap/displayNew/demon/runPlanView.vue index 9f7437404..8ac7d5f2d 100644 --- a/src/views/newMap/displayNew/demon/runPlanView.vue +++ b/src/views/newMap/displayNew/demon/runPlanView.vue @@ -154,7 +154,8 @@ absoluteTime: 2 * 3600, indexKmRangeMap: {}, runPlanData: {}, - dialogLoading: false + dialogLoading: false, + initialPlanData: [] }; }, computed: { @@ -188,6 +189,7 @@ mounted() { getPublishMapInfo(this.$route.query.mapId).then(res=>{ this.PlanConvert = this.$theme.loadPlanConvert(res.data.lineCode); + this.initialPlanData = this.$store.state.runPlan.planData; this.loadChartPage(); }); }, @@ -233,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)); @@ -252,11 +253,21 @@ reject(error); } }); - }, updateRunPlanData(data) { const stations = this.$store.state.runPlan.stations; const planData = this.$store.state.runPlan.planData; + const initialPlanData = this.$store.state.runPlan.initialPlanData; + if (data[0] && initialPlanData[data[0].serviceNumber]) { + Object.keys(initialPlanData[data[0].serviceNumber].trainMap).forEach(item => { + if (initialPlanData[data[0].serviceNumber].trainMap[item+''].tripNumber == data[0].tripNumber) { + data[0].directionCode = initialPlanData[data[0].serviceNumber].trainMap[item + ''].directionCode; + } + }); + } + 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/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index 6da3b9afc..0924614f7 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -111,6 +111,7 @@ export default { this.$store.dispatch('runPlan/setStations', response.data).then(() => { getEveryDayRunPlanNew(this.group).then(resp => { this.$store.dispatch('runPlan/setPlanData', resp.data); + this.$store.dispatch('runPlan/setInitialPlanData', resp.data); this.viewDisabled = false; }).catch(error => { this.$store.dispatch('runPlan/setPlanData', []); 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')); } }); },