From 28babc78f9287495a80c932eb3effe3a84992c3f Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 14 Jan 2021 16:03:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B2=94=E5=BF=83=20=E7=BB=98=E5=9B=BE?= =?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/tip.js | 2 +- src/i18n/langs/zh/tip.js | 2 +- src/jmapNew/shape/Section/ESeparator.js | 44 ++++++++++++++++++++----- src/jmapNew/shape/Section/index.js | 19 +++++------ src/views/newMap/mapsystemNew/index.vue | 2 +- src/views/system/configLine/config.vue | 7 ++-- 6 files changed, 50 insertions(+), 26 deletions(-) diff --git a/src/i18n/langs/en/tip.js b/src/i18n/langs/en/tip.js index 11b9b30e1..0909ac866 100644 --- a/src/i18n/langs/en/tip.js +++ b/src/i18n/langs/en/tip.js @@ -146,7 +146,7 @@ export default { deleteListHint: 'This will delete the list, will it continue?', setUpASubscriptionMapSuccessfully: 'Setting up a subscription map successfully!', setUpASubscriptionMapFailed: 'Setting up a subscription map failed!', - getMapStateDataException: 'Simulation error!', // Get map state data exception, please refresh the page to reload. If you encounter such problems many times, please contact the development team in an emergency! + getMapStateDataException: 'Simulation error! Please initial', // Get map state data exception, please refresh the page to reload. If you encounter such problems many times, please contact the development team in an emergency! packagedSuccessfully: 'Packaged successfully', oneKeyGeneratedSuccessfully: 'One key generated successfully!', obtainedPermissionSuccessfully: 'Successfully obtained permission', diff --git a/src/i18n/langs/zh/tip.js b/src/i18n/langs/zh/tip.js index fa2d4054c..851cb3b31 100644 --- a/src/i18n/langs/zh/tip.js +++ b/src/i18n/langs/zh/tip.js @@ -146,7 +146,7 @@ export default { deleteListHint: '此操作将删除该列表, 是否继续?', setUpASubscriptionMapSuccessfully: '设置订阅地图成功!', setUpASubscriptionMapFailed: '设置订阅地图失败!', - getMapStateDataException: '仿真出现异常!', // 获取地图状态数据异常,请刷新页面重新加载。若多次遇到此类问题,请急时联系开发团队处理! + getMapStateDataException: '仿真出现异常!请初始化', // 获取地图状态数据异常,请刷新页面重新加载。若多次遇到此类问题,请急时联系开发团队处理! packagedSuccessfully: '打包成功', oneKeyGeneratedSuccessfully: '一键生成成功!', obtainedPermissionSuccessfully: '领取权限成功', diff --git a/src/jmapNew/shape/Section/ESeparator.js b/src/jmapNew/shape/Section/ESeparator.js index 5121db447..0076b2450 100644 --- a/src/jmapNew/shape/Section/ESeparator.js +++ b/src/jmapNew/shape/Section/ESeparator.js @@ -117,17 +117,43 @@ export default class ESeparator extends Group { if (type === '01') { // 普通分割 let points = []; let lineWidth = 0; - const tanRate = modelData.traingle.getTanRate(); - if (style.Section.separator.sepical && modelData.type == '03' && tanRate != 0 && tanRate != 1) { - // 转换坐标系计算 - const dataDirection = modelData.traingle.getRotation() > 0 ? 1 : -1; + const tanRate = modelData.traingle.getSinRate(); + if (style.Section.separator.sepical && (modelData.type == '03' || modelData.type == '01') && tanRate != 0 && tanRate != 1) { + // debugger; + // // 转换坐标系计算 + // const dataDirection = modelData.traingle.getRotation() > 0 ? 1 : -1; + // points = [ + // [modelData.point.x - (style.Section.separator.halfHeight) * modelData.traingle.getCosRate(), + // modelData.point.y + dataDirection * (style.Section.separator.halfHeight) * modelData.traingle.getSinRate()], + // [modelData.point.x + (style.Section.separator.halfHeight) * modelData.traingle.getCosRate(), + // modelData.point.y - dataDirection * (style.Section.separator.halfHeight) * modelData.traingle.getSinRate()] + // ]; + // partition = this.createModel(modelData, points); + const direction = modelData.traingle.drictx * modelData.traingle.dricty > 0 ? 1 : -1; + const offset = style.Section.line.width / 2; points = [ - [modelData.point.x - (style.Section.separator.halfHeight) * modelData.traingle.getCosRate(), - modelData.point.y + dataDirection * (style.Section.separator.halfHeight) * modelData.traingle.getSinRate()], - [modelData.point.x + (style.Section.separator.halfHeight) * modelData.traingle.getCosRate(), - modelData.point.y - dataDirection * (style.Section.separator.halfHeight) * modelData.traingle.getSinRate()] + [modelData.point.x + modelData.drict * modelData.traingle.getSinRate() * offset, + modelData.point.y - direction * modelData.drict * modelData.traingle.getCosRate() * offset], + // [modelData.point.x, modelData.point.y] + [modelData.point.x - modelData.drict * modelData.traingle.getSinRate() * offset * 2, + modelData.point.y + direction * modelData.drict * modelData.traingle.getCosRate() * offset * 2], + [modelData.point.x - modelData.drict * offset * 2.5 / modelData.traingle.getSinRate(), + modelData.point.y - direction * modelData.drict * modelData.traingle.getCosRate() * offset], + [modelData.point.x + modelData.drict * modelData.traingle.getSinRate() * offset, + modelData.point.y - direction * modelData.drict * modelData.traingle.getCosRate() * offset] ]; - partition = this.createModel(modelData, points); + partition = new Polyline({ + zlevel: this.zlevel, + z: this.z, + shape: { + points: points + }, + style: { + lineWidth:1, + fill:this.style.Section.separator.color + } + }); + } else { points = [ [modelData.point.x, modelData.point.y - (style.Section.separator.halfHeight)], diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 1f547e9c8..c9c71bb17 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -256,28 +256,25 @@ export default class Section extends Group { this.line && this.line.setStyle({stroke: '#7F7F7F'}); this.name && this.name.setStyle({textFill: '#7F7F7f'}); } - handleSwitchSection(model, flag) { - // 哈尔滨线路 南京二 道岔相关区段设置 默认颜色 + /** 设置状态*/ + setState(model, flag = false) { + if (!this.isShowShape) return; + this.recover(); + // 哈尔滨线路 道岔相关区段设置 默认颜色 if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) { const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode]; - if (switchModel && (switchModel.normalPosition === 1 || (switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse'))) { // 定位情况 + if (switchModel && switchModel.normalPosition != 0) { // 定位情况 const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.line.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.setState(sectionB, true); - } else if (switchModel && switchModel.reversePosition === 1 || (switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal')) { // 反位情况 + } else if (switchModel && switchModel.normalPosition == 0) { // 反位情况 const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.line.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.setState(sectionC, true); } } - } - /** 设置状态*/ - setState(model, flag = false) { - if (!this.isShowShape) return; - this.recover(); - this.handleSwitchSection(model, flag); // 顺序代表优先级 /** 道岔保护区段锁闭 */ model.overlapLock && this.protectiveLock(model.lockRight); @@ -349,7 +346,7 @@ export default class Section extends Group { } } }); - this.on('mouseover', () => { // 移入 + this.on('mouseover', (event) => { // 移入 if (!this.selectedType && this.line) { this.line.setStyle({ stroke: '#fbfbfb', lineWidth: this.style.Section.line.width - 0.2 }); this.line.setCross({fill:'#fbfbfb'}); diff --git a/src/views/newMap/mapsystemNew/index.vue b/src/views/newMap/mapsystemNew/index.vue index bccc43161..a9a93c14c 100644 --- a/src/views/newMap/mapsystemNew/index.vue +++ b/src/views/newMap/mapsystemNew/index.vue @@ -103,7 +103,7 @@ export default { showCancelButton: false, type: 'warning' }).then(() => { - this.$emit('back'); + // this.$emit('back'); }).catch(() => { }); }, diff --git a/src/views/system/configLine/config.vue b/src/views/system/configLine/config.vue index 8ede03fea..1cc8ec3c8 100644 --- a/src/views/system/configLine/config.vue +++ b/src/views/system/configLine/config.vue @@ -77,9 +77,9 @@ export default { height: 800, roadData: [], focus: false, - booleanList: ['upRight', 'lockFirst', 'switchSingleHandle', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack', 'doNotSetRouteWhenSectionOccupied'], + booleanList: ['upRight', 'lockFirst', 'switchSingleHandle', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack', 'doNotSetRouteWhenSectionOccupied', 'routeSettingNoFail'], selectList: ['runMode'], - generalConfig: ['lockFirst', 'switchSingleHandle', 'upRight', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'runMode', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'noParkingSM', 'parkingSM', 'rmAtpSpeed', 'urmAtpSpeed', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack', 'doNotSetRouteWhenSectionOccupied'], + generalConfig: ['lockFirst', 'switchSingleHandle', 'upRight', 'switchNRTurnChain', 'switchSingleLockChain', 'switchLossChain', 'signalForceCancelRoute', 'runMode', 'initSingleLockSwitch', 'ctcOverlapOnlyTurnBackStationLock', 'noParkingSM', 'parkingSM', 'rmAtpSpeed', 'urmAtpSpeed', 'guideNeedRouteSettingFirst', 'signalOpenAfterParking', 'standHoldCloseLogicLight', 'atsAutoHandleManualFrontTurnBack', 'doNotSetRouteWhenSectionOccupied', 'routeSettingNoFail'], rangeList: ['noParkingSM', 'parkingSM'], speedList: ['rmAtpSpeed', 'urmAtpSpeed'], numberList: [], @@ -105,7 +105,8 @@ export default { signalOpenAfterParking: '是否列车停站开门后,才办理出站进路开放出站信号机', standHoldCloseLogicLight: '站台扣车是否关闭逻辑点灯的信号机', atsAutoHandleManualFrontTurnBack:'ATS是否自动处理人工设置的站前折返自动更新车次', - doNotSetRouteWhenSectionOccupied: '当进路的区段占用时不排列进路' + doNotSetRouteWhenSectionOccupied: '当进路的区段占用时不排列进路', + routeSettingNoFail:'进路办理不失败' } }; }, From ab804e3b95fc40f0d602a642d0632945d2f3b021 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 14 Jan 2021 16:26:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E4=BA=8C=E5=8F=B7?= =?UTF-8?q?=E7=BA=BF=E7=8A=B6=E6=80=81=E8=B0=83=E6=95=B4=20=E9=81=93?= =?UTF-8?q?=E5=B2=94=E9=95=BF=E9=97=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/nanjing_02.js | 4 +++- src/jmapNew/shape/Section/index.js | 27 +++++++++++++++++++---- src/jmapNew/shape/Switch/index.js | 22 +++++++++++++----- 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index 87ff93445..4ba2d4617 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -159,7 +159,8 @@ class SkinCode extends defaultStyle { textPosition: 'inside', // 文字位置 textVerticalAlign: 'middle' // 文字垂直对齐方式 } - } + }, + switchFault: true // 南京二号线 道岔失败(长闪) }; this[deviceType.Signal] = { @@ -512,6 +513,7 @@ class SkinCode extends defaultStyle { this[deviceType.Switch] = { shapeFlash: true, // 道岔转动失去表示 道岔遮罩删除 + faultNoHandle: true, // 南京二 道岔长闪 道岔无状态 道岔区段 bc 闪烁 text: { show: true, // 道岔名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 1f547e9c8..34ced7994 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -260,17 +260,36 @@ export default class Section extends Group { // 哈尔滨线路 南京二 道岔相关区段设置 默认颜色 if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) { const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode]; + const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; + const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; if (switchModel && (switchModel.normalPosition === 1 || (switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse'))) { // 定位情况 - const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.line.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); - const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.setState(sectionB, true); } else if (switchModel && switchModel.reversePosition === 1 || (switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal')) { // 反位情况 - const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.line.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); - const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.setState(sectionC, true); } + if (this.style.Section.switchFault && switchModel.split) { + if (sectionB && sectionB.instance) { + sectionB.instance.setState(sectionB, true); + sectionB.instance.line.animateStyle(true, [ + { time: 0, styles: { stroke: this.style.Section.line.spareColor } }, + { time: 500, styles: { stroke: this.style.backgroundColor } }, + { time: 1000, styles: { stroke: this.style.Section.line.spareColor } } + ]); + } + if (sectionC && sectionC.instance) { + sectionC.instance.setState(sectionC, true); + sectionC.instance.line.animateStyle(true, [ + { time: 0, styles: { stroke: this.style.Section.line.spareColor } }, + { time: 500, styles: { stroke: this.style.backgroundColor } }, + { time: 1000, styles: { stroke: this.style.Section.line.spareColor } } + ]); + } + } else { + if (sectionB && sectionB.instance) { sectionB.instance.line.stopAnimation(true); } + if (sectionC && sectionC.instance) { sectionC.instance.line.stopAnimation(true); } + } } } /** 设置状态*/ diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index c88116a90..08c04a173 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -311,7 +311,7 @@ export default class Switch extends Group { } } // 南京二号线 A,B闪烁 - shapeFlashing() { + shapeFlashing(split) { let bColor = '#7F7F7F'; let aColor = '#7F7F7F'; if (this.switchPosition === 'normal') { @@ -319,17 +319,25 @@ export default class Switch extends Group { } else { bColor = '#FF0'; } - this.shapeModelB && this.shapeModelB.animateStyle(bColor, this.style.backgroundColor); + // 南京二号线道岔短闪两部分相位不同 this.shapeModelA && this.shapeModelA.animateStyle(aColor, this.style.backgroundColor); + setTimeout(() => { + this.shapeModelB && this.shapeModelB.animateStyle(bColor, this.style.backgroundColor); + }, 100); + if (split) { + this.shapeModelA.hide(); + this.shapeModelB.hide(); + this.shapeModelC.hide(); + } } /** 失去*/ - setLossAction() { + setLossAction(split) { this.shapeModelA.show(); this.shapeModelB.show(); this.shapeModelC.show(); this.shapeModelC.setColor(this.style.backgroundColor); this.shapeModelB.animateStyle(); - this.style.Switch.shapeFlash && this.shapeFlashing(); + this.style.Switch.shapeFlash && this.shapeFlashing(split); this.setTextColor(this.style.Switch.text.lossColor); this.style.Switch.text.faultFlashing && this.nameTextAnimation(); @@ -343,6 +351,10 @@ export default class Switch extends Group { setSwitchFault(split, normalPosition, reversePosition) { if (this.style.Switch.jointImg.faultStatus && split && !reversePosition && !normalPosition ) { // 宁波线失表状态 this.setForkAction(); // 道岔挤岔 + } else if (this.style.Switch.faultNoHandle ) { + this.shapeModelA.hide(); + this.shapeModelB.hide(); + this.shapeModelC.hide(); } else { if (this.model.switchFaultCode && split) { const switchFault = store.getters['map/getDeviceByCode'](this.model.switchFaultCode); @@ -544,7 +556,7 @@ export default class Switch extends Group { this.switchPosition = 'reverse'; this.setInversionAction(model); /** 反位*/ } else { - this.setLossAction(); // 失去 + this.setLossAction(model.split); // 失去 } model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示 From 3dd6696140e9b5028285c331fbd91272ee7ba4fe Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 14 Jan 2021 16:59:41 +0800 Subject: [PATCH 3/4] =?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/shape/Section/ESeparator.js | 6 ++++++ src/views/components/systemTime/separator.vue | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/jmapNew/shape/Section/ESeparator.js b/src/jmapNew/shape/Section/ESeparator.js index 0076b2450..f3ed05416 100644 --- a/src/jmapNew/shape/Section/ESeparator.js +++ b/src/jmapNew/shape/Section/ESeparator.js @@ -12,6 +12,12 @@ export default class ESeparator extends Group { this.z = model.z || 6; this.style = model.style; this.create(); + this.on('click', (eve)=>{ + eve.cancelBubble = true; + }); + this.on('mouseover', (eve)=>{ + eve.cancelBubble = true; + }); } create() { diff --git a/src/views/components/systemTime/separator.vue b/src/views/components/systemTime/separator.vue index 34121c49e..ffdb12904 100644 --- a/src/views/components/systemTime/separator.vue +++ b/src/views/components/systemTime/separator.vue @@ -1,5 +1,5 @@