From 12a585b93ad972e5e1f61616e019fe04fcefe40d Mon Sep 17 00:00:00 2001 From: yuan Date: Mon, 13 Sep 2021 14:19:34 +0800 Subject: [PATCH 1/4] =?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)) From 11f480541739e2a509ccad54772b4aebd69682cb Mon Sep 17 00:00:00 2001 From: yuan Date: Mon, 13 Sep 2021 14:58:48 +0800 Subject: [PATCH 2/4] bugfix --- src/jmapNew/utils/JTriangle.js | 1 + src/store/modules/map.js | 3 ++- src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jmapNew/utils/JTriangle.js b/src/jmapNew/utils/JTriangle.js index e978929c0..8c7aa426b 100644 --- a/src/jmapNew/utils/JTriangle.js +++ b/src/jmapNew/utils/JTriangle.js @@ -16,6 +16,7 @@ JTriangle.prototype = { init (beg, end) { this.beg = beg; this.end = end; + if(!this.beg) debugger this.abspowx = Math.pow(this.end.x - this.beg.x, 2); this.abspowy = Math.pow(this.end.y - this.beg.y, 2); this.abspowz = this.abspowx + this.abspowy; diff --git a/src/store/modules/map.js b/src/store/modules/map.js index d4a277205..398f4e513 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -750,12 +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) + Vue.prototype.$jlmap && Vue.prototype.$jlmap.setDefaultState() }, updateMapDevice: (state, list) => { list.forEach(elem => { diff --git a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue index 94cbad6e4..d683976c2 100644 --- a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue @@ -222,7 +222,6 @@ export default { }, generateExportData() { let res = {} - debugger this.modelList.forEach(item => { res[`${item.type.toLowerCase()}List`] = [...item.list.map(_ => _.code), ...(item.logicSectionList || []).map(_ => _.code)] }) @@ -237,6 +236,7 @@ export default { for (let key in res) { if (key !== 'switchList') res[key] = this.$store.state.map.map[key].filter(model => res[key].includes(model.code)) } + debugger return res }, clearList() { From 2548c8375f662b5103d81d7bdc810f1e8abe8b4e Mon Sep 17 00:00:00 2001 From: yuan Date: Mon, 13 Sep 2021 14:59:08 +0800 Subject: [PATCH 3/4] bugfix --- src/jmapNew/utils/JTriangle.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/jmapNew/utils/JTriangle.js b/src/jmapNew/utils/JTriangle.js index 8c7aa426b..e978929c0 100644 --- a/src/jmapNew/utils/JTriangle.js +++ b/src/jmapNew/utils/JTriangle.js @@ -16,7 +16,6 @@ JTriangle.prototype = { init (beg, end) { this.beg = beg; this.end = end; - if(!this.beg) debugger this.abspowx = Math.pow(this.end.x - this.beg.x, 2); this.abspowy = Math.pow(this.end.y - this.beg.y, 2); this.abspowz = this.abspowx + this.abspowy; From de11b14023da702b641ee3643a2e4e3f7448109b Mon Sep 17 00:00:00 2001 From: yuan Date: Mon, 13 Sep 2021 15:00:57 +0800 Subject: [PATCH 4/4] bugfix --- src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue index d683976c2..fccb1b1d3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue @@ -236,7 +236,6 @@ export default { for (let key in res) { if (key !== 'switchList') res[key] = this.$store.state.map.map[key].filter(model => res[key].includes(model.code)) } - debugger return res }, clearList() {