diff --git a/public/index.html b/public/index.html index 2b98980..7e1a98a 100644 --- a/public/index.html +++ b/public/index.html @@ -20,6 +20,7 @@ + diff --git a/public/maps/initApi.js b/public/maps/initApi.js index cf41bcb..42aa389 100644 --- a/public/maps/initApi.js +++ b/public/maps/initApi.js @@ -10,7 +10,7 @@ window.mapDefault={ "imageryprovider": "tianditu_image", "terrainProvider": "http://106.12.253.67:9304/", "mapworldkey": "6215132e0336a3db28ce73f8c9ff6db6", - "openearth": false, + "openearth": true, "maxspaceerror": 2000, "loading": false, "bgcolor": "#87CEFA", diff --git a/src/components/header.vue b/src/components/header.vue index 9e778ca..f53d0ce 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -187,8 +187,9 @@ export default { it.id = it.deptId; return it; })] - } - this.deptChange((()=>{})); + } + this.setScreenLiSel1(this.localStorage1); + this.deptChange(); }); } this.$root.isTypeBuser = this.isTypeBuser; @@ -343,10 +344,14 @@ export default { this.data = [{ id: 0, text: '所有项目' }, ...objs]; this.$bus.$emit("loadProjects", this.data); this.$root.projects = this.data; - if (this.data.length > 0) { - this.setScreenLiSel2(this.data[0], init); - } else { - this.setScreenLiSel2(null); + if(this.data.find(it=>it.id==this.localStorage2.id)){ + this.setScreenLiSel2(this.localStorage2) + }else{ + if (this.data.length > 0) { + this.setScreenLiSel2(this.data[0], init); + } else { + this.setScreenLiSel2(null); + } } if(cb){ cb(); @@ -357,7 +362,7 @@ export default { if (item) { this.showSel2 = false; if (!init||!this.dept2) { - localStorage.setItem("data2", JSON.stringify(item)) + localStorage.setItem("data2", JSON.stringify(item)) this.localStorage2 = JSON.parse(localStorage.getItem("data2")) this.$emit('itemdata', item); this.dept2 = item.text; diff --git a/src/pages/index/mapIndex.vue b/src/pages/index/mapIndex.vue index 68e3074..11c3c6f 100644 --- a/src/pages/index/mapIndex.vue +++ b/src/pages/index/mapIndex.vue @@ -1,12 +1,19 @@