From 2f4b765d972005c4a842acdd41e78ccf2adf0b25 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 21 Apr 2020 15:08:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E8=B0=83=E6=95=B4&=E4=BA=A4=E8=B7=AF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/simulation.js | 7 + src/components/QueryListPage/QueryForm.vue | 8 +- .../QueryListPage/QueryListPage.vue | 3 +- .../theme/chengdu_03/menusPlan/addTask.vue | 80 +-- .../chengdu_03/menusPlan/managePlanList.vue | 2 +- .../theme/chengdu_03/planSchedule/menuBar.vue | 91 +--- src/jmapNew/theme/xian_02/planConvert.js | 203 ++++---- src/store/modules/socket.js | 6 +- src/utils/baseUrl.js | 4 +- .../newMap/displayNew/demon/runPlanLoad.vue | 16 +- .../dataRelation/routingoperate/detail.vue | 31 +- .../dataRelation/routingoperate/route.vue | 170 +++---- src/views/planSchedule/index.vue | 385 ++++++++++++++ src/views/planSchedule/menuBar.vue | 473 +++++++++++++++++ src/views/planSchedule/menuTool.vue | 170 +++++++ .../menusPlan/components/dataTable.vue | 206 ++++++++ .../menusPlan/createTodayPlan.vue | 108 ++++ .../planSchedule/menusPlan/managePlanList.vue | 132 +++++ src/views/planSchedule/schedule.vue | 479 ++++++++++++++++++ src/views/planSchedule/statusBar.vue | 107 ++++ src/views/planSchedule/titleBar.vue | 75 +++ 21 files changed, 2433 insertions(+), 323 deletions(-) create mode 100644 src/views/planSchedule/index.vue create mode 100644 src/views/planSchedule/menuBar.vue create mode 100644 src/views/planSchedule/menuTool.vue create mode 100644 src/views/planSchedule/menusPlan/components/dataTable.vue create mode 100644 src/views/planSchedule/menusPlan/createTodayPlan.vue create mode 100644 src/views/planSchedule/menusPlan/managePlanList.vue create mode 100644 src/views/planSchedule/schedule.vue create mode 100644 src/views/planSchedule/statusBar.vue create mode 100644 src/views/planSchedule/titleBar.vue diff --git a/src/api/simulation.js b/src/api/simulation.js index 84227d643..eab1503f4 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -605,3 +605,10 @@ export function exitRunPlan (group) { method: 'post' }); } +/** 加载指定运行计划 */ +export function simulationLoadRunPlan(group, templateId) { + return request({ + url: `/simulation/${group}/load/runPlan/${templateId}`, + method: 'put' + }); +} diff --git a/src/components/QueryListPage/QueryForm.vue b/src/components/QueryListPage/QueryForm.vue index 1bea530dd..3e38317af 100644 --- a/src/components/QueryListPage/QueryForm.vue +++ b/src/components/QueryListPage/QueryForm.vue @@ -143,7 +143,7 @@ - + {{ $t('global.query') }} {{ $t('global.reset') }} {{ $t('global.export') }} @@ -201,6 +201,12 @@ export default { default() { return 18; } + }, + offsetSpan: { + type: Number, + default() { + return 1; + } } }, data() { diff --git a/src/components/QueryListPage/QueryListPage.vue b/src/components/QueryListPage/QueryListPage.vue index 68affd896..1a5f880f5 100644 --- a/src/components/QueryListPage/QueryListPage.vue +++ b/src/components/QueryListPage/QueryListPage.vue @@ -6,6 +6,7 @@ ref="queryForm" :query-form="queryForm" :left-span="queryForm.leftSpan" + :offset-span="queryForm.offsetSpan" :query-list="queryList" :before-query="queryForm.beforeQuery" :can-query="canQuery" @@ -32,7 +33,7 @@ > - + diff --git a/src/jmapNew/theme/chengdu_03/menusPlan/addTask.vue b/src/jmapNew/theme/chengdu_03/menusPlan/addTask.vue index 009c19f02..507edf82d 100644 --- a/src/jmapNew/theme/chengdu_03/menusPlan/addTask.vue +++ b/src/jmapNew/theme/chengdu_03/menusPlan/addTask.vue @@ -112,46 +112,46 @@ diff --git a/src/jmapNew/theme/chengdu_03/planSchedule/menuBar.vue b/src/jmapNew/theme/chengdu_03/planSchedule/menuBar.vue index e64ae3063..67bab57a9 100644 --- a/src/jmapNew/theme/chengdu_03/planSchedule/menuBar.vue +++ b/src/jmapNew/theme/chengdu_03/planSchedule/menuBar.vue @@ -138,75 +138,34 @@ export default { tempClassB: -1, menu: [ { - title: '文件(F)', - children: [ - ] + title: '管理运行计划', + click: this.handleViewPlanSchedule }, { - title: '显示(V)', - children: [ - // { - // title: '缩放', - // }, - // { - // title: '单色显示历史计划', - // }, - // { - // title: '彩色显示历史计划' - // } - ] - }, - { - title: '编辑(E)', - children: [ - // { - // title: '修改', - // click: this.handleEditPlanningTrain - // }, - // { - // title: '加任务', - // click: this.handleAddTask - // }, - // { - // title: '删任务', - // click: this.handleDeleteTask - // }, - // { - // title: '改表号', - // click: this.handleModifyingPlanId - // }, - // { - // title: '平移多辆车', - // click: this.handleTranslationalMulTrain - // } - ] - }, - { - title: '工具(T)', - children: [ - { - title: '查看计划列表', - click: this.handleViewPlanSchedule - }, - { - title: '创建一周计划', - click: this.handleCreateWeekPlan - }, - { - title: '加载当天计划', - click: this.handleReloadTodayPlan - } - // { - // title: '有效性检查', - // click: this.handleValidityCheck - // } - ] - }, - { - title: '帮助(H)', - children: [ - ] + title: '加载今日计划', + click: this.handleReloadTodayPlan } + // { + // title: '工具(T)', + // children: [ + // { + // title: '查看计划列表', + // click: this.handleViewPlanSchedule + // }, + // { + // title: '创建一周计划', + // click: this.handleCreateWeekPlan + // }, + // { + // title: '加载当天计划', + // click: this.handleReloadTodayPlan + // } + // // { + // // title: '有效性检查', + // // click: this.handleValidityCheck + // // } + // ] + // } ] }; }, diff --git a/src/jmapNew/theme/xian_02/planConvert.js b/src/jmapNew/theme/xian_02/planConvert.js index 8f2fc6dc3..db76b7a94 100644 --- a/src/jmapNew/theme/xian_02/planConvert.js +++ b/src/jmapNew/theme/xian_02/planConvert.js @@ -1,4 +1,31 @@ -import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; +import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; +const StationMap = { + YARD1: '潏河转换轨', + YARD2: '潏河转换轨', + WQN: '韦曲南站', + HTC: '航天城站', + FQY: '凤栖原站', + SYZ: '三爻站', + HZX: '会展中心站', + WYJ: '纬一街站', + XZZ: '小寨站', + TYC: '体育场站', + NSM: '南稍门站', + YNM: '永宁门站', + ZLZ: '钟楼站', + BDJ: '北大街站', + AYM: '安远门站', + LSY: '龙首原站', + DMG: '大明宫西站', + STS: '市图书馆站', + FCW: '凤城五路站', + XZX: '行政中心站', + YDG: '运动公园站', + BYZ: '北苑站', + BKZ: '北客站', + NDOP1: '渭河转换轨', + NDOP2: '渭河转换轨' +}; export default { /** 边缘高度*/ @@ -9,107 +36,99 @@ export default { /** 偏移时间*/ TranslationTime: 60 * 60 * 2, - /** excel解析配置*/ ExcelConfig: { beginRow: 1, beginCol: 0, - fieldNum: 10, - sepField: '行车间隔', - trainId: 'TrainID', - columns: ['折返线', 'TrainID', '行车间隔'] + fieldNum: 8, + sepField: 'Trip', + idField: 'Train ID', + columns: { + 'LOC': { key: 'stationName', formatter: (val) => { return StationMap[val]; } }, + 'Arrive': { key: 'arriveTime', formatter: (val) => { return val; } }, + 'Depart': { key: 'departureTime', formatter: (val) => { return val; } } + } + }, /** 解析exal数据转换为Json后台数据*/ importData(Sheet, JsonData) { var dataList = convertSheetToList(Sheet, true); - if (dataList && dataList.length) { - if (dataList && dataList.length && dataList[1] && dataList[0]) { - // const tIndex = dataList.findIndex(it => { return it[0]; }); // 设置不用过滤行数 - const tIndex = 9; // 设置不用过滤行数 + var needList = Object.keys(this.ExcelConfig.columns); - /** 解析二维数组为json对象*/ - const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00 - dataList.forEach((elem, i) => { - var begin = -1; - /** 跳过名称所在的行*/ - if (i != tIndex && elem && elem.length > 0) { - let flag = false; - let count = 0; - let param = { begTime: '', endTime: '' }; - if (i > tIndex) { elem.reverse(); } - elem.forEach((item, j) => { - /** 过滤空值*/ - if (item) { - let title = ''; - var value = `${item}`.trim(); - if (i > tIndex) { // 上行线 - title = `${dataList[tIndex][dataList[tIndex].length - j - 1]}`.replace(/\s*/g, ''); - if (title == 'undefined') { - title = `${dataList[tIndex][dataList[tIndex].length - j - 2]}`.replace(/\s*/g, ''); - } - } else { // 下行线 - title = `${dataList[tIndex][j]}`.replace(/\s*/g, ''); - if (title == 'undefined') { - title = `${dataList[tIndex][j - 1]}`.replace(/\s*/g, ''); + if (dataList && dataList.length) { + for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += this.ExcelConfig.fieldNum + 1) { + var isContinue = true; + var tripObj = { code: '', trainId: '', arrivalList: [] }; + + for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) { + isContinue = false; + + var stationObj = {}; + for (var index = 0; index < this.ExcelConfig.fieldNum; index += 1) { + if (dataList[colIndex + index]) { + var title = dataList[colIndex + index][0]; + var value = dataList[colIndex + index][rowIndex]; + + if (title && value) { + // 数据列解析 + isContinue = true; + var titleStr = `${title}`.trim(); + var valueStr = `${value}`.trim(); + + if (titleStr == this.ExcelConfig.sepField) { + if (tripObj.code) { + const length = tripObj.arrivalList.length; + if (length == 1) { + tripObj.arrivalList[0]['flag'] = true; + } + if (valueStr.includes('FT') || valueStr.includes('LT')) { + valueStr = valueStr.replace('FT', '').replace('LT', ''); + console.log(valueStr); + } + valueStr = tripObj.trainId + valueStr; + delete tripObj.trainId; + JsonData.push(tripObj); + tripObj = { code: valueStr, arrivalList: [] }; + } else { + if (valueStr.includes('FT') || valueStr.includes('LT')) { + valueStr = valueStr.replace('FT', '').replace('LT', ''); + } + valueStr = tripObj.trainId + valueStr; + delete tripObj.trainId; + tripObj.code = valueStr; } + } else if (titleStr === this.ExcelConfig.idField) { + tripObj.trainId = valueStr; } - /** 匹配到开始位置或者结束位置*/ - if (title == this.ExcelConfig.trainId) { - if (begin == -1) { - flag = true; - begin = value; // 设置初始索引 - JsonData.push({ - code: value, - destinationCode: '', - arrivalList: [] - }); - } else if (flag) { - begin = -1; // 清空初始索引 - JsonData[JsonData.length - 1].destinationCode = value; - flag = false; - } - } else if (begin !== -1) { - /** 匹配到中间位置*/ - var stationName = title.replace(/\s/, ''); - if (this.ExcelConfig.columns.indexOf(stationName) == -1 && reg3.test(value)) { - let need = false; - if (value.split(':')[0] == '24') { // 24:XX:XX 类似这种数据 变24为00 - const arr = value.split(':'); - arr[0] = '00'; - value = arr.join(':'); - } - if (count == 1) { - count = 0; - param.endTime = value; - } - if (count == 0) { - count = 1; - param.begTime = param.begTime || value; - } - - if (param.begTime && param.endTime) { - need = true; - } - - /** 添加json数据*/ - if (need) { // 储存非空 数据 - var stationObj = { - stationName: stationName - }; - stationObj['arriveTime'] = prefixTime(param.begTime); - stationObj['departureTime'] = prefixTime(param.endTime); - JsonData[JsonData.length - 1].arrivalList.push(stationObj); - param = { begTime: '', endTime: '' }; - count = 0; - } - } + // 取需要的字段 + if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) { + stationObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr); } } - }); + } } - }); + + // 添加字段值 + if (Object.keys(stationObj).length) { + if (!stationObj.departureTime) { + stationObj.departureTime = stationObj.arriveTime; + } else if (!stationObj.arriveTime) { + stationObj.arriveTime = stationObj.departureTime; + } + tripObj.arrivalList.push(stationObj); + } + } + + // 添加最后那条没有车次的记录 + if (tripObj.code) { + const length = tripObj.arrivalList.length; + if (length) { + tripObj.arrivalList[length - 1]['flag'] = true; + } + JsonData.push(tripObj); + } } } return JsonData; @@ -118,10 +137,12 @@ export default { /** 将后台数据解析成图表*/ convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) { var models = []; + if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) { /** 按服务遍历数据*/ data.serviceNumberDataList.forEach((service) => { /** 按车次遍历数据*/ + var isBackup = true; var opt = { name: '', markPointData: [], data: [] }; if (service.tripNumberDataList && service.tripNumberDataList.length) { service.tripNumberDataList.forEach((train, j) => { @@ -161,8 +182,9 @@ export default { lastPoint = train.stationTimeList[idx - 1]; nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1]; num = this.computedReentryNumber(train.tripNumber); - 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]); + const aa = `${train.directionCode}${train.tripNumber}`; + 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]); } /** 如果是备用车,按车次添加线*/ @@ -175,10 +197,12 @@ export default { opt = { name: '', markPointData: [], data: [] }; } } + + isBackup = train.backup; }); // 不是备用车,按服务添加线 - if (!service.backup) { + if (!isBackup) { /** 创建一条完成的服务数据*/ var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle)); if (model) { @@ -201,6 +225,7 @@ export default { if (!runPlanData[elem.serviceNumber]) { /** 创建一个新服务号标记*/ runPlanData[elem.serviceNumber] = {}; + /** 不存在此服务号,则需要创建一条新的line*/ series.push(createSeriesModel({ zlevel: 1, diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index e3e4ad1d6..3673c1088 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -81,6 +81,9 @@ function handle(state, data) { case 'Be_Logged_Out': // 重复登录被登出 state.beLogoutCount++; break; + case 'Simulation_Run_Plan_Reload': // 运行图变更 + state.runPlanReloadCount++; + break; case 'Simulation_Control_Pause': // 暂停中 store.dispatch('scriptRecord/updateSimulationPause', msg); break; @@ -233,7 +236,8 @@ const socket = { tipOperateCount: 0, // 任务结束提示消息 realDeviceInfo: 0, // 真实设备信息 - beLogoutCount: 0 // 被登出 + beLogoutCount: 0, // 被登出 + runPlanReloadCount: 0 // 仿真运行图变更 }, getters: { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index e9046878d..568f6a628 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ 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'; // 张赛 - // BASE_API = 'http://192.168.3.82:9000'; // 杜康 + BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/newMap/displayNew/demon/runPlanLoad.vue b/src/views/newMap/displayNew/demon/runPlanLoad.vue index 04d83a840..460b5e801 100644 --- a/src/views/newMap/displayNew/demon/runPlanLoad.vue +++ b/src/views/newMap/displayNew/demon/runPlanLoad.vue @@ -1,14 +1,18 @@ + + diff --git a/src/views/planSchedule/menuBar.vue b/src/views/planSchedule/menuBar.vue new file mode 100644 index 000000000..483ab0f10 --- /dev/null +++ b/src/views/planSchedule/menuBar.vue @@ -0,0 +1,473 @@ + + + + diff --git a/src/views/planSchedule/menuTool.vue b/src/views/planSchedule/menuTool.vue new file mode 100644 index 000000000..a2ee9e8f0 --- /dev/null +++ b/src/views/planSchedule/menuTool.vue @@ -0,0 +1,170 @@ + + + + diff --git a/src/views/planSchedule/menusPlan/components/dataTable.vue b/src/views/planSchedule/menusPlan/components/dataTable.vue new file mode 100644 index 000000000..7b8f1756b --- /dev/null +++ b/src/views/planSchedule/menusPlan/components/dataTable.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/src/views/planSchedule/menusPlan/createTodayPlan.vue b/src/views/planSchedule/menusPlan/createTodayPlan.vue new file mode 100644 index 000000000..1ca2199ba --- /dev/null +++ b/src/views/planSchedule/menusPlan/createTodayPlan.vue @@ -0,0 +1,108 @@ + + + + diff --git a/src/views/planSchedule/menusPlan/managePlanList.vue b/src/views/planSchedule/menusPlan/managePlanList.vue new file mode 100644 index 000000000..cdc70a796 --- /dev/null +++ b/src/views/planSchedule/menusPlan/managePlanList.vue @@ -0,0 +1,132 @@ + + + + diff --git a/src/views/planSchedule/schedule.vue b/src/views/planSchedule/schedule.vue new file mode 100644 index 000000000..f8a7fd69e --- /dev/null +++ b/src/views/planSchedule/schedule.vue @@ -0,0 +1,479 @@ + + + + diff --git a/src/views/planSchedule/statusBar.vue b/src/views/planSchedule/statusBar.vue new file mode 100644 index 000000000..f7df3461d --- /dev/null +++ b/src/views/planSchedule/statusBar.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/src/views/planSchedule/titleBar.vue b/src/views/planSchedule/titleBar.vue new file mode 100644 index 000000000..cdee046e5 --- /dev/null +++ b/src/views/planSchedule/titleBar.vue @@ -0,0 +1,75 @@ + + + +