From fff07141b6f5f8dacfc5b14287b35b19870fa724 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Sat, 6 May 2023 19:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/painter.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js index 6615d0fb6..3a1ac641d 100644 --- a/src/jmapNew/painter.js +++ b/src/jmapNew/painter.js @@ -2,7 +2,7 @@ import * as zrUtil from 'zrender/src/core/util'; // import * as vector from 'zrender/src/core/vector'; import Group from 'zrender/src/container/Group'; import deviceType from './constant/deviceType'; -import systemGraphType from './constant/systemGraphType'; +import nccGraphType from './constant/nccGraphType'; import transitionDeviceStatus from './constant/stateTransition'; // import shapefactory from './shape/factory'; import Graphic from './shape'; @@ -43,7 +43,7 @@ class Painter { // 添加子级图层 zrUtil.each([ ...Object.values(deviceType), - ...Object.values(systemGraphType)], (type) => { + ...Object.values(nccGraphType)], (type) => { const level = new Group({ name: `__${type}__` }); this.mapInstanceLevel[type] = level; this.parentLevel.add(level); @@ -155,13 +155,17 @@ class Painter { trainDevice.instance && this.mapInstanceLevel[deviceType.Train].remove(trainDevice.instance); trainDevice.instance = null; trainDevice.zrOptions = this.$jmap.$options; - curModel.sectionModel.instance && this.add(trainDevice); + curModel.sectionModel && curModel.sectionModel.instance && this.add(trainDevice); }); if (this.screenFlag) { this.$transformHandleScreen.transformView(device.instance); } } + updateNccTrain(device) { + this.delete(device); + this.add(device); + } /** 画面更新 */ updatePicture(device) { if (device) {