diff --git a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue index d61298593..779ec9e13 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue @@ -371,6 +371,7 @@ export default { }, // 现地信号重开操作 reopenSignalByRoute(selectType) { + debugger; commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); diff --git a/src/jmapNew/theme/beijing_01/operationConfig.js b/src/jmapNew/theme/beijing_01/operationConfig.js index 2b3631bdd..9118fa170 100644 --- a/src/jmapNew/theme/beijing_01/operationConfig.js +++ b/src/jmapNew/theme/beijing_01/operationConfig.js @@ -491,7 +491,7 @@ export default { productTypes: ['01'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '3040', tip: '鼠标左键点击【信号重开】' }, - { deviceType: '04', orderNum: 2, operateCode: '3040', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'} + { deviceType: '04', orderNum: 2, operateCode: '304', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'} ] }, { @@ -505,7 +505,7 @@ export default { productTypes: ['01'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '3090', tip: '鼠标左键点击【自动进路】' }, - { deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'} + { deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'} ] }, { @@ -519,7 +519,7 @@ export default { productTypes: ['01'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '3090', tip: '鼠标左键点击【自动进路】' }, - { deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'} + { deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'} ] }, { @@ -533,7 +533,7 @@ export default { productTypes: ['01'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '3050', tip: '鼠标左键点击【总人解】' }, - { deviceType: '04', orderNum: 2, operateCode: '3050', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'} + { deviceType: '04', orderNum: 2, operateCode: '3050', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'} ] }, { @@ -547,7 +547,7 @@ export default { productTypes: ['01'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '2994', tip: '鼠标左键点击【总取消】' }, - { deviceType: '04', orderNum: 2, operateCode: '2994', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'} + { deviceType: '04', orderNum: 2, operateCode: '313', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'} ] }, { @@ -561,7 +561,7 @@ export default { productTypes: ['01'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '2994', tip: '鼠标左键点击【总取消】' }, - { deviceType: '04', orderNum: 2, operateCode: '2994', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'} + { deviceType: '04', orderNum: 2, operateCode: '303', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'} ] }, { @@ -575,8 +575,8 @@ export default { productTypes: ['01'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '3010', tip: '鼠标左键点击【排列进路】' }, - { deviceType: '04', orderNum: 2, operateCode: '3010', tip: '鼠标左键点击【始端信号机】', codeType:'SIGNAL'}, - { deviceType: '04', orderNum: 3, operateCode: '3010', tip: '鼠标左键点击【终端信号机】', codeType:'SIGNAL'} + { deviceType: '04', orderNum: 2, operateCode: '3010', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}, + { deviceType: '04', orderNum: 3, operateCode: '3010', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'} ] } // 自动折返 (暂时没有) diff --git a/src/jmapNew/theme/chengdu_01/planConvert.js b/src/jmapNew/theme/chengdu_01/planConvert.js index 6f5fd7145..fee0509e3 100644 --- a/src/jmapNew/theme/chengdu_01/planConvert.js +++ b/src/jmapNew/theme/chengdu_01/planConvert.js @@ -1,4 +1,4 @@ -import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; +import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; export default { /** 边缘高度*/ @@ -116,7 +116,7 @@ export default { pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ - opt.markPointData.push(createMartPoint(pointdata)); + opt.markPointData.push(createMartPointReverse(pointdata)); /** 创建服务号名称*/ opt.name = `${service.serviceNumber}`; } @@ -206,7 +206,7 @@ export default { /** 如果此记录车组号的数据为第一条时,则打上标签*/ if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { - serie.markPoint.data.push(createMartPoint({ + serie.markPoint.data.push(createMartPointReverse({ directionCode: elem.directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`, @@ -290,9 +290,9 @@ export default { /** 根据方向计算y折返偏移量*/ getYvalueByDirectionCode(defaultVlue, directionCode, num) { if (directionCode === '1') { - defaultVlue -= this.EdgeHeight / 2 * num; - } else if (directionCode === '2') { defaultVlue += this.EdgeHeight / 2 * num; + } else if (directionCode === '2') { + defaultVlue -= this.EdgeHeight / 2 * num; } return defaultVlue; diff --git a/src/jmapNew/theme/foshan_01/planConvert.js b/src/jmapNew/theme/foshan_01/planConvert.js index 4fffc5ab2..8e38f51f8 100644 --- a/src/jmapNew/theme/foshan_01/planConvert.js +++ b/src/jmapNew/theme/foshan_01/planConvert.js @@ -1,4 +1,4 @@ -import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; +import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; export default { /** 边缘高度*/ @@ -111,7 +111,7 @@ export default { pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ - opt.markPointData.push(createMartPoint(pointdata)); + opt.markPointData.push(createMartPointReverse(pointdata)); /** 创建服务号名称*/ opt.name = `${service.serviceNumber}`; } @@ -122,8 +122,8 @@ export default { if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode || 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, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); + const tripNumber = `${train.directionCode}${train.tripNumber}`; + opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, tripNumber]); } }); @@ -197,7 +197,7 @@ export default { /** 如果此记录车组号的数据为第一条时,则打上标签*/ if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { - serie.markPoint.data.push(createMartPoint({ + serie.markPoint.data.push(createMartPointReverse({ directionCode: elem.directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`, @@ -275,15 +275,16 @@ export default { /** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/ computedReentryNumber(code) { - return parseInt(code || 1) % 2 ? 1 : 2; + // return parseInt(code || 1) % 2 ? 1 : 2; + return 1; }, /** 根据方向计算y折返偏移量*/ getYvalueByDirectionCode(defaultVlue, directionCode, num) { if (directionCode === '1') { - defaultVlue -= this.EdgeHeight / 2 * num; - } else if (directionCode === '2') { defaultVlue += this.EdgeHeight / 2 * num; + } else if (directionCode === '2') { + defaultVlue -= this.EdgeHeight / 2 * num; } return defaultVlue; diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index 1158d3fb8..d25026f94 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -718,7 +718,7 @@ export const OperationEvent = { reopenSignal: { button: { operation: '3040', - domId: '_Tips-Signal-Reopen-Mbm' + domId: '_Tips-Signal-Reopen-Mbm{TOP}' }, menu: { operation: '304', diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 421ce686b..d53f5dcd0 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -190,6 +190,7 @@ const map = { recoverStepData: [], // 缓存恢复数据 seclectDeviceList: [], // 包围框选中元素列表 trainWindowSectionCode: '', // 选择车次窗所属区段code + flankProtectList: [], // 侧防列表 map: null, // 地图数据 dataZoom: {}, // 缩放位置 mapDevice: {}, // 解析后的地图数据 @@ -459,6 +460,9 @@ const map = { trainDetails: (state) => { return state.trainDetails; }, + flankProtectList: (state) => { + return state.flankProtectList; + }, mapDevice: (state) => { return state.mapDevice; }, @@ -722,6 +726,16 @@ const map = { }, setShowCentralizedStationNum: (state) => { state.showCentralizedStationNum++; + }, + setFlankProtectList: (state, data) => { + state.flankProtectList.push(data); + }, + delFlankProtectList: (state, data) => { + state.flankProtectList.forEach((item, index) => { + if (item.code == data.code) { + state.flankProtectList.splice(index, 1); + } + }); } }, @@ -894,6 +908,12 @@ const map = { }, setShowCentralizedStationNum: ({commit}) => { commit('setShowCentralizedStationNum'); + }, + setFlankProtectList: ({ commit }, data) => { + commit('setFlankProtectList', data); + }, + delFlankProtectList: ({ commit }, data) => { + commit('delFlankProtectList', data); } } }; diff --git a/src/utils/runPlan.js b/src/utils/runPlan.js index 32342e4e3..469585a83 100644 --- a/src/utils/runPlan.js +++ b/src/utils/runPlan.js @@ -3,7 +3,26 @@ import { timeFormat } from '@/utils/date'; /** 创建一个车次数据点*/ export function createMartPoint(opt) { - const rotate = opt.directionCode === '2' ? 45 : (opt.directionCode === '1' ? -45 : 0); + const rotate = opt.directionCode == '2' ? 45 : (opt.directionCode == '1' ? -45 : 0); + const position = opt.type ? 'insideBottomLeft' : 'insideTopLeft'; + return { + coord: opt.coord, + name: opt.name, + label: { + normal: { + rotate: rotate, + formatter: '{b}', + backgroundColor: 'rgb(242,242,242,0.1)', + color: 'black', + position: position + } + } + }; +} + +/** 创建一个车次数据点*/ +export function createMartPointReverse(opt) { + const rotate = opt.directionCode == '1' ? 45 : (opt.directionCode == '2' ? -45 : 0); const position = opt.type ? 'insideBottomLeft' : 'insideTopLeft'; return { coord: opt.coord, diff --git a/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/detail.vue b/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/detail.vue index 4db3c02ad..483d52cde 100644 --- a/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/detail.vue +++ b/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/detail.vue @@ -173,6 +173,7 @@ export default { // 删除 delFlankProtection(row.id).then(response => { this.$message.success(this.$t('map.successfullyDelete')); + this.$store.dispatch('map/delFlankProtectList', row); this.reloadTable(); }).catch(() => { this.$messageBox(this.$t('map.failDelete')); diff --git a/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/route.vue index 860e1e55a..879e8c0fd 100644 --- a/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/flankProtectOperate/route.vue @@ -315,7 +315,10 @@ export default { this.$refs.form.validate((valid) => { if (valid) { this.loading = true; - postFlankProtection(this.buildModel(setUID('flank'))).then(resp => { + const data = this.buildModel(setUID('flank')); + postFlankProtection(data).then(resp => { + const dataModel = JSON.parse(JSON.stringify(data)); + this.$store.dispatch('map/setFlankProtectList', dataModel); this.$message.success(this.$t('map.automaticSignalSuccessful')); this.loading = false; this.clear(); diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index 9321daa66..6b63c56a9 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -115,8 +115,8 @@ - - + + { - // elem.stationName = this.filterStation(elem.stationCode); - // }); + const res = await getFlankProtectionList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 }); + res.data.list.forEach(item => { + this.$store.dispatch('map/setFlankProtectList', item); + }); }, - // filterStation(code) { - // let name = ''; - // for (let i = 0; i < this.stationList.length; i++) { - // if (this.stationList[i].code == code) { - // name = this.stationList[i].name; - // return; - // } - - // } - // return name; - // }, swictchName(code) { let name = ''; if (code) { @@ -447,6 +435,7 @@ export default { this.addModel.mapId = this.mapInfo.id; this.addModel.routeSwitchList = []; this.addModel.routeFlankProtectionList = []; + this.addModel.flankProtectionList = []; this.addModel.overlapCode = ''; this.addModel.code = ''; this.addModel.conflictingSignalList = []; diff --git a/src/views/planMonitor/editTool/schedule.vue b/src/views/planMonitor/editTool/schedule.vue index 1cf5f88c4..396f87653 100644 --- a/src/views/planMonitor/editTool/schedule.vue +++ b/src/views/planMonitor/editTool/schedule.vue @@ -208,7 +208,8 @@ export default { ] }, absoluteTime: 2 * 3600, - indexKmRangeMap: {} + indexKmRangeMap: {}, + stationsObj: {} }; }, computed: { @@ -279,20 +280,20 @@ export default { const serviceNumber = this.$store.state.runPlan.selected.serviceNumber; let tripNumber = null; if (row) { - let data; + const data = []; tripNumber = row.tripNumber; const op = this.myChart.getOption(); op.series.forEach((item, index) => { switch (item.name) { case serviceNumber: { - const param = '\\[\\d*,\\d*,"Station_\\d*_[.\\d]*","' + tripNumber + '"\\]'; - const temp = JSON.stringify(item.data).match(new RegExp(param, 'g')); - data = JSON.parse('[' + temp.toString() + ']'); - // item.data.forEach(nor => { - // if (nor[3] == tripNumber) { - // data.push(nor); - // } - // }); + // const param = '\\[\\d*,\\d*,"Station_\\d*_[.\\d]*","' + tripNumber + '"\\]'; + // const temp = JSON.stringify(item.data).match(new RegExp(param, 'g')); + // data = JSON.parse('[' + temp.toString() + ']'); + item.data.forEach(nor => { + if (nor[3] == tripNumber) { + data.push(nor); + } + }); break; } case 'trainLabel': { @@ -479,6 +480,10 @@ export default { try { const stations = this.$store.state.runPlan.stations; const planData = this.$store.state.runPlan.planData; + this.stationsObj = {}; + stations.forEach(item => { + this.stationsObj[Math.floor(item.kmRange)] = item; + }); this.viewDisabled = true; @@ -591,13 +596,13 @@ export default { let data = ''; const arr = []; param.forEach(item => { - const station = this.stations[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' }; + const station = this.stationsObj[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' }; if (!arr.includes(`${item.data[0]}${item.data[1]}`)) { arr.push(`${item.data[0]}${item.data[1]}`); - if (this.$route.query.lineCode == '06') { + if (this.$route.query.lineCode == '06' || this.$route.query.lineCode == '08') { const list = [ `${this.$t('planMonitor.stationName')}${station.name}
`, - `${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km
`, + `${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} m
`, `${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}
`, `${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}`, `
` @@ -606,7 +611,7 @@ export default { } else { const list = [ `${this.$t('planMonitor.stationName')}${station.name}
`, - `${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km
`, + `${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} m
`, `${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}
`, `${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}(${item.data[3][0] == '2' ? '上行' : '下行'})`, `
`