From d3ea1cd22eeea57c452497d5de4f1bc90a2b3893 Mon Sep 17 00:00:00 2001 From: lVAL Date: Tue, 20 Oct 2020 15:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0AUSTool=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/rpTools.js | 2 +- src/jmapNew/theme/aus_00/planConvert--.js | 55 ++++- src/jmapNew/theme/aus_00/planConvert.js | 62 ++++-- src/scripts/ConstDic.js | 6 +- .../editToolAUS/dialog/planJustRunning.vue | 12 +- .../editToolAUS/dialog/planJustStop.vue | 12 +- .../editToolAUS/dialog/planModifyArea.vue | 158 ++++++++++++++ .../editToolAUS/dialog/planSetParams.vue | 34 +-- src/views/planMonitor/editToolAUS/index.vue | 154 ++++++++++---- src/views/planMonitor/editToolAUS/menus.vue | 6 +- src/views/planMonitor/editToolAUS/monitor.js | 196 ++++++++++-------- .../planMonitor/editToolAUS/schedule.vue | 37 ++-- src/views/planMonitor/editToolAUS/utils.js | 35 +--- 13 files changed, 529 insertions(+), 240 deletions(-) create mode 100644 src/views/planMonitor/editToolAUS/dialog/planModifyArea.vue diff --git a/src/api/rpTools.js b/src/api/rpTools.js index 64222f89e..ffac62027 100644 --- a/src/api/rpTools.js +++ b/src/api/rpTools.js @@ -87,7 +87,7 @@ export function modifyRpArea(areaNo, data) { /** * 删除区域 */ -export function deleteRpArea(areaNo) { +export function delRpArea(areaNo) { return request({ url: `/api/rpTools/${areaNo}/area`, method: 'delete' diff --git a/src/jmapNew/theme/aus_00/planConvert--.js b/src/jmapNew/theme/aus_00/planConvert--.js index 02c84e9a9..0bd3bbd02 100644 --- a/src/jmapNew/theme/aus_00/planConvert--.js +++ b/src/jmapNew/theme/aus_00/planConvert--.js @@ -1,4 +1,5 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan'; +import { toTimeStamp } from '@/utils/date'; export default { /** 边缘高度*/ @@ -11,8 +12,52 @@ export default { TranslationTime: 0, /** 将后台数据解析成图形*/ + parseDataToGraph(chart, planData, stations, kmRangeCoordMap) { + const graphs = []; + if (planData && + planData.areaList && + planData.areaList.length) { + planData.areaList.forEach(el => { + const startTime = toTimeStamp(el.startTime); + const endTime = toTimeStamp(el.endTime); + + const fartherKm = this.getCoordYByObj(stations, kmRangeCoordMap, {stationCode: el.fartherStationCode}); + const closerKm = this.getCoordYByObj(stations, kmRangeCoordMap, {stationCode: el.closerStationCode}); + const point1 = [ startTime, fartherKm]; + const point2 = [ endTime, closerKm] + const position = chart.convertToPixel('grid', point1); + const position2 = chart.convertToPixel('grid', point2) + const width = Math.abs(position[0] - position2[0]); + const height = Math.abs(position[1] - position2[1]); + + graphs.push({ + type: 'rect', + subType: 'Area', + areaNo: el.areaNo, + position, + point1, + point2, + model: el, + shape: { + x: 0, + y: 0, + width, + height + }, + style: { + fill: 'rgb(255,0,0, 0.3)', + stroke: 'rgb(255, 0, 0, 0.8)' + }, + z: 100 + }) + }) + } + + return graphs; + }, + /** 将后台数据解析成折线*/ - parseDataToModels(planData, stations, kmRangeCoordMap) { + parseDataToSeries(chart, planData, stations, kmRangeCoordMap) { var models = []; /** 按车次遍历数据*/ if (planData && planData.length) { @@ -37,11 +82,11 @@ export default { /** 计算停站点坐标集合*/ trip.stationTimeList.forEach((elem,idx) => { if (elem.arrivalTime) { - opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); + opt.data.push([elem.arrivalTime, this.getCoordYByObj(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); } if (elem.departureTime) { - opt.data.push([elem.departureTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); + opt.data.push([elem.departureTime, this.getCoordYByObj(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); } }); @@ -53,7 +98,7 @@ export default { }, /** 更新数据并解析成折线*/ - updateDataToModels(planData, stations, kmRangeCoordMap, runPlanData, series) { + updateDataToModels(chart, planData, stations, kmRangeCoordMap, runPlanData, series) { if (planData && planData.length) { } return series; @@ -109,7 +154,7 @@ export default { }, /** 根据elem计算y值*/ - getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) { + getCoordYByObj(stations, kmRangeCoordMap, elem, directionCode, isSpecial) { var defaultVlue = 0; var station = stations.find(it => { return it.code == elem.stationCode; }); if (station) { diff --git a/src/jmapNew/theme/aus_00/planConvert.js b/src/jmapNew/theme/aus_00/planConvert.js index 7eaf68f56..b332fb48d 100644 --- a/src/jmapNew/theme/aus_00/planConvert.js +++ b/src/jmapNew/theme/aus_00/planConvert.js @@ -1,4 +1,5 @@ import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; +import { toTimeStamp } from '@/utils/date'; export default { /** 边缘高度*/ @@ -11,12 +12,44 @@ export default { TranslationTime: 0, /** 将后台数据解析成图形*/ - parseDataToGraph(planData, stations) { + parseDataToGraph(chart, planData, stations, kmRangeCoordMap) { const graphs = []; if (planData && planData.areaList && planData.areaList.length) { planData.areaList.forEach(el => { + const startTime = toTimeStamp(el.startTime); + const endTime = toTimeStamp(el.endTime); + + const fartherKm = this.getCoordYByObj(stations, kmRangeCoordMap, {stationCode: el.fartherStationCode}); + const closerKm = this.getCoordYByObj(stations, kmRangeCoordMap, {stationCode: el.closerStationCode}); + const point1 = [ startTime, fartherKm]; + const point2 = [ endTime, closerKm] + const position = chart.convertToPixel('grid', point1); + const position2 = chart.convertToPixel('grid', point2) + const width = Math.abs(position[0] - position2[0]); + const height = Math.abs(position[1] - position2[1]); + + graphs.push({ + type: 'rect', + subType: 'Area', + areaNo: el.areaNo, + position, + point1, + point2, + model: el, + shape: { + x: 0, + y: 0, + width, + height + }, + style: { + fill: 'rgb(255,0,0, 0.3)', + stroke: 'rgb(255, 0, 0, 0.8)' + }, + z: 100 + }) }) } @@ -24,7 +57,7 @@ export default { }, /** 将后台数据解析成折线*/ - parseDataToModels(planData, stations, kmRangeCoordMap) { + parseDataToSeries(chart, planData, stations, kmRangeCoordMap) { const models = []; if (planData && planData.serviceList && @@ -52,7 +85,7 @@ export default { trip.stationTimeList.forEach((elem,idx) => { if (elem.arrivalTime) { - opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), { + opt.data.push([elem.arrivalTime, this.getCoordYByObj(stations, kmRangeCoordMap, elem), { stationCode: elem.stationCode, serviceNo: el.serviceNo, tripNo: trip.tripNo, @@ -61,7 +94,7 @@ export default { } if (elem.departureTime) { - opt.data.push([elem.departureTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), { + opt.data.push([elem.departureTime, this.getCoordYByObj(stations, kmRangeCoordMap, elem), { stationCode: elem.stationCode, serviceNo: el.serviceNo, tripNo: trip.tripNo, @@ -81,7 +114,7 @@ export default { }, /** 更新数据并解析成折线*/ - updateDataToModels(planData, stations, kmRangeCoordMap, runPlanData, series, lineStyle) { + updateDataToModels(chart, planData, stations, kmRangeCoordMap, series) { if (planData && planData.length) { } return series; @@ -129,25 +162,8 @@ export default { return yText; }, - /** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/ - computedReentryNumber(code) { - // 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; - } - - return defaultVlue; - }, - /** 根据elem计算y值*/ - getCoordYByElem(stations, kmRangeCoordMap, elem) { + getCoordYByObj(stations, kmRangeCoordMap, elem) { var defaultVlue = 0; var station = stations.find(it => { return it.code == elem.stationCode; }); if (station) { diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index 4bd74bfda..9adfb41c2 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -128,11 +128,7 @@ export const DeviceMenu = { SetDriver: '106', Script: '107', IscsSystem: '108', - IscsInterface: '109', - - planJustRunning: '1000', - planJustDeparture: '1001', - planSetParams: '1002' + IscsInterface: '109' }; /** diff --git a/src/views/planMonitor/editToolAUS/dialog/planJustRunning.vue b/src/views/planMonitor/editToolAUS/dialog/planJustRunning.vue index 36f1dc765..7f906c7bc 100644 --- a/src/views/planMonitor/editToolAUS/dialog/planJustRunning.vue +++ b/src/views/planMonitor/editToolAUS/dialog/planJustRunning.vue @@ -14,7 +14,7 @@ diff --git a/src/views/planMonitor/editToolAUS/dialog/planSetParams.vue b/src/views/planMonitor/editToolAUS/dialog/planSetParams.vue index e350c3bfc..55b4f9dd0 100644 --- a/src/views/planMonitor/editToolAUS/dialog/planSetParams.vue +++ b/src/views/planMonitor/editToolAUS/dialog/planSetParams.vue @@ -34,10 +34,15 @@