From 11b2ee8130e7ddcc3602ac50bd561d831e186d99 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 18 Mar 2020 10:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 1 - src/jmapNew/shape/Automactic/index.js | 21 +++++++++++++++++-- src/jmapNew/shape/AutomacticRoute/index.js | 17 +++++++++++++++ src/jmapNew/shape/AxleReset/index.js | 16 ++++++++++++++ src/jmapNew/shape/GuideLock/index.js | 15 +++++++++++++ .../menus/dialog/turnBackControl.vue | 19 ++++++++++------- .../ningbo_01/menus/menuAutoTrunRoute.vue | 5 ++--- src/scripts/cmdPlugin/MenuContextHandler.js | 4 ++-- .../newMapdraft/mapoperate/ControlDraft.vue | 7 +++---- .../newMap/newMapdraft/mapoperate/index.vue | 2 +- 10 files changed, 87 insertions(+), 20 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index b829fef1c..47d686e18 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -282,7 +282,6 @@ class Jlmap { } else if (oDevice._type === deviceType.Section) { this.$painter.updateShowStation(oDevice, stationCode); this.showStationHandleSection(oDevice, stationCode); - } else if (oDevice._type === deviceType.TrainWindow) { } else if (oDevice._type === deviceType.Psd) { this.showStationHandlePsd(oDevice, stationCode); } else { diff --git a/src/jmapNew/shape/Automactic/index.js b/src/jmapNew/shape/Automactic/index.js index f139f8cb8..459e1faee 100644 --- a/src/jmapNew/shape/Automactic/index.js +++ b/src/jmapNew/shape/Automactic/index.js @@ -6,6 +6,7 @@ import Arc from 'zrender/src/graphic/shape/Arc'; import Text from 'zrender/src/graphic/Text'; import Rect from 'zrender/src/graphic/shape/Rect'; import EMouse from './EMouse'; +import BoundingRect from 'zrender/src/core/BoundingRect'; import {isShowThePrdType} from '../../utils/handlePath'; export default class Automactic extends Group { @@ -105,7 +106,7 @@ export default class Automactic extends Group { // 设置状态 setState(model) { - if (!this.isShowShape) return; + // model.show && this.handleSignal(); } createMouseEvent() { @@ -131,7 +132,7 @@ export default class Automactic extends Group { getShapeTipPoint() { if (this.control) { var distance = 2; - var rect = this.control.getBoundingRect(); + var rect = this.getArcBoundingRect(); return { x: rect.x + rect.width / 2, y: rect.y - distance @@ -139,6 +140,22 @@ export default class Automactic extends Group { } return null; } + + getBoundingRect() { // 计算自动折返包围框 + if (this.control) { + const rect = this.control.getBoundingRect().clone(); + if (this.text) { + const text = this.text.getBoundingRect().clone(); + rect.union(text); + return rect; + } else { + return rect; + } + } else { + return new BoundingRect(0, 0, 0, 0); + } + } + setShowMode() { const showMode = this.model.showMode; const showConditions = this.style.AutoTurnBack.visibleConditions; diff --git a/src/jmapNew/shape/AutomacticRoute/index.js b/src/jmapNew/shape/AutomacticRoute/index.js index baae62795..64138eaff 100644 --- a/src/jmapNew/shape/AutomacticRoute/index.js +++ b/src/jmapNew/shape/AutomacticRoute/index.js @@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group'; import Arc from 'zrender/src/graphic/shape/Arc'; import Text from 'zrender/src/graphic/Text'; import EMouse from './EMouse'; +import BoundingRect from 'zrender/src/core/BoundingRect'; import {isShowThePrdType} from '../../utils/handlePath'; export default class AutomacticRoute extends Group { @@ -110,6 +111,22 @@ export default class AutomacticRoute extends Group { } return null; } + + getBoundingRect() { // 计算自动折返包围框 + if (this.control) { + const rect = this.control.getBoundingRect().clone(); + if (this.text) { + const text = this.text.getBoundingRect().clone(); + rect.union(text); + return rect; + } else { + return rect; + } + } else { + return new BoundingRect(0, 0, 0, 0); + } + } + setShowMode() { const showMode = this.model.showMode; const showConditions = this.style.AutomaticRoute.displayCondition; diff --git a/src/jmapNew/shape/AxleReset/index.js b/src/jmapNew/shape/AxleReset/index.js index d30ae2a83..a961fa6a0 100644 --- a/src/jmapNew/shape/AxleReset/index.js +++ b/src/jmapNew/shape/AxleReset/index.js @@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group'; import Arc from 'zrender/src/graphic/shape/Arc'; import Text from 'zrender/src/graphic/Text'; import EMouse from './EMouse'; +import BoundingRect from 'zrender/src/core/BoundingRect'; import {isShowThePrdType} from '../../utils/handlePath'; export default class AxleReset extends Group { @@ -110,6 +111,21 @@ export default class AxleReset extends Group { } return null; } + + getBoundingRect() { // 计算自动折返包围框 + if (this.control) { + const rect = this.control.getBoundingRect().clone(); + if (this.text) { + const text = this.text.getBoundingRect().clone(); + rect.union(text); + return rect; + } else { + return rect; + } + } else { + return new BoundingRect(0, 0, 0, 0); + } + } setShowMode() { const showMode = this.model.showMode; const showConditions = this.style.AxleReset.displayCondition; diff --git a/src/jmapNew/shape/GuideLock/index.js b/src/jmapNew/shape/GuideLock/index.js index b944f4e4e..33c79becd 100644 --- a/src/jmapNew/shape/GuideLock/index.js +++ b/src/jmapNew/shape/GuideLock/index.js @@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group'; import Arc from 'zrender/src/graphic/shape/Arc'; import Text from 'zrender/src/graphic/Text'; import EMouse from './EMouse'; +import BoundingRect from 'zrender/src/core/BoundingRect'; import {isShowThePrdType} from '../../utils/handlePath'; export default class GuideLock extends Group { @@ -110,6 +111,20 @@ export default class GuideLock extends Group { } return null; } + getBoundingRect() { // 计算自动折返包围框 + if (this.control) { + const rect = this.control.getBoundingRect().clone(); + if (this.text) { + const text = this.text.getBoundingRect().clone(); + rect.union(text); + return rect; + } else { + return rect; + } + } else { + return new BoundingRect(0, 0, 0, 0); + } + } setShowMode() { const showMode = this.model.showMode; const showConditions = this.style.GuideLock.displayCondition; diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/turnBackControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/turnBackControl.vue index b53cd9284..22e1e6c62 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/turnBackControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/turnBackControl.vue @@ -12,7 +12,7 @@ > 集中站 - 信号机 + 折返 @@ -22,10 +22,14 @@ -
- 设置 - 取消 -
+ + + 设置 + + + 取消 + + 确定 @@ -88,8 +92,9 @@ export default { if (!this.dialogShow) { this.signalName = ''; this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; + if (selected && selected._type.toUpperCase() === 'AutoTurnBack'.toUpperCase()) { + const autoReentryData = this.$store.getters['map/autoReentryData']; + this.signalName = autoReentryData[selected.cycleCode].name; const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); if (station) { this.stationName = station.name; diff --git a/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue b/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue index 5516955fd..f117a8d22 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue @@ -88,7 +88,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - console.log(this.menu); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; @@ -116,7 +115,7 @@ export default { autoTurnBackCode: this.selected.code } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.turnBackControl.doShow(operate, this.selected); @@ -133,7 +132,7 @@ export default { autoTurnBackCode: this.selected.code } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.turnBackControl.doShow(operate, this.selected); diff --git a/src/scripts/cmdPlugin/MenuContextHandler.js b/src/scripts/cmdPlugin/MenuContextHandler.js index fc730f27a..1c738b885 100644 --- a/src/scripts/cmdPlugin/MenuContextHandler.js +++ b/src/scripts/cmdPlugin/MenuContextHandler.js @@ -94,8 +94,8 @@ class MenuContextHandler { if (control) { if (this.getPrdType() != '') { const type = State2SimulationMap[this.getPrdType()]; - const status = State2ControlMap[control.controlMode]; // 判断当前模式 - // const status = 'LocalStationControl'; + // const status = State2ControlMap[control.controlMode]; // 判断当前模式 + const status = 'LocalStationControl'; menu = [...menuList[type]]; // 特殊处理站台的右键操作( 因为小站台不允许有操作 ) if (selected._type == 'StationStand') { diff --git a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue index d00541807..90e658d1b 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue @@ -183,7 +183,7 @@ export default { return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute'; }, isHiddenStation() { - return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute' || this.editModel.type == 'AxleReset'; + return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset'; }, isHiddenCreateAutomaticRoute() { @@ -196,7 +196,7 @@ export default { return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute'; }, isHiddenCreateStation() { - return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute' || this.addModel.type == 'AxleReset'; + return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset'; } }, watch: { @@ -261,10 +261,9 @@ export default { this.getAutoMaticList(); }, deviceSelect(selected) { - debugger; this.$refs.dataform.resetFields(); this.$refs.make.resetFields(); - if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'MapCycleButtonVO'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase()) { + if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); this.editModel.type = selected._type; diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index b16d4ba62..d05098b41 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -301,7 +301,7 @@ export default { this.enabledTab = 'Esp'; } else if (this.feild) { this.enabledTab = 'Section'; - } else if (type == 'AutomaticRoute' || type == 'MapCycleButtonVO' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock') { + } else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock') { this.enabledTab = 'ControlDraft'; } else { this.enabledTab = type;