From 30d76e763e366a3962ece54efae1f11068b29246 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 5 Jun 2020 10:14:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8A=98=E8=BF=94?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20=E7=8A=B6=E6=80=81=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Station/index.js | 11 +++ src/jmapNew/shape/StationTurnBack/index.js | 24 ++++- .../menus/dialog/standBackStrategy.vue | 3 +- .../newMapdraft/mapoperate/ControlDraft.vue | 96 +++++++++---------- 4 files changed, 81 insertions(+), 53 deletions(-) diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index d9b248dfc..bef3a883c 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -12,6 +12,8 @@ import Rect from 'zrender/src/graphic/shape/Rect'; import BoundingRect from 'zrender/src/core/BoundingRect'; // import {isShowThePrdType} from '../../utils/handlePath'; import Text from 'zrender/src/graphic/Text'; +import store from '@/store/index_APP_TARGET'; +import Vue from 'vue'; export default class Station extends Group { constructor(model, style) { @@ -319,6 +321,15 @@ export default class Station extends Group { if (!this.isShowShape) return; this.recover(); model.controlMode && this['handle' + model.controlMode](); + if (model.tbStrategyId) { + store.state.map.map.tbStrategyList.forEach(item => { + if (item.stationCode == model.code) { + const modelData = Vue.prototype.$jlmap.mapDevice[item.code]; + modelData && modelData.instance && modelData.instance.setState(modelData, model.tbStrategyId); + } + }); + } + } getShapeTipPoint(opts) { diff --git a/src/jmapNew/shape/StationTurnBack/index.js b/src/jmapNew/shape/StationTurnBack/index.js index 2d35f15b5..15c259565 100644 --- a/src/jmapNew/shape/StationTurnBack/index.js +++ b/src/jmapNew/shape/StationTurnBack/index.js @@ -86,18 +86,34 @@ export default class StationTurnBack extends Group { this.add(this.controlRect); this.add(this.text); this.add(this.strategyText); - this.strategyText.hide(); } } recover() { + this.strategyText.hide(); + } + handleStatus(name) { + this.strategyText.show(); + this.strategyText.attr({ + style: { + text: name + } + }); } // 设置状态 - setState(model) { + setState(model, tbStrategyId = null) { // if (!this.isShowShape) return; - // this.recover(); + this.recover(); + if (tbStrategyId) { + model.tbStrategyId = tbStrategyId; + model.optionList.forEach(item => { + if (item.id == tbStrategyId) { + this.handleStatus(item.label); + } + }); + } // console.log(model, '站后折返model') } @@ -117,4 +133,4 @@ export default class StationTurnBack extends Group { // this.isShowShape = false; // } } -} \ No newline at end of file +} diff --git a/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue b/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue index aa17be5b2..d0e48c784 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue @@ -101,8 +101,9 @@ export default { doShow(operate, selected) { this.selected = selected; if (!this.dialogShow) { + const name = selected.optionList.find(ele => ele.id == selected.tbStrategyId).label; this.stationName = selected.name || ''; - this.stationStrategy = ''; // 当前默认折返策略 + this.stationStrategy = selected.tbStrategyId ? name : '无策略折返'; // 当前默认折返策略 this.strategyList = selected.optionList; // 策略列表 } diff --git a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue index ddb18aae8..32f6d3af0 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue @@ -4,48 +4,48 @@