导入导出bugfix

This commit is contained in:
yuan 2021-09-13 14:19:34 +08:00
parent b5eab3f1cd
commit 12a585b93a
3 changed files with 10 additions and 12 deletions

View File

@ -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 => {

View File

@ -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';

View File

@ -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))