From 95eb65491199723189424cb0eab094e1e86b2c88 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 13 Oct 2020 16:39:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=BB=A3=E7=A0=81?= =?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/jmapNew/utils/parser.js | 1 + src/views/drts/scene/modify.vue | 29 +++++++++++++------ .../component/covertOperation.js | 27 ++++++++++++++++- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index c329a76fa..78ffce51f 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -126,6 +126,7 @@ export function parser(data, skinCode, showConfig) { }, this); zrUtil.each(data.trainList || [], elem => { + console.log(elem, '11111111111111'); mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert, showConfig); }, this); diff --git a/src/views/drts/scene/modify.vue b/src/views/drts/scene/modify.vue index 4349f0d1c..1e4a43cde 100644 --- a/src/views/drts/scene/modify.vue +++ b/src/views/drts/scene/modify.vue @@ -207,7 +207,7 @@ import StepDescription from './stepDescription'; // import OperateStatistic from './operateStatistic'; import {covertOperate} from '@/views/newMap/displayNew/scriptDisplay/component/covertOperation'; import {updateCompetitionPracticalStep, getCompetitionPracticalSceneById} from '@/api/competition'; -import {getPublishMapDetailById} from '@/api/jmap/map'; +import { loadNewMapDataByMapId } from '@/utils/loaddata'; export default { name:'ModifyStep', components:{ @@ -299,10 +299,11 @@ export default { this.stepVOs = stepVOs; }); // 加载地图数据 - getPublishMapDetailById(res.data.mapId).then(resp => { - this.$store.dispatch('map/setMapData', resp.data); + loadNewMapDataByMapId(res.data.mapId).then(() => { + // this.$store.dispatch('map/setMapData', resp.data); const stationMap = {}; - resp.data.stationList.forEach(station=>{ + const stationList = this.$store.state.map.map.stationList; + stationList.forEach(station=>{ stationMap[station.code] = station; }); let lastData = JSON.stringify(res.data.memberList); @@ -349,7 +350,9 @@ export default { covert(element) { const member = this.memberList[element.memberId]; let resultData = ''; - if (element.type == 'Conversation') { + if (element.type == 'Accept_Conversation_Invitation') { + resultData = member.label + '请接受会话邀请'; + } else if (element.type == 'Conversation') { resultData = member.label + '说:' + element.content; } else if (element.type == 'Operation') { resultData = covertOperate(element.operationType, element.operationParamMap); @@ -360,11 +363,19 @@ export default { } else if (element.type == 'Start_Conversation' ) { const inviteMember = []; // this.$emit('allowCreatCoversition'); - element.conversationMemberIds.forEach(id=>{ - if (element.memberId != id) { - inviteMember.push((this.memberList[id] || {label: ''}).label); + if (element.communicationObject) { + if (element.communicationObject == 'ALL_STATION') { + inviteMember.push('所有车站'); + } else if (element.communicationObject == 'ALL_TRAIN') { + inviteMember.push('所有司机'); } - }); + } else { + element.conversationMemberIds.forEach(id=>{ + if (element.memberId != id) { + inviteMember.push((this.memberList[id] || {label: ''}).label); + } + }); + } resultData = member.label + '创建会话,选择' + inviteMember.toString(); } else if (element.type == 'Command') { const targetName = this.memberList[element.commandInitiateVO.targetMemberId]; diff --git a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js index b9225467c..51e428109 100644 --- a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js +++ b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js @@ -69,6 +69,12 @@ export const operateEnum = { Stand:{ code:'standCode', type:'站台', + Stand_Set_Hold_Train:{ + code:'standCode', + isDevice:false, + isList:false, + name:'站台' + }, Stand_Set_Park_Time:{ isList:true, params:[ @@ -142,7 +148,7 @@ export const operateEnum = { ] } }, - Train:{ + TrainWindow:{ code:'groupNumber', type:'列车', Train_Set_Plan:{ @@ -182,7 +188,23 @@ export function covertOperate(operationType, operationParamMap) { if (device == 'CM') { device = 'ControlConvertMenu'; } + const list = ['Train_Update_Type', + 'Train_Add_Train_Trace', + 'Train_Remove_Train_Trace', + 'Train_Move_Train_Trace', + 'Train_Set_Plan', + 'Train_Set_Head', + 'Train_Set_Manual', + 'Train_Set_Crew_Number', + 'Train_Tag_Atp_Cut', + 'Train_Tag_Atp_Recover', + 'Train_Allow_Pass', + 'Train_Info']; + if (list.includes(operationType)) { + device = 'TrainWindow'; + } const operateName = Object.values(CMD[device]).find(res=>{ return res.value == operationType; }); + debugger; const deviceInfo = covertOperation(device, operationParamMap, operationType); let tip = '请'; if (deviceInfo.deviceName) { @@ -200,6 +222,9 @@ function covertOperation(deviceType, operationParamMap, operationType) { let deviceName = ''; let paramName = ''; if (operateEnum[deviceType].code) { + if (deviceType == 'TrainWindow') { + + } const device = store.getters['map/getDeviceByCode'](operationParamMap[operateEnum[deviceType].code]); if (device._type == 'StationStand') { const station = store.getters['map/getDeviceByCode'](device.stationCode); From 2c3c46c5bcf895c6a2423a201673a456bbb3d08f Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 13 Oct 2020 17:11:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/utils/parser.js | 1 - .../displayNew/dispatherContest/sceneList.vue | 4 + .../component/covertOperation.js | 85 ++++++++++++------- 3 files changed, 58 insertions(+), 32 deletions(-) diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index 78ffce51f..c329a76fa 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -126,7 +126,6 @@ export function parser(data, skinCode, showConfig) { }, this); zrUtil.each(data.trainList || [], elem => { - console.log(elem, '11111111111111'); mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert, showConfig); }, this); diff --git a/src/views/newMap/displayNew/dispatherContest/sceneList.vue b/src/views/newMap/displayNew/dispatherContest/sceneList.vue index de8406ee1..cc6f7b305 100644 --- a/src/views/newMap/displayNew/dispatherContest/sceneList.vue +++ b/src/views/newMap/displayNew/dispatherContest/sceneList.vue @@ -58,6 +58,7 @@ export default { {type: '供电系统故障', scene: '接触轨(网)断电'}, {type: '供电系统故障', scene: '车站照明熄灭影响乘降'}, {type: '车站机电设备故障', scene: '站台门故障'}, + {type: '限速', scene: '列车限速'}, {type: '轨道故障', scene: '线路故障影响列车运行'} ], deputySceneData: [ @@ -82,7 +83,10 @@ export default { this.mainSceneData[4].id = each.id; } else if (each.name == '场景9') { this.mainSceneData[6].id = each.id; + } else if (each.name == '场景10') { + this.mainSceneData[7].id = each.id; } + }); } }); diff --git a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js index 51e428109..144124ad9 100644 --- a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js +++ b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js @@ -69,12 +69,6 @@ export const operateEnum = { Stand:{ code:'standCode', type:'站台', - Stand_Set_Hold_Train:{ - code:'standCode', - isDevice:false, - isList:false, - name:'站台' - }, Stand_Set_Park_Time:{ isList:true, params:[ @@ -152,8 +146,30 @@ export const operateEnum = { code:'groupNumber', type:'列车', Train_Set_Plan:{ - code:'serviceNumber', - name:'服务号' + isList:true, + params:[ + { + code:'serviceNumber', + name:'服务号' + }, + { + code:'tripNumber', + name:'车次号' + } + ] + }, + Train_Set_Head:{ + isList:true, + params:[ + { + code:'serviceNumber', + name:'服务号' + }, + { + code:'destinationCode', + name:'目的地号' + } + ] } } }; @@ -204,7 +220,6 @@ export function covertOperate(operationType, operationParamMap) { device = 'TrainWindow'; } const operateName = Object.values(CMD[device]).find(res=>{ return res.value == operationType; }); - debugger; const deviceInfo = covertOperation(device, operationParamMap, operationType); let tip = '请'; if (deviceInfo.deviceName) { @@ -222,9 +237,6 @@ function covertOperation(deviceType, operationParamMap, operationType) { let deviceName = ''; let paramName = ''; if (operateEnum[deviceType].code) { - if (deviceType == 'TrainWindow') { - - } const device = store.getters['map/getDeviceByCode'](operationParamMap[operateEnum[deviceType].code]); if (device._type == 'StationStand') { const station = store.getters['map/getDeviceByCode'](device.stationCode); @@ -236,7 +248,13 @@ function covertOperation(deviceType, operationParamMap, operationType) { deviceName += '【' + operateEnum[deviceType].type + ' ' + parentSection.name + '-' + device.name + '】'; } } else { - deviceName += '【' + operateEnum[deviceType].type + ' ' + device.name + '】'; + let deviceNameIn = ''; + if (device.name) { + deviceNameIn = device.name; + } else { + deviceNameIn = device.groupNumber; + } + deviceName += '【' + operateEnum[deviceType].type + ' ' + deviceNameIn + '】'; } } const paramInfo = operateEnum[deviceType][operationType]; @@ -264,27 +282,32 @@ function covertOperation(deviceType, operationParamMap, operationType) { params.forEach((param, index)=>{ paramName += ' ' + param.name; const data = operationParamMap[param.code]; - param.result.forEach(result=>{ - switch (result.judge) { - case '=': { - if (data == result.data) { - paramName += '为' + result.name; - if (result.showUnit) { - paramName += ',值为' + data + result.showUnit; + if (param.result) { + param.result.forEach(result=>{ + switch (result.judge) { + case '=': { + if (data == result.data) { + paramName += '为' + result.name; + if (result.showUnit) { + paramName += ',值为' + data + result.showUnit; + } } - } - break; - } case '>': { - if (data > result.data) { - paramName += '为' + result.name; - if (result.showUnit) { - paramName += ',值为' + data + result.showUnit; + break; + } case '>': { + if (data > result.data) { + paramName += '为' + result.name; + if (result.showUnit) { + paramName += ',值为' + data + result.showUnit; + } } + break; } - break; - } - } - }); + } + }); + } else { + paramName += ',值为' + data; + } + if (index != params.length - 1) { paramName += ','; } From d9802336c539bc5c9d76c96b9e4b52195d1b866e Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 13 Oct 2020 17:32:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=AE=9E=E6=93=8D=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/displayNew/index.vue | 2 +- .../scriptDisplay/component/covertOperation.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index d7be018e2..cb9217ac9 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -27,7 +27,7 @@ /> - + diff --git a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js index 144124ad9..78dee2725 100644 --- a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js +++ b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js @@ -51,11 +51,11 @@ export const operateEnum = { Section_Set_Limit_Speed:{ code:'speedLimitValue', name:'限速值为' - }, - Section_Cancel_Limit_Speed:{ - code:'speedLimitValue', - name:'限速值为' } + // Section_Cancel_Limit_Speed:{ + // code:'speedLimitValue', + // name:'限速值为' + // } }, ControlConvertMenu:{ CM_Apply_For_Station_Control:{ @@ -252,7 +252,7 @@ function covertOperation(deviceType, operationParamMap, operationType) { if (device.name) { deviceNameIn = device.name; } else { - deviceNameIn = device.groupNumber; + deviceNameIn = '(车组号:' + device.groupNumber + ')'; } deviceName += '【' + operateEnum[deviceType].type + ' ' + deviceNameIn + '】'; }