From 14e054b0ab48020a04acb6d34fcd199e82b92b83 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Fri, 6 Mar 2020 20:35:53 +0800 Subject: [PATCH 01/14] =?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/config/skinCode/haerbin_01.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 76851b190..5b9af2f6c 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -491,7 +491,13 @@ class SkinCode extends defaultStyle { trainNameFormat: 'tripNumber:serviceNumber:groupNumber'// 列车显示格式 }, hsda: { - trainHSDATextFontSize: 8// 列车HDSA字号 + lrPaddingHSDA: 3, // HSDA两边间隔 + upPaddingHSDA: 20, // HSDA上边距离 + trainHSDATextFontSize: 8, // 列车HDSA字号 + textHContent: '扣', // textH文本 + textSContent: '跳', // textS文本 + textDContent: '门', // textD文本 + textAContent: '警' // textA文本 }, trainAtrStatus: { trainAtrStatusOffset: { x: 68, y: 9}, From 5d39b8e84e5c7368657351f042c7b3cfd7b526fa Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 11 Mar 2020 10:53:09 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E7=BB=98=E5=9B=BE=E6=98=BE=E7=A4=BA?= =?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/i18n/langs/en/map.js | 6 +- src/i18n/langs/zh/map.js | 8 +- src/jmapNew/map.js | 11 +- src/jmapNew/shape/Text/index.js | 17 ++- src/jmapNew/shape/utils/handlePath.js | 16 +-- src/jmapNew/utils/handlePath.js | 25 +++++ src/jmapNew/utils/parser.js | 4 +- src/views/newMap/jlmapNew/index.vue | 10 +- .../newMap/jlmapNew/pendant/showMode.vue | 104 ++++++++++++++++++ .../jlmapNew/{zoom => pendant}/zoom.vue | 90 +++++++-------- .../dataRelation/routeoperate/detail.vue | 32 +++--- src/views/newMap/newMapdraft/index.vue | 2 +- 12 files changed, 243 insertions(+), 82 deletions(-) create mode 100644 src/jmapNew/utils/handlePath.js create mode 100644 src/views/newMap/jlmapNew/pendant/showMode.vue rename src/views/newMap/jlmapNew/{zoom => pendant}/zoom.vue (51%) diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index 98746137f..72cb8a8ff 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -605,5 +605,9 @@ export default { whetherAutoRoute: 'Whether auto route', hostileData: 'Hostile data', routeContinuesToProtectSectorData: 'Route continues to protect sector data', - physicalSectionID: 'Physical section id' + physicalSectionID: 'Physical section ID', + physicalSectionName: 'Physical section name', + routePhysicalSectionData: 'Route physical section data', + routeSideDefenseSwitch: 'Route side defense switch', + switchID: 'Switch ID' }; diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index d2a845f57..68f5800cd 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -598,5 +598,11 @@ export default { whetherAutoRoute: '是否自定进路', hostileData: '敌对数据', routeContinuesToProtectSectorData: '进路延续保护区段数据', - physicalSectionID: '物理区段ID' + physicalSectionID: '物理区段ID', + physicalSectionName: '物理区段名称', + routePhysicalSectionData: '进路物理区段数据', + routeSideDefenseSwitch: '进路侧防道岔', + switchID: '道岔ID', + normalPosition: '定位', + reversePosition: '反位' }; diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 6d0a32ca3..99b158d20 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -10,6 +10,7 @@ import deviceType from './constant/deviceType'; import { selectLineCode } from './config/deviceStyle'; import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser'; import { deepAssign } from '@/utils/index'; +import { getPrdType, isPreviewOrMapDraw } from './utils/handlePath'; import store from '@/store'; const renderer = 'canvas'; @@ -61,6 +62,9 @@ class Jlmap { this.$keyboardController = new KeyboardController(this); this.$keyboardController.enable(); + this.prdType = getPrdType(); + this.previewOrMapDraw = isPreviewOrMapDraw(); + this.showMode = '03'; // 预览和绘图下默认是现地状态 } loadStyle(lineCode) { @@ -159,7 +163,8 @@ class Jlmap { (list || []).forEach(elem => { const code = elem.code; const type = elem._type; - const oDevice = this.mapDevice[code] || deviceFactory(type, elem); + const showConfig = {prdType: this.prdType, previewOrMapDraw: this.previewOrMapDraw, showMode: this.showMode}; + const oDevice = this.mapDevice[code] || deviceFactory(type, elem, showConfig); const nDevice = deepAssign(oDevice || {}, elem); this.$painter.delete(oDevice); delete this.mapDevice[code]; @@ -246,7 +251,7 @@ class Jlmap { const code = elem.code; const type = elem._type; const oDevice = this.mapDevice[code] || deviceFactory(type, elem); - this.hookHandle(oDevice, elem) + this.hookHandle(oDevice, elem); }); } update(list) { @@ -268,7 +273,7 @@ class Jlmap { this.$painter.delete(oDevice); } else { // if (this.hookHandle(oDevice, elem)) { - this.$painter.update(oDevice); + this.$painter.update(oDevice); // } } } diff --git a/src/jmapNew/shape/Text/index.js b/src/jmapNew/shape/Text/index.js index 6b197771c..e289bcdae 100644 --- a/src/jmapNew/shape/Text/index.js +++ b/src/jmapNew/shape/Text/index.js @@ -1,6 +1,6 @@ import Text from 'zrender/src/graphic/Text'; import Group from 'zrender/src/container/Group'; -import {getPrdType, isShowThePrdType} from '../utils/handlePath'; +import { isShowThePrdType } from '../utils/handlePath'; export default class Text2 extends Group { constructor(model, style) { @@ -12,11 +12,13 @@ export default class Text2 extends Group { this.model = model; this.style = style; this.z = 6; - this.prdType = getPrdType(); - if (isShowThePrdType(this.prdType, model.showConditions)) { + if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) { this.create(); this.setState(model); } + if (model.previewOrMapDraw) { + this.setShowMode(); + } } create() { @@ -45,4 +47,13 @@ export default class Text2 extends Group { setState(model) { } + setShowMode() { + const showMode = this.model.showMode; + const showConditions = this.model.showCondition; + if (!showConditions || showConditions === '01' || showMode === showConditions) { + this.text.show(); + } else { + this.text.hide(); + } + } } diff --git a/src/jmapNew/shape/utils/handlePath.js b/src/jmapNew/shape/utils/handlePath.js index aa92d6364..034ea8b28 100644 --- a/src/jmapNew/shape/utils/handlePath.js +++ b/src/jmapNew/shape/utils/handlePath.js @@ -12,14 +12,14 @@ export function getPrdType() { return prdType; } export function isShowThePrdType (prdType, showConditions) { - const path = window.location.href; - if (path.indexOf('map/draw') !== -1 ) { + if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) { return true; - } else { - if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) { - return true; - } else if (!showConditions) { - return true; // 兼容老数据没有showConditions - } + } else if (!showConditions) { + return true; // 兼容老数据没有showConditions } + +} +export function isPreviewOrMapDraw() { + const path = window.location.href; + return path.indexOf('map/draw') !== -1 || path.indexOf('mapPreviewNew') !== -1; } diff --git a/src/jmapNew/utils/handlePath.js b/src/jmapNew/utils/handlePath.js new file mode 100644 index 000000000..034ea8b28 --- /dev/null +++ b/src/jmapNew/utils/handlePath.js @@ -0,0 +1,25 @@ +export function getPrdType() { + let prdType = ''; + const path = window.location.href; + if (path.includes('?')) { + const arr = window.location.href.split('?')[1].split('&'); + arr.forEach(elem => { + if (elem.split('=')[0] === 'prdType') { + prdType = elem.split('=')[1]; + } + }); + } + return prdType; +} +export function isShowThePrdType (prdType, showConditions) { + if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) { + return true; + } else if (!showConditions) { + return true; // 兼容老数据没有showConditions + } + +} +export function isPreviewOrMapDraw() { + const path = window.location.href; + return path.indexOf('map/draw') !== -1 || path.indexOf('mapPreviewNew') !== -1; +} diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index ee489847d..d7163345d 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -30,8 +30,8 @@ export function calculateDCenter(viewRect, zrbound) { return { dx: dx, dy: dy }; } -export function deviceFactory(type, elem) { - return {...deviceRender[type], ...elem}; +export function deviceFactory(type, elem, showConfig) { + return {...deviceRender[type], ...elem, ...showConfig}; } export function createDevice(type, elem, propConvert) { diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index a15641cee..d87a07a67 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -4,6 +4,7 @@