From 692f30fd9f209f2610bc1ef82ae6b6d3ef6848ba Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 2 Mar 2020 14:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=92=8C=E5=88=97=E8=BD=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/bejing_01.js | 2 +- src/jmapNew/config/skinCode/chengdu_01.js | 2 +- src/jmapNew/config/skinCode/chengdu_03.js | 2 +- src/jmapNew/config/skinCode/fuzhou_01.js | 2 +- src/jmapNew/config/skinCode/haerbin_01.js | 63 +++++++++----- src/jmapNew/config/skinCode/ningbo_01.js | 4 +- src/jmapNew/shape/Train/TrainBody.js | 96 ++++++++++++++++++++-- src/jmapNew/shape/Train/TrainBodyBox.js | 2 +- src/jmapNew/theme/ningbo_01/planConvert.js | 1 - src/store/modules/socket.js | 1 - src/views/planMonitor/detail.vue | 1 + 11 files changed, 142 insertions(+), 34 deletions(-) diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index e70f120e8..ee420dc91 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -498,7 +498,7 @@ class SkinCode extends defaultStyle { trainTargetTextAlign: 'left'// 车次号文字显示位置 }, trainTargetNumber: { - trainTargetNumberOffset: { x: 0, y: 0 }// 车组号偏移量 + trainTargetNumberOffset: { x: -4, y: 4 }// 车组号偏移量 }, trainHead: { trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index f5a33b0a6..128d0b0f4 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -452,7 +452,7 @@ class SkinCode extends defaultStyle { trainTargetTextAlign: 'right' // 车次号文字显示位置 }, trainTargetNumber: { - trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量 + trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 }, trainHead: { trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 86a6bb1b6..9640cb797 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -465,7 +465,7 @@ class SkinCode extends defaultStyle { trainTargetTextAlign: 'right' // 车次号文字显示位置 }, trainTargetNumber: { - trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量 + trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 }, trainHead: { trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 935bbd412..4094342bd 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -473,7 +473,7 @@ class SkinCode extends defaultStyle { trainTargetNumber: { groupNumberPrefix: '000', // 车组号前缀 defaultGroupNumber: 'EEE', // 默认车组号 - trainTargetNumberOffset: {x: 0, y: 1}// 车组号偏移量 + trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量 }, trainHead: { trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index ed0af2f8b..a62a42bc5 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -444,48 +444,64 @@ class SkinCode extends defaultStyle { this[deviceType.Train] = { trainBody: { - trainBodyLineWidth: 0, // 车身line宽 - changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 + trainBodyLineWidth: 2, // 车身line宽 + changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 specialTrainType: [ { type: '03', serviceNumber: 'MM', - nameFormat: 'serviceNumber:groupNumber' + nameFormat: 'tripNumber:serviceNumber:groupNumber' }, { type: '02', - nameFormat: 'targetCode:groupNumber' + nameFormat: 'tripNumber:serviceNumber:groupNumber' } ], // 特殊列车类型需设置显示格式 lrPadding: 1, // 两边间隔 upPadding: 1, // 上边距离 trainBodyFillColor: '#000000', // 列车车身填充颜色 - trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式 + trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式 }, hsda: { trainHSDATextFontSize: 8// 列车HDSA字号 }, + trainAtrStatus: { + trainAtrStatusOffset: { x: 80, y: 9}, + r: 5 + }, + travelSigns: { + trainTravelSignsOffset: { x:3, y: 3} + }, + delayTime: { + trainDelayTimeOffset: { x:5, y: 14} + }, + crewNum: { + trainCrewNumOffset: { x:60, y: 25} + }, + travelNum: { + trainTravelNumOffset: { x:48, y:3} + }, trainNumber: { targetCodePrefix: '000', // 目的地码前缀 defaultTargetCode: 'AAA', // 默认目的地码 trainTargetTextAlign: 'left', // 车次号文字显示位置 - trainNumberOffset: { x: 1, y: 1 }// 目的地码偏移量 + trainNumberOffset: { x: 48, y: 3 }// 目的地码偏移量 }, trainServer: { serviceNumberPrefix: '00', // 服务号(表号)前缀 defaultServiceNumber: 'BB', // 默认服务号(表号) - trainServerOffset: { x: 26, y: 1 }// 列车服务号偏移 + trainServerOffset: { x: 35, y: 3 }// 列车服务号偏移 }, trainTarget: { - tripNumberPrefix: '<', // 车次号前缀 - defaultDirectionCode: 'D', // 默认车次号1 + tripNumberPrefix: '000', // 车次号前缀 + defaultDirectionCode: '', // 默认车次号1 defaultTripNumber: 'CCC', // 默认车次号2 - trainTargetOffset: { x: 42, y: 1 }// 列车车次号偏移 + trainTargetOffset: { x: 10, y: 3 }// 列车车次号偏移 }, trainTargetNumber: { groupNumberPrefix: '000', // 车组号前缀 defaultGroupNumber: 'EEE', // 默认车组号 - trainTargetNumberOffset: { x: 0, y: 1 }// 车组号偏移量 + trainTargetNumberOffset: { x: 5, y: 25 }// 车组号偏移量 }, trainHead: { trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 @@ -497,12 +513,20 @@ class SkinCode extends defaultStyle { trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色 }, common: { - trainHeight: 30, // 列车高度 + hasTravelSigns: true, // 是否有行进标志 + hasAtrStatus: true, // 是否有atr状态 + hasDelayTime: true, // 是否有延迟时间 + hasCrewNum: true, // 是否有乘务组号 + hasTravelNum: true, // 是否有行程号 + useSelfFormat: true, + useSelfText: true, + fixedCoordinates: true, // 列车车组号等固定坐标 + trainHeight: 40, // 列车高度 trainHeadDistance: 2, // 列车和车头之间的间距 - trainWidth: 76, // 列车长度 - trainTextFontSize: 15, // 列车字号 + trainWidth: 90, // 列车长度 + trainTextFontSize: 12, // 列车字号 fontFamily: 'consolas', // 默认字体 族类 - nameFontSize: 15, // 字体大小 + nameFontSize: 12, // 字体大小 haveTextHSDA: false, // 是否需创建textHSDA对象 haveArrowText: true, // 是否需创建arrowText对象 haveTrainBorder: false, // 是否需创建trainBorder对象 @@ -512,6 +536,7 @@ class SkinCode extends defaultStyle { displayPosition: 'margin' // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 }, trainStatusStyle: { + defaultDestinationColor: '#FFFF00', // 默认目的地状态显示颜色 destinationStatus: [ { status: '01', showColor: '#FFFF00' }, { status: '02', showColor: '#00FF00' }, @@ -528,19 +553,19 @@ class SkinCode extends defaultStyle { lineLShow: false, lineRShow: false, arrowLShow: false, - arrowRShow: true + arrowRShow: false }, { type: 0, lineLShow: false, lineRShow: false, - arrowLShow: true, + arrowLShow: false, arrowRShow: false } ], // 运行方向状态类型对应车头显示状态 1从左往右 0从右往左 directionStopType: [ - { type: 1, lineLShow: false, lineRShow: true }, - { type: 0, lineLShow: true, lineRShow: false } + { type: 1, lineLShow: false, lineRShow: false }, + { type: 0, lineLShow: false, lineRShow: false } ], // 列车停止方向类型对应车头显示状态 1从左往右 0从右往左 driveModeStatus: [ { diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 64891e84f..23004c57e 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -453,7 +453,7 @@ class SkinCode extends defaultStyle { trainTargetTextAlign: 'right' // 车次号文字显示位置 }, trainTargetNumber: { - trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量 + trainTargetNumberOffset: {x: -4, y: 4}// 车组号偏移量 }, trainHead: { trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框 @@ -467,7 +467,7 @@ class SkinCode extends defaultStyle { common: { trainHeight: 20, // 列车高度 trainHeadDistance: 2, // 列车和车头之间的间距 - trainWidth: 55, // 列车长度 + trainWidth: 57, // 列车长度 trainTextFontSize: 16, // 列车字号 fontFamily: 'consolas', // 默认字体 族类 haveTextHSDA: true, // 是否需创建textHSDA对象 diff --git a/src/jmapNew/shape/Train/TrainBody.js b/src/jmapNew/shape/Train/TrainBody.js index 86a9a54fe..279ffdc69 100644 --- a/src/jmapNew/shape/Train/TrainBody.js +++ b/src/jmapNew/shape/Train/TrainBody.js @@ -4,6 +4,7 @@ import '../StationStand/EDetain'; import ETextName from '../element/ETextName'; // 名称文字 (共有) import EMouse from './EMouse'; import store from '@/store'; +import Circle from 'zrender/src/graphic/shape/Circle'; /** 车身*/ export default class TrainBody extends Group { @@ -144,8 +145,8 @@ export default class TrainBody extends Group { this.textTrainTargetNumber = new ETextName({ zlevel: model.zlevel, z: model.z+1, - x: parseInt(model.point.x - style.Train.trainBody.lrPadding), - y: parseInt(model.point.y + style.Train.trainBody.upPadding), + x: parseInt(model.point.x + style.Train.trainTargetNumber.trainTargetNumberOffset.x), + y: parseInt(model.point.y + style.Train.trainTargetNumber.trainTargetNumberOffset.y), text: groupNumber.substring(groupNumber.length - 3), textFill: style.trainTextColor, textStroke: style.trainTextColor, @@ -163,6 +164,89 @@ export default class TrainBody extends Group { this.add(this.textD); this.add(this.textA); } + if (style.Train.common.hasAtrStatus) { + this.atrStatus = new Circle({ + zlevel: model.zlevel, + z: model.z + 1, + shape: { + cx: parseInt(model.point.x + style.Train.trainAtrStatus.trainAtrStatusOffset.x), + cy: parseInt(model.point.y + style.Train.trainAtrStatus.trainAtrStatusOffset.y), + r: style.Train.trainAtrStatus.r + }, + style: { + fill: '#ff0000' + } + }); + this.add(this.atrStatus); + } + if (style.Train.common.hasTravelSigns) { + this.travelSigns = new ETextName({ + zlevel: model.zlevel, + z: model.z + 1, + x: parseInt(model.point.x + style.Train.travelSigns.trainTravelSignsOffset.x), + y: parseInt(model.point.y + style.Train.travelSigns.trainTravelSignsOffset.y), + text: '<', + textFill: style.trainTextColor, + textStroke: style.trainTextColor, + textStrokeWidth: 0, + fontSize: model.fontSize, + fontFamily: style.Train.common.fontFamily, + textAlign: 'left', + textVerticalAlign: 'top' + }); + this.add(this.travelSigns); + } + if (style.Train.common.hasCrewNum) { + this.crewNum = new ETextName({ + zlevel: model.zlevel, + z: model.z + 1, + x: parseInt(model.point.x + style.Train.crewNum.trainCrewNumOffset.x), + y: parseInt(model.point.y + style.Train.crewNum.trainCrewNumOffset.y), + text: 'BBB', + textFill: style.trainTextColor, + textStroke: style.trainTextColor, + textStrokeWidth: 0, + fontSize: model.fontSize, + fontFamily: style.Train.common.fontFamily, + textAlign: 'left', + textVerticalAlign: 'top' + }); + this.add(this.crewNum); + } + if (style.Train.common.hasTravelNum) { + this.travelNum = new ETextName({ + zlevel: model.zlevel, + z: model.z + 1, + x: parseInt(model.point.x + style.Train.travelNum.trainTravelNumOffset.x), + y: parseInt(model.point.y + style.Train.travelNum.trainTravelNumOffset.y), + text: 'AA', + textFill: style.trainTextColor, + textStroke: style.trainTextColor, + textStrokeWidth: 0, + fontSize: model.fontSize, + fontFamily: style.Train.common.fontFamily, + textAlign: 'left', + textVerticalAlign: 'top' + }); + this.add(this.travelNum); + } + if (style.Train.common.hasDelayTime) { + this.delayTime = new ETextName({ + zlevel: model.zlevel, + z: model.z + 1, + x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x), + y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y), + text: '0', + textFill: style.trainTextColor, + textStroke: style.trainTextColor, + textStrokeWidth: 0, + fontSize: model.fontSize, + fontFamily: style.Train.common.fontFamily, + textAlign: 'left', + textVerticalAlign: 'top' + }); + this.add(this.delayTime); + } } removeTrainDetail() { @@ -218,19 +302,19 @@ export default class TrainBody extends Group { let widthText = 0; arr.forEach(ele => { if (ele == 'targetCode') { - this.textTrainNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset) ); + !style.Train.common.fixedCoordinates && this.textTrainNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset) ); widthText += this.textTrainNumber.getBoundingRect().width; this.add(this.textTrainNumber); } else if (ele == 'serviceNumber') { - this.textTrainServer.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset)); + !style.Train.common.fixedCoordinates && this.textTrainServer.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset)); widthText += this.textTrainServer.getBoundingRect().width; this.add(this.textTrainServer); } else if (ele == 'tripNumber') { - this.textTrainTarget.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset)); + !style.Train.common.fixedCoordinates && this.textTrainTarget.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset)); widthText += this.textTrainTarget.getBoundingRect().width; this.add(this.textTrainTarget); } else if (ele == 'groupNumber') { - this.textTrainTargetNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset)); + !style.Train.common.fixedCoordinates && this.textTrainTargetNumber.setStyle('x', parseInt(model.point.x + widthText + style.Train.common.textOffset)); widthText += this.textTrainTargetNumber.getBoundingRect().width; this.add(this.textTrainTargetNumber); } diff --git a/src/jmapNew/shape/Train/TrainBodyBox.js b/src/jmapNew/shape/Train/TrainBodyBox.js index d3e442232..af944c736 100644 --- a/src/jmapNew/shape/Train/TrainBodyBox.js +++ b/src/jmapNew/shape/Train/TrainBodyBox.js @@ -9,7 +9,7 @@ export default class TrainBodyBox extends Group { } create() { const model = this.model; - this.trainBodyBox = new Rect({ + this.trainBodyBox = new Rect({ zlevel: model.zlevel, z: model.z, shape: { diff --git a/src/jmapNew/theme/ningbo_01/planConvert.js b/src/jmapNew/theme/ningbo_01/planConvert.js index cd986201b..8f2fc6dc3 100644 --- a/src/jmapNew/theme/ningbo_01/planConvert.js +++ b/src/jmapNew/theme/ningbo_01/planConvert.js @@ -23,7 +23,6 @@ export default { /** 解析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]; }); // 设置不用过滤行数 diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 1efba2242..7fbc857b4 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -25,7 +25,6 @@ function handle(state, data) { break; case 'Simulation_RunFact': // 仿真-列车实际到发车站消息 let runFactMsg = msg; - console.log(msg, '----------------'); if (runFactMsg.constructor !== Array ) { runFactMsg = [msg]; } diff --git a/src/views/planMonitor/detail.vue b/src/views/planMonitor/detail.vue index 6dff837c2..f2af91f1e 100644 --- a/src/views/planMonitor/detail.vue +++ b/src/views/planMonitor/detail.vue @@ -167,6 +167,7 @@ export default { watch: { '$route' () { this.getRunPlanList(); + this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.lineCode); } }, created() {