From 969a35eec18740289a5307f518c8ecb955e8eb72 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 29 Sep 2021 10:12:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BD=A6=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=20=E9=87=8D=E6=96=B0=E8=A7=A3=E6=9E=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20=E4=BB=A5=E6=B8=85=E9=99=A4=E6=AE=8B=E7=95=99?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/parser/parser-graph.js | 8 +++++++- .../theme/foshan_01/menus/menuDialog/viewTrainId.vue | 7 +++++++ .../theme/fuzhou_01/menus/menuDialog/viewTrainId.vue | 7 +++++++ .../theme/xian_01/menus/menuDialog/viewTrainId.vue | 7 +++++++ src/store/modules/map.js | 8 +++++++- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/jmapNew/parser/parser-graph.js b/src/jmapNew/parser/parser-graph.js index 934f1c409..4a73436f8 100644 --- a/src/jmapNew/parser/parser-graph.js +++ b/src/jmapNew/parser/parser-graph.js @@ -273,7 +273,13 @@ export function parser(data, skinCode, showConfig) { return mapDevice; } - +// 初始化列车数据(仿真初始化时候,状态消息未初始化列车消息,前端暂时处理(临时解决方案)) +export function parserTrainData(mapDevice, trainList, skinCode, showConfig) { + var propConvert = skinCode ? Vue.prototype.$theme.loadPropConvert(skinCode) : null; + zrUtil.each(trainList || [], elem => { + mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert, showConfig); + }, this); +} // 重置坐标点 function handleResetPoint(points) { return (points[points.length - 1].x >= points[0].x); diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/viewTrainId.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/viewTrainId.vue index 19ee2fb5a..71954c9d7 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuDialog/viewTrainId.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/viewTrainId.vue @@ -107,6 +107,13 @@ export default { return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; } }, + watch: { + '$store.state.training.started':function (val) { + if (val) { + this.setTrainDispaly(); + } + } + }, mounted() { this.$nextTick(() => { this.setTrainDispaly(); diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue b/src/jmapNew/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue index 11396f069..0204b3055 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuDialog/viewTrainId.vue @@ -107,6 +107,13 @@ export default { return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; } }, + watch: { + '$store.state.training.started':function (val) { + if (val) { + this.setTrainDispaly(); + } + } + }, mounted() { this.$nextTick(() => { this.setTrainDispaly(); diff --git a/src/jmapNew/theme/xian_01/menus/menuDialog/viewTrainId.vue b/src/jmapNew/theme/xian_01/menus/menuDialog/viewTrainId.vue index eaa8ce076..1c3a700ba 100644 --- a/src/jmapNew/theme/xian_01/menus/menuDialog/viewTrainId.vue +++ b/src/jmapNew/theme/xian_01/menus/menuDialog/viewTrainId.vue @@ -107,6 +107,13 @@ export default { return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; } }, + watch: { + '$store.state.training.started':function (val) { + if (val) { + this.setTrainDispaly(); + } + } + }, mounted() { this.$nextTick(() => { this.setTrainDispaly(); diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 9c14fc6dc..222ed0c35 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -1209,9 +1209,15 @@ const map = { commit('mapStateLoadedCountIncrenment'); }, - clearJlmapTrainView: () => { + clearJlmapTrainView: ({ commit, state}) => { if (Vue.prototype.$jlmap) { Vue.prototype.$jlmap.clearTrainView(); + let showConfig = {}; + if (Vue.prototype.$jlmap && typeof Vue.prototype.$jlmap.getShowConfig === 'function') { + showConfig = Vue.prototype.$jlmap.getShowConfig(); + } + const parser = parserFactory(ParserType.Graph.value); + parser.parserTrainData(state.mapDevice, state.map.trainList, state.map.skinVO.code, showConfig); } },