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 @@
>