From f33fb7ee91417dcaa44af05ca46dff9a631ae22c Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 4 Sep 2020 17:21:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=98=E5=9B=BE=E6=95=B0=E6=8D=AE=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=B0=83=E6=95=B4&=E4=BD=9B=E5=B1=B1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=97=E8=BD=A6=E8=AF=86=E5=88=AB=E5=A5=BD=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/simulation.js | 8 ++ src/jmapNew/config/keyboardEvents.js | 12 +- src/jmapNew/config/skinCode/foshan_01.js | 10 +- src/jmapNew/map.js | 19 ++- src/jmapNew/shape/Train/TrainBody.js | 3 +- .../components/menus/dialog/trainControl.vue | 70 ++++++++-- .../theme/foshan_01/menus/menuTrain.vue | 9 +- src/jmapNew/theme/ningbo_03/menus/menuBar.vue | 120 ++++++++++++++++-- 8 files changed, 218 insertions(+), 33 deletions(-) diff --git a/src/api/simulation.js b/src/api/simulation.js index 502a8e339..68bb53acc 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -757,6 +757,14 @@ export function getTrainDetailBytripNumber(group, params) { params: params }); } +/** 根据车次号和表号获取列车信息 */ +export function getTrainDetailByStNumber(group, params) { + return request({ + url: `/simulation/${group}/planTripInfoBySt`, + method: 'get', + params: params + }); +} /** 获取新版综合仿真仿真成员列表 */ export function getSimulationMemberList(group) { return request({ diff --git a/src/jmapNew/config/keyboardEvents.js b/src/jmapNew/config/keyboardEvents.js index 9e580e3e0..4938ba94a 100644 --- a/src/jmapNew/config/keyboardEvents.js +++ b/src/jmapNew/config/keyboardEvents.js @@ -2,6 +2,16 @@ export const keyboardEvents = { Z: {altKey:false, ctrlKey:true, shiftKey:false, event: 'Ctrl_Z'}, // 绘图撤销 Y: {altKey:false, ctrlKey:true, shiftKey:false, event: 'Ctrl_Y'}, // 绘图恢复 DELETE: {altKey:false, ctrlKey:false, shiftKey:false, event: 'Delete'}, // 快捷删除绘图元素 - ENTER: {altKey:false, ctrlKey:false, shiftKey:false, event: 'Update'} // 快捷修改绘图元素 + ENTER: {altKey:false, ctrlKey:false, shiftKey:false, event: 'Update'}, // 快捷修改绘图元素 + ALT_W: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_W'}, + ALT_T: {alkKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_T'}, + ALT_G: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_G'}, + ALT_R: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_R'}, + ALT_V: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_V'}, + ALT_A: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_A'}, + ALT_O: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_O'}, + ALT_E: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_E'}, + ALT_S: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_S'}, + ALT_D: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_D'} }; diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index b16d70698..c4d516c32 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -563,12 +563,12 @@ class SkinCode extends defaultStyle { changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 specialTrainType: [ { - type: '03', + type: 'MANUAL', serviceNumber: 'MM', nameFormat: 'serviceNumber:groupNumber' }, { - type: '02', + type: 'HEAD', nameFormat: 'targetCode:groupNumber' } ], // 特殊列车类型需设置显示格式 @@ -586,12 +586,14 @@ class SkinCode extends defaultStyle { targetCodePrefix: '00', // 目的地码前缀 defaultTargetCode: 'AA', // 默认目的地码 trainTargetTextAlign: 'left', // 车次号文字显示位置 - trainNumberOffset: { x: 1, y: 1}// 目的地码偏移量 + trainNumberOffset: { x: 1, y: 1}, // 目的地码偏移量 + headTypeColor: '#FF0'// 头码车颜色 }, trainServer: { serviceNumberPrefix: '00', // 服务号(表号)前缀 defaultServiceNumber: 'BB', // 默认服务号(表号) - trainServerOffset: { x: 26, y: 1}// 列车服务号偏移 + trainServerOffset: { x: 26, y: 1}, // 列车服务号偏移 + manualTypeColor: '#FF0'// 人工车颜色 }, trainTarget: { tripNumberPrefix: '00', // 车次号前缀 diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 6fdca3673..b36b890c3 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -258,15 +258,22 @@ class Jlmap { } // const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); const oDevice = deviceFactory(type, elem, this.showConfig); - const nDevice = deepAssign(oDevice || {}, elem); + // const nDevice = deepAssign(oDevice || {}, elem); + // if (this.mapDevice[code]) { + // nDevice.instance = this.mapDevice[code].instance; // 保持相同 instance + // } + // this.$painter.delete(oDevice); + // delete this.mapDevice[code]; + // if (!elem._dispose) { + // this.mapDevice[code] = nDevice; + // this.$painter.add(nDevice); // 重新赋值instance + // } if (this.mapDevice[code]) { - nDevice.instance = this.mapDevice[code].instance; // 保持相同 instance + this.$painter.delete(this.mapDevice[code]); } - this.$painter.delete(oDevice); - delete this.mapDevice[code]; if (!elem._dispose) { - this.mapDevice[code] = nDevice; - this.$painter.add(nDevice); // 重新赋值instance + this.mapDevice[code] = deepAssign(this.mapDevice[code] || {}, oDevice); + this.$painter.add(this.mapDevice[code]); } }); diff --git a/src/jmapNew/shape/Train/TrainBody.js b/src/jmapNew/shape/Train/TrainBody.js index 05644d050..cf8be6bb6 100644 --- a/src/jmapNew/shape/Train/TrainBody.js +++ b/src/jmapNew/shape/Train/TrainBody.js @@ -346,7 +346,8 @@ export default class TrainBody extends Group { this.style.Train.trainTarget.planTypeColor && this.textTrainTrip && this.textTrainTrip.setStyle({textFill: this.style.Train.trainTarget.planTypeColor}); } else if (type === 'MANUAL') { this.style.Train.trainTargetNumber.manualTypeColor && this.textTrainGroup && this.textTrainGroup.setStyle({textFill: this.style.Train.trainTargetNumber.manualTypeColor}); - this.style.Train.trainNumber.headTypeColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainNumber.headTypeColor}); + this.style.Train.trainNumber.manualTypeColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainNumber.manualTypeColor}); + this.style.Train.trainServer.manualTypeColor && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.trainServer.manualTypeColor}); } else if (type === 'HEAD') { this.style.Train.trainTargetNumber.headTypeColor && this.textTrainGroup && this.textTrainGroup.setStyle({textFill: this.style.Train.trainTargetNumber.headTypeColor}); this.style.Train.trainNumber.headTypeColor && this.textTrainTarget && this.textTrainTarget.setStyle({textFill: this.style.Train.trainNumber.headTypeColor}); diff --git a/src/jmapNew/theme/components/menus/dialog/trainControl.vue b/src/jmapNew/theme/components/menus/dialog/trainControl.vue index 96c4e4dd5..eec49d440 100644 --- a/src/jmapNew/theme/components/menus/dialog/trainControl.vue +++ b/src/jmapNew/theme/components/menus/dialog/trainControl.vue @@ -37,13 +37,20 @@ :disabled="serverNoIsDisabled" /> - + + + + { - if (resp.data) { - this.formModel.serviceNumber = resp.data.serviceNumber; - this.formModel.destinationCode = resp.data.destinationCode; + try { + if (this.popClass === 'foshan-01__systerm') { + getTrainDetailByStNumber(this.$route.query.group, {stNumber: tripNumber}).then(resp => { + if (resp.data) { + this.formModel.serviceNumber = resp.data.serviceNumber; + this.formModel.tripNumber = resp.data.tripNumber; + this.formModel.destinationCode = resp.data.destinationCode; + } + }); + } else { + getTrainDetailBytripNumber(this.$route.query.group, {tripNumber:tripNumber}).then(resp => { + if (resp.data) { + this.formModel.serviceNumber = resp.data.serviceNumber; + this.formModel.destinationCode = resp.data.destinationCode; + } + }); } - }).catch(() => { + } catch (e) { + console.log(e); this.$message.error('获取列车信息失败!'); - }); + } + + // getTrainDetailBytripNumber(this.$route.query.group, {tripNumber:tripNumber}).then(resp => { + // if (resp.data) { + // this.formModel.serviceNumber = resp.data.serviceNumber; + // this.formModel.destinationCode = resp.data.destinationCode; + // } + // }).catch(() => { + // this.$message.error('获取列车信息失败!'); + // }); this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); diff --git a/src/jmapNew/theme/foshan_01/menus/menuTrain.vue b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue index 9f3c7ff83..5a7707890 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue @@ -5,6 +5,7 @@ + @@ -25,6 +26,7 @@ import TrainDefine from './dialog/trainDefine'; import TrainMove from './dialog/trainMove'; // import TrainEdit from './dialog/trainEdit'; import TrainSetPlan from './dialog/trainSetPlan'; +import TrainControl from '@/jmapNew/theme/components/menus/dialog/trainControl'; // import TrainMoveEvently from './dialog/trainMoveEvently'; // import TrainDeletePlan from './dialog/trainDeletePlan'; import TrainSetHead from './dialog/trainSetHead'; @@ -54,7 +56,8 @@ export default { TrainSetHead, TrainSetWork, trainSetWorkATP, - SetFault + SetFault, + TrainControl }, props: { selected: { @@ -82,7 +85,7 @@ export default { }, { label: '修改列车识别号', - handler: this.undeveloped, + handler: this.editTrainId, cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE }, { @@ -385,7 +388,7 @@ export default { this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDefine.doShow(step, this.selected); + this.$refs.trainControl.doShow(step, this.selected); } }); }, diff --git a/src/jmapNew/theme/ningbo_03/menus/menuBar.vue b/src/jmapNew/theme/ningbo_03/menus/menuBar.vue index ca709aad5..beaac72aa 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuBar.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuBar.vue @@ -34,6 +34,7 @@ {{ child.title }} +