From 12a585b93ad972e5e1f61616e019fe04fcefe40d Mon Sep 17 00:00:00 2001 From: yuan Date: Mon, 13 Sep 2021 14:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BAbugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/map.js | 4 ++-- src/utils/baseUrl.js | 2 +- .../newMapdraft/mapoperate/checkboxDraft.vue | 16 +++++++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 470e50e46..6cf87a734 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -750,13 +750,13 @@ const map = { showConfig = Vue.prototype.$jlmap.getShowConfig() } Object.keys(data).forEach(key => { - state.map[key] = deepAssign(state.map[key] || {}, data[key]) + state.map[key] = [...state.map[key], ...data[key]] }) const parser = parserFactory(ParserType.Graph.value) state.mapDevice = parser.parser(state.map, state.map.skinVO.code, showConfig) Vue.prototype.$jlmap && Vue.prototype.$jlmap.setMapDevice(state.mapDevice) Vue.prototype.$jlmap && Vue.prototype.$jlmap.$painter.repaint(state.mapDevice) - console.log(state.mapDevice) + Vue.prototype.$jlmap && Vue.prototype.$jlmap.setDefaultState(state.mapDevice) }, updateMapDevice: (state, list) => { list.forEach(elem => { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 7cda5ac1d..1a20cee58 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -4,7 +4,7 @@ export function getBaseUrl() { // BASE_API = 'https://joylink.club/jlcloud'; BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.8.107:9000'; // 袁琪 - BASE_API = 'http://192.168.8.177:9000'; // 旭强 + // BASE_API = 'http://192.168.8.177:9000'; // 旭强 // BASE_API = 'http://192.168.2.183:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue index 18fb78e0a..94cbad6e4 100644 --- a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue @@ -221,20 +221,18 @@ export default { URL.revokeObjectURL(url) }, generateExportData() { - // TODO 复杂度优化 let res = {} + debugger this.modelList.forEach(item => { - res[`${item.type.toLowerCase()}List`] = item.list.map(_ => _.code) - if (item.type === 'Section') - item.logicSectionList.forEach(_ => { - res[`${item.type.toLowerCase()}List`].push(_.code) - }) + res[`${item.type.toLowerCase()}List`] = [...item.list.map(_ => _.code), ...(item.logicSectionList || []).map(_ => _.code)] }) res.switchList = res.switchList.map(c => this.$store.state.map.map.switchList.find(_ => _.code === c)) res.switchList.forEach(swch => { - if (!res.sectionList.includes(swch.sectionACode)) res.sectionList.push(swch.sectionACode) - if (!res.sectionList.includes(swch.sectionBCode)) res.sectionList.push(swch.sectionBCode) - if (!res.sectionList.includes(swch.sectionCCode)) res.sectionList.push(swch.sectionCCode) + 'ABC'.split('').forEach(c => { + if (!res.sectionList.includes(swch[`section${c}Code`])) { + res.sectionList.push(swch[`section${c}Code`]) + } + }) }) for (let key in res) { if (key !== 'switchList') res[key] = this.$store.state.map.map[key].filter(model => res[key].includes(model.code))