guoxiaohuan 4 years ago
parent
commit
4efd89cdb6
5 changed files with 60 additions and 34 deletions
  1. 4 4
      public/systemConf.js
  2. 6 3
      src/App.vue
  3. 22 11
      src/store/index.js
  4. 1 6
      src/views/equipment/index.vue
  5. 27 10
      src/views/statistics/index.vue

+ 4 - 4
public/systemConf.js

@@ -24,11 +24,11 @@ var __systemConf = {
     systemCode: 'wandaBmGuide',
     conf: {
         // 阿里云
-        editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
-        wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
+        // editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
+        // wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
         // http://glsms.wanda-dev.cn/ 测试服
-        // editerUrl: 'http://glsms.wanda-dev.cn/wandaEditer/', // 编辑器地址
-        // wandaBmGuideUrl: 'http://glsms.wanda-dev.cn/wandaBmGuide/', //管理书地址
+        editerUrl: 'http://glsms.wanda-dev.cn/wandaEditer/', // 编辑器地址
+        wandaBmGuideUrl: 'http://glsms.wanda-dev.cn/wandaBmGuide/', //管理书地址
         // editerUrl: 'http://localhost:8091/wandaEditer/', // 编辑器地址
         // wandaBmGuideUrl: 'http://localhost:8090/wandaBmGuide/', //管理书地址
     },

+ 6 - 3
src/App.vue

@@ -19,7 +19,8 @@ export default {
             appName: '万达可视化系统',
             mapServerURL: `http://map.wanda.cn/editor`,
             mapthemeUrl: `http://map.wanda.cn/editor/webtheme`,
-            isMounted: false
+            isMounted: false,
+            plazaIds: ''
         }
     },
     /**
@@ -37,6 +38,8 @@ export default {
     },
     mounted() {
         this.isMounted = true
+        this.plazaIds = localStorage.getItem('PLAZAID')
+        console.log(this.plazaIds)
     },
     computed: {
         ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'accessLevel'])
@@ -67,7 +70,7 @@ export default {
         }
     },
     watch: {
-        plazaId(plazaId) {
+        plazaIds(plazaId) {
             console.log('获取到id', plazaId)
             window.fengmapData = null
             // 当获取到到项目id,请求底图
@@ -79,7 +82,7 @@ export default {
             }
         },
         isMounted(isMounted) {
-            if (isMounted && this.plazaId) {
+            if (isMounted && this.plazaIds) {
                 this.getFengMap()
             }
         }

+ 22 - 11
src/store/index.js

@@ -154,23 +154,34 @@ export default new Vuex.Store({
                 if (res.result === 'success') {
                     commit('STOREACCESSLEVEL', res.level)
                     let level = res.level
-                    if (level === 0) {
-                        if (res.treeData[0].ccode) {
-                            localStorage.setItem('PLAZAID', res.treeData[0].ccode)
-                            commit('STOREPLAZAID', res.treeData[0].ccode)
-                            commit('SETPLAZENAME', res.treeData[0].cname)
-                        }
+                    if (window.opener) {
+                        let data = window.opener.__fromGroupPage
+                        level = data.level
+                        commit('SETPLAZENAME', data.plazaName)
+                        localStorage.setItem('PLAZAID', data.plazaId)
+                        commit('STOREPLAZAID', data.plazaId)
                         router.push({ path: './home/homepage' })
                     } else {
-                        router.push({ path: './group' })
+                        if (level === 0) {
+                            if (res.treeData[0].ccode) {
+                                localStorage.setItem('PLAZAID', res.treeData[0].ccode)
+                                commit('STOREPLAZAID', res.treeData[0].ccode)
+                                commit('SETPLAZENAME', res.treeData[0].cname)
+                            }
+                            router.push({ path: './home/homepage' })
+                        } else {
+                            router.push({ path: './group' })
+                        }
                     }
                     // commit('SETISREQUESTtAUTH', false)
+
+                    // commit('SETISREQUESTtAUTH', false)
                 }
             })
         },
         getFloors(context) {
             queryFloor({
-                plazaId: context.state.plazaId || localStorage.getItem('PLAZAID'),
+                plazaId: localStorage.getItem('PLAZAID') || context.state.plazaId,
             }).then((res) => {
                 if (res.result == 'success') {
                     context.commit('SETFLOORS', res.data)
@@ -179,14 +190,14 @@ export default new Vuex.Store({
         },
         async getfmapID(context) {
             await queryfmapID({
-                mapId: context.state.plazaId,
+                mapId: localStorage.getItem('PLAZAID') || context.state.plazaId,
             }).then((res) => {
-                context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
+                context.commit('SETMAPID', `${localStorage.getItem('PLAZAID') || context.state.plazaId}_${res.mapVersion}`)
             })
         },
         async getBrand(context) {
             let data = {
-                plazaId: context.state.plazaId,
+                plazaId: `${localStorage.getItem('PLAZAID') || context.state.plazaId}`,
             }
             await queryBrand({
                 data,

+ 1 - 6
src/views/equipment/index.vue

@@ -230,12 +230,7 @@ export default {
         this.$refs.floorMap.init(this.floorInfo.gname)
     },
     computed: {
-        ...mapGetters(['floorsArr', 'plazaId', 'showView', 'legendTable']),
-        Height() {
-            console.log(document.body.clientHeight)
-            // return document.body.clientHeight
-            return 300
-        }
+        ...mapGetters(['floorsArr', 'plazaId', 'showView', 'legendTable'])
     }
 }
 </script>

+ 27 - 10
src/views/statistics/index.vue

@@ -351,12 +351,21 @@ export default {
                 let res = this.provinceCities[JSONName]
                 this.pantProjectsMap(data, this.currentSysId)
             } else {
-                this.$router.push({path:'/home/homePage'})  // 点击广场时 直接跳转到详情页  地图不用响应
+                let pathData = {fromGroup: 'true'}
+                let routeData = this.$router.resolve({ // 点击广场时 直接跳转到详情页  地图不用响应
+                    name:'/home/homePage',
+                })
+                window.open(routeData.href, '_blank');
+                window.__fromGroupPage = {
+                    level: 0,
+                    plazaName: data.cname,
+                    plazaId: data.ccode
+                }
                 this.$store.commit('SETPLAZENAME', data.cname) 
-                localStorage.setItem('PLAZAID', data.ccode)
-                 this.$store.commit('STOREPLAZAID', data.ccode) 
-                 this.$store.commit('SETISGETMAP',true)
-            }
+                localStorage.setItem('PLAZAID', data.ccode)       
+                this.$store.commit('STOREPLAZAID', data.ccode) 
+                this.$store.commit('SETISGETMAP',true)                
+            }  
         },
    
         /**
@@ -929,11 +938,19 @@ export default {
                             this.pantProjectsMap(data, this.currentSysId)
                         } 
                         if (type === 'project') {
-                            this.$router.push({path:'/home/homePage' })  
-                            this.$store.commit('SETPLAZENAME', data.cname) 
-                            localStorage.setItem('PLAZAID', data.ccode)
-                            this.$store.commit('STOREPLAZAID', data.ccode) ;
-                            this.$store.commit('SETISGETMAP',true)
+                            let routeData = this.$router.resolve({
+                            name:'/home/homePage',
+                        })
+                        window.open(routeData.href, '_blank');
+                        window.__fromGroupPage = {
+                            level: 0,
+                            plazaName: data.cname,
+                            plazaId: data.ccode
+                        }
+                        this.$store.commit('SETPLAZENAME', data.cname) 
+                        localStorage.setItem('PLAZAID', data.ccode)
+                         this.$store.commit('STOREPLAZAID', data.ccode) ;
+                        this.$store.commit('SETISGETMAP',true)
                         }   
                     })
                 }