|
@@ -20,11 +20,18 @@ export default {
|
|
|
mapServerURL: `http://map.wanda.cn/editor`
|
|
|
}
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 刷新保存vuex信息
|
|
|
+ */
|
|
|
+ created() {
|
|
|
+ this.$store.replaceState(Object.assign(this.$store.state, JSON.parse(localStorage.getItem('beforeunload'))))
|
|
|
+ localStorage.removeItem('beforeunload')
|
|
|
+ window.addEventListener('beforeunload', () => {
|
|
|
+ let state = JSON.stringify(this.$store.state)
|
|
|
+ localStorage.setItem('beforeunload', state)
|
|
|
+ })
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- // 监听页面刷新事件
|
|
|
- window.addEventListener('unload', this.unload)
|
|
|
- // 页面加载完成后,移除session里的存储的信息
|
|
|
- window.addEventListener('load', this.load)
|
|
|
// 请求该项目下的楼层数据
|
|
|
this.getFengMap()
|
|
|
},
|
|
@@ -34,19 +41,6 @@ export default {
|
|
|
methods: {
|
|
|
...mapActions(['getfmapID']),
|
|
|
...mapMutations(['SETHAVEFENGMAP']),
|
|
|
- unload() {
|
|
|
- // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
|
|
|
- const state = this.$store.state
|
|
|
- sessionStorage.setItem('state', JSON.stringify(state))
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // 监听页面刷新事件
|
|
|
- window.addEventListener('unload', this.unload)
|
|
|
- // 页面加载完成后,移除session里的存储的信息
|
|
|
- window.addEventListener('load', this.load)
|
|
|
- // 请求该项目下的楼层数据
|
|
|
- this.getFengMap()
|
|
|
- },
|
|
|
getFengMap() {
|
|
|
if (!this.fmapID) {
|
|
|
this.getfmapID().then(() => {
|