guoxiaohuan 4 년 전
부모
커밋
cd40339241
9개의 변경된 파일335개의 추가작업 그리고 279개의 파일을 삭제
  1. 237 209
      src/App.vue
  2. 1 1
      src/components/Legend/src/legend.vue
  3. 4 1
      src/components/menuList.vue
  4. 2 1
      src/main.ts
  5. 7 5
      src/router/index.js
  6. 9 7
      src/store/index.js
  7. 17 1
      src/views/overview/index.vue
  8. 56 52
      src/views/statistics/index.vue
  9. 2 2
      vue.config.js

+ 237 - 209
src/App.vue

@@ -1,137 +1,153 @@
 <template>
-    <div id='app'>
-        <div :id='`fengMap${id}`' class='fengMap'></div>
-        <router-view />
-    </div>
+  <div id="app">
+    <div :id="`fengMap${id}`" class="fengMap"></div>
+    <router-view />
+  </div>
 </template>
 <script>
-import { mapGetters, mapActions, mapMutations } from 'vuex'
-import { SFengParser } from '@saga-web/feng-map'
-import { setFloor } from '@/api/public.js'
-window.fengmapData = null
+import { mapGetters, mapActions, mapMutations } from "vuex";
+import { SFengParser } from "@saga-web/feng-map";
+import { setFloor } from "@/api/public.js";
+window.fengmapData = null;
 export default {
-    data() {
-        return {
-            view: '',
-            scene: '',
-            id: '2',
-            canvasID: '',
-            key: '23f30a832a862c58637a4aadbf50a566',
-            appName: '万达可视化系统',
-            mapServerURL: `http://map.wanda.cn/editor`,
-            mapthemeUrl: `http://map.wanda.cn/editor/webtheme`,
-            isMounted: false,
-            plazaIds: ''
-        }
-    },
-    /**
-     * 刷新保存vuex信息
-     */
-    created() {
-        let beforeunload = JSON.parse(localStorage.getItem('beforeunload'))
-        // 删除 store中的ssoToken
-        beforeunload && delete beforeunload.ssoToken
-        this.$store.replaceState(Object.assign(this.$store.state, beforeunload))
-        //    刷新时,将haveFengMap 置为false,解决设备设施页面,刷新时不出新楼层图的问题
-        this.SETHAVEFENGMAP(false)
-        localStorage.removeItem('beforeunload')
-        window.addEventListener('beforeunload', () => {
-            let state = JSON.stringify(this.$store.state)
-            localStorage.setItem('beforeunload', state)
-        })
-    },
-    mounted() {
-        this.isMounted = true
-        this.plazaIds = localStorage.getItem('PLAZAID')
-    },
-    computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'accessLevel'])
+  data() {
+    return {
+      view: "",
+      scene: "",
+      id: "2",
+      canvasID: "",
+      key: "23f30a832a862c58637a4aadbf50a566",
+      appName: "万达可视化系统",
+      mapServerURL: `http://map.wanda.cn/editor`,
+      mapthemeUrl: `http://map.wanda.cn/editor/webtheme`,
+      isMounted: false,
+      plazaIds: ""
+    };
+  },
+  /**
+   * 刷新保存vuex信息
+   */
+  created() {
+    let beforeunload = JSON.parse(localStorage.getItem("beforeunload"));
+    // 删除 store中的ssoToken
+    if (beforeunload) {
+      delete beforeunload.ssoToken;
+      delete beforeunload.plazaId;
+      delete beforeunload.isPreview;
+    }
+
+    let plazaId = localStorage.getItem("PLAZAID");
+    let isPreview = sessionStorage.getItem("SETISPREVIEW");
+    this.$store.replaceState(
+      Object.assign(this.$store.state, beforeunload, { plazaId, isPreview })
+    );
+    //    刷新时,将haveFengMap 置为false,解决设备设施页面,刷新时不出新楼层图的问题
+    this.SETHAVEFENGMAP(false);
+    localStorage.removeItem("beforeunload");
+    window.addEventListener("beforeunload", () => {
+      let state = JSON.stringify(this.$store.state);
+      localStorage.setItem("beforeunload", state);
+    });
+  },
+  mounted() {
+    this.isMounted = true;
+    this.plazaIds = localStorage.getItem("PLAZAID");
+  },
+  computed: {
+    ...mapGetters(["plazaId", "fmapID", "haveFengMap", "accessLevel"])
+  },
+  methods: {
+    ...mapActions(["getfmapID"]),
+    ...mapMutations(["SETHAVEFENGMAP"]),
+    getFengMap() {
+      this.getfmapID().then(() => {
+        this.getMap();
+      });
     },
-    methods: {
-        ...mapActions(['getfmapID']),
-        ...mapMutations(['SETHAVEFENGMAP']),
-        getFengMap() {
-            this.getfmapID().then(() => {
-                this.getMap()
-            })
-        },
-        getMap() {
-            //如果项目为 南昌八一路 长春重庆路 青岛台东路 则不走楼层缓存接口
-            // if(this.plazaIds == "1001064" || this.plazaIds == "1001065" || this.plazaIds == "1001066"){
-            //     let arr = ["b2","b1","f1","f2","f3","f4","f5","f6","g80"];
-            //     setFloor({ plazaId: this.plazaIds }, arr)
-            //     .then(res => {
-            //       console.log("缓存楼层", res);
-            //     })
-            //     .catch(error => {
-            //       console.log("缓存楼层", error);
-            //     });
-            //     return
-            //   }
+    getMap() {
+      //如果项目为 南昌八一路 长春重庆路 青岛台东路 则不走楼层缓存接口
+      // if(this.plazaIds == "1001064" || this.plazaIds == "1001065" || this.plazaIds == "1001066"){
+      //     let arr = ["b2","b1","f1","f2","f3","f4","f5","f6","g80"];
+      //     setFloor({ plazaId: this.plazaIds }, arr)
+      //     .then(res => {
+      //       console.log("缓存楼层", res);
+      //     })
+      //     .catch(error => {
+      //       console.log("缓存楼层", error);
+      //     });
+      //     return
+      //   }
 
-            window.fengmapData = new SFengParser(
-                `fengMap${this.id}`,
-                `${this.mapServerURL}/fmap/${this.fmapID}`,
-                this.key,
-                this.appName,
-                null,
-                this.mapthemeUrl
-            )
-            if (this.fmapID.includes('null')) {
-                this.SETHAVEFENGMAP(0)
-            }
-            window.fengmapData.loadMap(this.fmapID, (a, b) => {
-                const dataArr = b.map(item => {
-                    return item.gname
-                })
-                // 获取主题数据
-                window.fengmapData.loadTheme(`${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`).then(res => {
-                    this.SETHAVEFENGMAP(1)
-                })
-                // 缓存楼层数据
-                if (dataArr.length) {
-                    //如果项目为 南昌八一路 长春重庆路 青岛台东路 则不走楼层缓存接口
-                    // if(this.plazaIds == "1001064" || this.plazaIds == "1001065" || this.plazaIds == "1001066"){
-                    //   let arr = ["b2","b1","f1","f2","f3","f4","f5","f6","g80"];
-                    //   setFloor({ plazaId: this.plazaIds }, arr)
-                    //   .then(res => {
-                    //     console.log("缓存楼层", res);
-                    //   })
-                    //   .catch(error => {
-                    //     console.log("缓存楼层", error);
-                    //   });
-                    //   return
-                    // }
-                    setFloor({ plazaId: this.plazaIds }, dataArr)
-                        .then(res => {
-                            console.log('缓存楼层', res)
-                        })
-                        .catch(error => {
-                            console.log('缓存楼层', error)
-                        })
-                }
+      window.fengmapData = new SFengParser(
+        `fengMap${this.id}`,
+        `${this.mapServerURL}/fmap/${this.fmapID}`,
+        this.key,
+        this.appName,
+        null,
+        this.mapthemeUrl
+      );
+      if (this.fmapID.includes("null")) {
+        this.SETHAVEFENGMAP(0);
+      }
+      window.fengmapData.loadMap(this.fmapID, (a, b) => {
+        const dataArr = b.map(item => {
+          return item.gname;
+        });
+        // 获取主题数据
+        window.fengmapData
+          .loadTheme(
+            `${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`
+          )
+          .then(res => {
+            this.SETHAVEFENGMAP(1);
+          });
+        // 缓存楼层数据
+        if (dataArr.length) {
+          //如果项目为 南昌八一路 长春重庆路 青岛台东路 则不走楼层缓存接口
+          // if(this.plazaIds == "1001064" || this.plazaIds == "1001065" || this.plazaIds == "1001066"){
+          //   let arr = ["b2","b1","f1","f2","f3","f4","f5","f6","g80"];
+          //   setFloor({ plazaId: this.plazaIds }, arr)
+          //   .then(res => {
+          //     console.log("缓存楼层", res);
+          //   })
+          //   .catch(error => {
+          //     console.log("缓存楼层", error);
+          //   });
+          //   return
+          // }
+          setFloor({ plazaId: this.plazaIds }, dataArr)
+            .then(res => {
+              console.log("缓存楼层", res);
             })
+            .catch(error => {
+              console.log("缓存楼层", error);
+            });
         }
+      });
+    }
+  },
+  watch: {
+    plazaId(plazaId) {
+      let plazaid = this.$route.query.plazaId
+        ? this.$route.query.plazaId
+        : plazaId;
+      console.log("获取到id", plazaid);
+      window.fengmapData = null;
+      // 当获取到到项目id,请求底图
+      if (plazaid) {
+        // 请求该项目下的楼层数据
+        this.getFengMap();
+      } else {
+        window.fengmapData = null;
+      }
     },
-    watch: {
-        plazaIds(plazaId) {
-            console.log('获取到id', plazaId)
-            window.fengmapData = null
-            // 当获取到到项目id,请求底图
-            if (plazaId) {
-                // 请求该项目下的楼层数据
-                this.getFengMap()
-            } else {
-                window.fengmapData = null
-            }
-        },
-        isMounted(isMounted) {
-            if (isMounted && this.plazaIds) {
-                this.getFengMap()
-            }
-        }
+    isMounted(isMounted) {
+      if (isMounted && this.plazaIds) {
+        this.getFengMap();
+      }
     }
-}
+  }
+};
 </script>
 <style lang="less">
 body,
@@ -159,8 +175,8 @@ input,
 textarea,
 th,
 td {
-    margin: 0;
-    padding: 0;
+  margin: 0;
+  padding: 0;
 }
 
 body,
@@ -168,7 +184,7 @@ button,
 input,
 select,
 textarea {
-    font: 12px/1.5 Arial, 'Microsoft YaHei', '\65b0\5b8b\4f53';
+  font: 12px/1.5 Arial, "Microsoft YaHei", "\65b0\5b8b\4f53";
 }
 
 h1,
@@ -177,7 +193,7 @@ h3,
 h4,
 h5,
 h6 {
-    font-size: 100%;
+  font-size: 100%;
 }
 
 address,
@@ -187,158 +203,170 @@ var,
 em,
 i,
 u {
-    font-style: normal;
+  font-style: normal;
 }
 
 ol,
 ul {
-    list-style: none;
+  list-style: none;
 }
 
 a {
-    text-decoration: none;
+  text-decoration: none;
 }
 
 a:hover {
-    text-decoration: underline;
+  text-decoration: underline;
 }
 
 img {
-    border: none;
-    vertical-align: middle;
+  border: none;
+  vertical-align: middle;
 }
 
 :focus {
-    outline: 0;
+  outline: 0;
 }
 
 button,
 input,
 select,
 textarea {
-    font-size: 100%;
+  font-size: 100%;
 }
 
 table {
-    border-collapse: collapse;
-    border-spacing: 0;
+  border-collapse: collapse;
+  border-spacing: 0;
 }
 
 /* 滚动条样式 */
 
 body ::-webkit-scrollbar {
-    width: 5px;
-    height: 8px;
+  width: 5px;
+  height: 8px;
 }
 
 body ::-webkit-scrollbar-track {
-    background-color: rgba(0, 0, 0, 0);
-    border-radius: 3px;
+  background-color: rgba(0, 0, 0, 0);
+  border-radius: 3px;
 }
 
 body ::-webkit-scrollbar-thumb {
-    border-radius: 3px;
-    background: #e6e6e6;
-    border: 1px solid #e6e6e6;
+  border-radius: 3px;
+  background: #e6e6e6;
+  border: 1px solid #e6e6e6;
 }
 
 body ::-webkit-scrollbar-thumb:vertical:hover {
-    background: #e6e6e6;
-    border: 1px solid #e6e6e6;
+  background: #e6e6e6;
+  border: 1px solid #e6e6e6;
 }
 
 #app {
-    //meri-design组件select的字体颜色
-    /deep/ .p-select-fakePlaceholder {
-        span {
-            span {
-                color: #606266 !important;
-                font-size: 13px;
-                font-weight: normal;
-            }
-        }
-    }
-    //element 分页组件背景色
-    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
-    }
-    //element button
-    /deep/ .el-button--primary,
-    .p-button-primary {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+  //meri-design组件select的字体颜色
+  /deep/ .p-select-fakePlaceholder {
+    span {
+      span {
+        color: #606266 !important;
+        font-size: 13px;
+        font-weight: normal;
+      }
     }
+  }
+  //element 分页组件背景色
+  /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
+  //element button
+  /deep/ .el-button--primary,
+  .p-button-primary {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
 }
 .clearfix::after {
-    content: '.';
-    display: block;
-    height: 0;
-    clear: both;
-    visibility: hidden;
+  content: ".";
+  display: block;
+  height: 0;
+  clear: both;
+  visibility: hidden;
 }
 .clearfix {
-    zoom: 1;
+  zoom: 1;
 }
 
 .left {
-    float: left;
+  float: left;
 }
 
 .right {
-    float: right;
+  float: right;
 }
 html,
 body {
-    width: 100%;
-    height: 100%;
-    // min-width: 1920px;
-    //   background: url('./assets/images/back.jpg') no-repeat;
+  width: 100%;
+  height: 100%;
+  // min-width: 1920px;
+  //   background: url('./assets/images/back.jpg') no-repeat;
 }
 #app {
-    height: 100%;
-    width: 100%;
-    position: relative;
-    .fengMap {
-        position: fixed;
-        width: 100px;
-        height: 100px;
-        z-index: -1;
-        opacity: 0;
-    }
+  height: 100%;
+  width: 100%;
+  position: relative;
+  .fengMap {
+    position: fixed;
+    width: 100px;
+    height: 100px;
+    z-index: -1;
+    opacity: 0;
+  }
 }
 // element表头背景颜色修改
 .core-device-report,
 .specification-update-record {
-    .el-table thead th {
-        background-color: #f8f9fa;
-    }
-    .el-pagination.is-background .el-pager li:not(.disabled).active {
-        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
-    }
+  .el-table thead th {
+    background-color: #f8f9fa;
+  }
+  .el-pagination.is-background .el-pager li:not(.disabled).active {
+    background: linear-gradient(
+      180deg,
+      rgba(54, 156, 247, 1) 0%,
+      rgba(2, 91, 170, 1) 100%
+    );
+  }
 }
 // 说明书更新记录 element 时间控件样式重写
 .specification-update-record,
 .core-device-report {
-    .el-input__inner {
-        height: 32px;
-        line-height: 32px;
-    }
-    .el-date-editor .el-range__icon,
-    .el-date-editor .el-range-separator {
-        line-height: 26px;
-        width: 8%;
-    }
+  .el-input__inner {
+    height: 32px;
+    line-height: 32px;
+  }
+  .el-date-editor .el-range__icon,
+  .el-date-editor .el-range-separator {
+    line-height: 26px;
+    width: 8%;
+  }
 }
 .el-dialog__header {
-    border-bottom: 1px solid rgba(239, 240, 241, 1);
+  border-bottom: 1px solid rgba(239, 240, 241, 1);
 }
 .gantt-chart .el-dialog__title {
-    font-weight: 500;
+  font-weight: 500;
 }
 .img-detail-container {
-    .el-dialog__body {
-        padding-top: 0;
-        padding-bottom: 0;
-        padding-right: 0;
-    }
+  .el-dialog__body {
+    padding-top: 0;
+    padding-bottom: 0;
+    padding-right: 0;
+  }
 }
 </style>

+ 1 - 1
src/components/Legend/src/legend.vue

@@ -361,7 +361,7 @@ export default {
             }
             const { conf } = window.__systemConf
             const editerUrl = conf[process.env.NODE_ENV + '_editerUrl'];
-            if(this.plazaId){
+            if(!this.plazaId){
                 return
             }
             let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${floorName}&fmapID=${this.fmapID}&seq=${seq}&token=${this.ssoToken}`

+ 4 - 1
src/components/menuList.vue

@@ -126,6 +126,9 @@ export default {
         toDrafts() {
             const { conf } = window.__systemConf
             // { editerUrl } = conf;
+            if(!this.plazaId){
+                return
+            }
             const editerUrl = conf[process.env.NODE_ENV + '_editerUrl']
             let data = `projectId=${this.plazaId}&fmapID=${this.fmapID}&token=${this.$store.state.ssoToken}`
             let url = editerUrl + 'drafts?' + encodeURIComponent(data)
@@ -178,7 +181,7 @@ export default {
         },
 
         dumpLegend() {
-            const { conf } = window.__systemConf
+            const { conf } = window.__systemConf;
             const wandaBmGuideUrl = conf[process.env.NODE_ENV + '_wandaBmGuideUrl']
             window.open(`${wandaBmGuideUrl}home/legendLibrary?token=${this.$store.state.ssoToken}`, "legendLibrary")
         }

+ 2 - 1
src/main.ts

@@ -43,7 +43,8 @@ const username = 'lengqiang'
 //     }
 //     next()
 // })
-console.log('main')
+
+
 new Vue({
     router,
     store,

+ 7 - 5
src/router/index.js

@@ -121,10 +121,11 @@ router.beforeEach(async (to, from, next) => {
             // 有token 将数据 isPreview赋给 vuex方便取值
             store.commit('SETISPREVIEW', sessionStorage.getItem("SETISPREVIEW"))
             // 如果在跳转获取token之前保存了指定的路径,则后去token后需要跳转到相关页面
-            if(to.path !='/group' || to.path !='/home/homepage' ){
+            console.log(to.path)
+            if(to.path !='/group' && to.path !='/home/homepage' && to.path !='/' ){
                 if(!store.state.permissions || store.state.permissions.length ==0){
                     // 如果没有请求permissions则请求getUserInfo
-                    await store.dispatch("getUserInfo", router)
+                    await store.dispatch("getUserInfoNoPath", router)
                 }
             }
 
@@ -214,10 +215,11 @@ function redirectGetToken (to) {
     if (previewUrl) {
         sessionStorage.setItem("SETISPREVIEW", previewUrl)
         store.commit('SETISPREVIEW', previewUrl)
-    }else{
-        sessionStorage.setItem("SETISPREVIEW", 'false')
-        store.commit('SETISPREVIEW', 'false')
     }
+    // else{
+    //     sessionStorage.setItem("SETISPREVIEW", 'false')
+    //     store.commit('SETISPREVIEW', 'false')
+    // }
     if (plazaId) {
         localStorage.setItem('PLAZAID', plazaId)
         store.commit('STOREPLAZAID', plazaId)

+ 9 - 7
src/store/index.js

@@ -14,9 +14,9 @@ import router from '../router'
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        ssoToken: 'admin:liulin34',
+        // ssoToken: 'admin:liujiandong',
         // ssoToken: '',
-        // ssoToken: null,
+        ssoToken: null,
         plazaName: '',
         isPreview: false,
         lastRoute: '',
@@ -180,7 +180,8 @@ export default new Vuex.Store({
                         commit('STOREACCESSLEVEL', res.level)
                         commit('SETAUTHMSG',res)
                         let level = res.level;
-                        if (window.opener.__fromGroupPage) {
+                        console.log('window.opener',window.opener)
+                        if (window.opener && window.opener.__fromGroupPage) {
                             let data = window.opener.__fromGroupPage
                             level = data.level
                             commit('SETPLAZENAME', data.plazaName)
@@ -198,6 +199,7 @@ export default new Vuex.Store({
                                 }
                                 router.push({
                                     path: './home/overview',
+                                    query:{plazaId: res.treeData[0].ccode}
                                 })
                             } else {
                                 router.push({
@@ -225,11 +227,11 @@ export default new Vuex.Store({
                 })
                 .then((res) => {
                     if (res.result === 'success') {
-                        commit('STOREACCESSLEVEL', res.level)
+                        // commit('STOREACCESSLEVEL', res.level)
                         commit('SETAUTHMSG',res)
-                        localStorage.setItem('PLAZAID', res.treeData[0].ccode)
-                        commit('STOREPLAZAID', res.treeData[0].ccode)
-                        commit('SETPLAZENAME', res.treeData[0].cname)
+                        // localStorage.setItem('PLAZAID', res.treeData[0].ccode)
+                        // commit('STOREPLAZAID', res.treeData[0].ccode)
+                        // commit('SETPLAZENAME', res.treeData[0].cname)
                     }
                 })
                 .catch((err) => {

+ 17 - 1
src/views/overview/index.vue

@@ -205,6 +205,9 @@
 import PicModal from './picModal'
 import { queryFact } from '@/api/overview'
 import { mapGetters } from 'vuex'
+import {
+    query
+} from "@/utils/query"
 export default {
     data() {
         return {
@@ -343,9 +346,10 @@ export default {
             // }
         },
         query() {
+            let plazaId = this.$route.query.plazaId ?this.$route.query.plazaId:this.plazaId
             let params = {
                 getParams: {
-                    plazaId: this.$store.state.plazaId || localStorage.getItem('PLAZAID'),
+                    plazaId: plazaId,
                     // plazaId: '1000303'//这个id有3条数据
                 },
             }
@@ -376,6 +380,8 @@ export default {
                     this.shuzihuayijiao = res.shuzihuayijiao ? res.shuzihuayijiao : ''
                     if (res.plazaName) {
                         this.$store.commit('SETPLAZENAME', res.plazaName)
+                    }else{
+                         this.$store.commit('SETPLAZENAME','')
                     }
                 }
             })
@@ -417,6 +423,16 @@ export default {
     components: {
         PicModal,
     },
+    watch: {
+        '$store.state.plazaId': {
+          handler(val,nel){
+           console.log('val',val,nel)
+           this.query()
+          },
+          immediate:true
+        }
+    },
+
 }
 </script>
 <style lang="less" scoped>

+ 56 - 52
src/views/statistics/index.vue

@@ -178,7 +178,7 @@ export default {
                 "东南": 'dongnan',
                 "其他": 'Other'
             },
-            provinceCities: {  // 各个区域的的省会城市  坐标 缩放级别 
+            provinceCities: {  // 各个区域的的省会城市  坐标 缩放级别
                 "青岛": { province: 'shandong', center: [36.06667, 120.33333], zoom: 8 },
                 "北京": { province: 'beijing', center: [39.604882122321174, 116.43660987308282], zoom: 8 },
                 "天津": { province: 'tianjin', center: [39.130593, 117.260892], zoom: 7 },
@@ -263,12 +263,12 @@ export default {
         this.currentTime()
     },
     mounted() {
-    
+
         window.vm = this
         this.getFrameworkTreeData()
         window.addEventListener('resize', this.reinitalMap, false)
     },
-    methods: {  
+    methods: {
         showToolTip (index) {
             this.maintainList.forEach(item => {item.showToolTip = false})
             this.maintainList[index].showToolTip = true
@@ -321,7 +321,7 @@ export default {
             this.currentZoneData = data
         },
         /**
-         * @Description 通过导航进行导航 
+         * @Description 通过导航进行导航
          * @Param id 所选区域的id
          * @Param index 点击项的序号
          */
@@ -332,8 +332,8 @@ export default {
             this.currentZoneData = data
             this.currentLevel = level
             this.getEventStatusData(level, data.ccode)
-            this.queryPlazaInfoCount(data.ccode, data.level, data.cid) 
-            this.getSystemList(data.ccode, data.level) 
+            this.queryPlazaInfoCount(data.ccode, data.level, data.cid)
+            this.getSystemList(data.ccode, data.level)
             if (level === 1) {
                 this.pantGroupMap(data, this.currentSysId)
             } else if (level === 2) {
@@ -356,12 +356,12 @@ export default {
             } else {
                 this.queryPlazaInfoCount(data.ccode, data.level)
             }
-       
-            this.getSystemList(data.ccode, data.level) 
+
+            this.getSystemList(data.ccode, data.level)
             this.getEventStatusData(this.currentLevel, data.ccode)
             this.createNavpathByData(data)
             this.currentZoneData = data
-  
+
             let level = data.level // //1集团 2中心 3区域 0广场
             if (level === 1) {
                 this.pantGroupMap(data, this.currentSysId)
@@ -371,20 +371,22 @@ export default {
                 this.pantProjectsMap(data, this.currentSysId)
             } else {   // 点击项为广场时 直接跳转到详情页  地图不用响应
                 let pathData = {fromGroup: 'true'}
-                let routeData = this.$router.resolve({  
-                    name:'/home/homePage',
-                })
-                window.open(routeData.href, '_blank');
+                let routeData = this.$router.resolve({
+                    path:'/home/overview',query:{plazaId:data.ccode}
+                     });
+                window.open(routeData.href, true);
                 window.__fromGroupPage = {
                     level: 0,
                     plazaName: data.cname,
                     plazaId: data.ccode
                 }
-                this.$store.commit('SETPLAZENAME', data.cname) 
-                localStorage.setItem('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)
             }
         },
-   
+
         /**
          * @Description  查询项目信息统计数量
          * @Param  ccode  管理分区编码 必填
@@ -469,7 +471,7 @@ export default {
             })
         },
          /**
-        * @Description 展开 维保 第三方检测 专维 
+        * @Description 展开 维保 第三方检测 专维
         * @Param  item 展开的某一项
         */
         toggerPanel(item) {
@@ -504,7 +506,7 @@ export default {
         /**
         *@Description 根据数据计算维保/第三方检测/专维各自颜色条的长度  维保、第三方检测是用即将逾期数据判断;专维是如果有逾期未完成直接标红,如果没有,按照即将逾期的数量显示颜色
         *@Param item 某一项的数据
-        *@Param title 标题 
+        *@Param title 标题
         */
         barStyle(item, title) {
             let bg = ''
@@ -512,7 +514,7 @@ export default {
             let ratio = 0
             if (title === '专维') {
                 if (item.unfinished>0) {
-                    bg = 'linear-gradient(to right, #F54E45 , #F54E45)'  
+                    bg = 'linear-gradient(to right, #F54E45 , #F54E45)'
                 } else {
                     bg = this.barColors[type]
                 }
@@ -527,11 +529,11 @@ export default {
             }
         },
         /**
-         * @Description 根据数据来返 维保/第三方检测/专维 三个模块中显示条的颜色 
+         * @Description 根据数据来返 维保/第三方检测/专维 三个模块中显示条的颜色
          * @Param num 即将逾期数 / 逾期未完成数
          * @Param total 总数
          */
-        selectColorByNum (num, total) {    
+        selectColorByNum (num, total) {
             let devide =  num / total
             if ( (num > 1 && num <=24  ) || (  devide > 0.1 && devide <=0.2 ) ) {
                 return 0
@@ -541,7 +543,7 @@ export default {
                 return 2
             }
         },
-  
+
         /**
         * @Description 根据数据 判定地图上图标的显示显示颜色
         * @Param data 作为判断的数据
@@ -579,7 +581,7 @@ export default {
             this.times = moment().format('YYYY.MM.DD HH:mm')
             setTimeout(this.currentTime, 1000)
         },
- 
+
          /**
         * @Description 格式化时间
         * @method param empty
@@ -599,7 +601,7 @@ export default {
         * @method param plazaId 广场id  如果是广场则此参数必填 其他情况下非必填
         */
         getSystemList(ccode, level) {
-            let params = null 
+            let params = null
             if (level === 0) {
                 params = {getParams:{plazaId: ccode, level}}
             } else {
@@ -631,7 +633,7 @@ export default {
          * @Param ccode 管理分区编码 必填
          * @Param level 1集团 2中心 3区域 0广场 必填
          */
-        getEventStatusData(level, ccode) {  
+        getEventStatusData(level, ccode) {
             let params = {
                 getParams: {
                     level,
@@ -641,7 +643,7 @@ export default {
             queryEventStatus(params).then(res => {
                 if (res.result === 'success') {
                     let data = res.data
-                    let orginalObj = { 
+                    let orginalObj = {
                         1:{title:'维保',data:[], expand: 0, showToolTip:false},
                         2:{title:'第三方检测',data:[], expand: 0, showToolTip:false},
                         0:{title:'专维',data:[], expand: 0, showToolTip:false},
@@ -702,13 +704,13 @@ export default {
                     }
                 }
             }).addTo(myMaps)
-            if (this.currentLevel === 1) {//1集团 
+            if (this.currentLevel === 1) {//1集团
                 this.pantGroupMap(this.currentZoneData, this.currentSysId)
             } else if (this.currentLevel === 2) {  // 2中心
                 this.pantZonesMap(this.currentZoneData, this.currentSysId)
-            } else if (this.currentLevel === 3) {  // 3区域 
+            } else if (this.currentLevel === 3) {  // 3区域
                 this.pantProjectsMap(this.currentZoneData, this.currentSysId)
-            }  
+            }
         },
         /**
          * @Description 清空地图 并添加全国底图
@@ -770,7 +772,7 @@ export default {
                 let promise = new Promise((resolve, reject) => {
                     let params = {
                         getParams: {
-                            smsxt: this.currentSysId,  
+                            smsxt: this.currentSysId,
                             level: 2,    // 中心
                             ccode: item.ccode
                         }
@@ -834,7 +836,7 @@ export default {
             data.children.forEach(item => {
                 let params = {
                     getParams: {
-                        smsxt: this.currentSysId, 
+                        smsxt: this.currentSysId,
                         level: 3,   // 区域
                         ccode: item.ccode
                     }
@@ -862,7 +864,7 @@ export default {
             })
             groupLayer.addTo(myMaps)
         },
-        
+
         /**
          * @Description 用于绘制项目的点
          * @Param data 数据
@@ -886,7 +888,7 @@ export default {
             let params = {
                 getParams: {
                     plazaId: item.cid,   // 所查对象是广场的时候plazaId必传
-                    smsxt: this.currentSysId,  
+                    smsxt: this.currentSysId,
                     level: 0,   // 广场
                     ccode: item.ccode
                 }
@@ -934,9 +936,9 @@ export default {
                 html: name,
                 className: 'my-leaflet-div-icon',
                 iconSize: 30
-            }) 
+            })
             let sizes = this.circleSize[zoom]
-            if (color  && center) { 
+            if (color  && center) {
                 popup = L.popup({closeOnClick:true}).setLatLng(center).setContent(contentHtml)
                 marker = L.marker([center[0] - sizes.offset,  center[1]], { icon: myIcon }).addTo(groupLayer)
                 outCircle = L.circle(center, sizes.outer, { color: 'transparent', fillColor: color.border, fillOpacity: 1 }).bindPopup(contentHtml).addTo(groupLayer)
@@ -949,7 +951,7 @@ export default {
                     this.currentZoneData = data
                     this.currentLevel = data.level
                     this.getEventStatusData(data.level, data.ccode)
-                    this.queryPlazaInfoCount(data.ccode, data.level) 
+                    this.queryPlazaInfoCount(data.ccode, data.level)
                     if (type !== 'project') {
                         groupLayer.clearLayers()
                     }
@@ -957,26 +959,29 @@ export default {
                     this.getSystemList(data.ccode, data.level)
                     if (type === 'group') {
                         this.pantZonesMap(data, this.currentSysId)
-                    } 
+                    }
                     if (type === 'zone') {
                         this.pantProjectsMap(data, this.currentSysId)
-                    } 
+                    }
                     if (type === 'project') {
-                        let routeData = this.$router.resolve({
-                            name:'/home/homePage',
-                        })
+
+                            let routeData = this.$router.resolve({
+                    path:'/home/overview',query:{plazaId:data.ccode}
+                     });
                         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('SETPLAZENAME', data.cname)
+                        // localStorage.setItem('PLAZAID', data.ccode)
+                        // this.$store.commit('STOREPLAZAID', data.ccode)
+                        this.$store.commit('SETISGETMAP',true)
+                    }
                 })
             }
-          
+
         },
         /**
          *@Description 生成弹出框HTML
@@ -990,7 +995,7 @@ export default {
                     let item = data[i]
                     if (item.is_exception_num) {
                         html += `<div class="line">
-                            <span>${item.category_name}</span> 
+                            <span>${item.category_name}</span>
                             <span>${item.asset_num || '--'}台</span>
                             <span><span style="display: inline-block;width: 16px;height: 16px;line-height: 16px;border-radius: 8px; color: white; background : #F54E45;text-align: center;cursor: default;">!</span><em>${
                                 item.is_exception_num
@@ -998,7 +1003,7 @@ export default {
                         </div>`
                     } else {
                         html += `<div class="line">
-                            <span>${item.category_name}</span> 
+                            <span>${item.category_name}</span>
                             <span>${item.asset_num || '--'}台</span>
                         </div>`
                     }
@@ -1008,7 +1013,7 @@ export default {
                 return ''
             }
         },
-        
+
     },
     beforeDestroy() {
         window.removeEventListener('resize', this.reinitalMap)
@@ -1196,7 +1201,7 @@ export default {
                 margin-left: 1.2rem;
             }
         }
-        
+
         .system-general {
             width: 25.4%;
             box-sizing: border-box;
@@ -1225,7 +1230,7 @@ export default {
                             display: flex;
                             align-items: center;
                             width: 28%;
-                            padding: 1.2rem 0 1.2rem 1rem ;  
+                            padding: 1.2rem 0 1.2rem 1rem ;
                             border-right: 1px solid #EFF0F1;
                             .img {
                                 height: 2.8rem;
@@ -1467,5 +1472,4 @@ export default {
         }
     }
 }
-</style> 
- 
+</style>

+ 2 - 2
vue.config.js

@@ -4,8 +4,8 @@ module.exports = {
         port: 8090,
         proxy: {
             '/data': {
-                target: 'http://60.205.177.43',
-                // target: 'http://10.199.143.126',
+                // target: 'http://60.205.177.43',
+                target: 'http://10.199.143.126',
                 // target: 'http://192.168.200.11:9003', //yll
                 // target: 'http://localhost:6040/data/',
                 changeOrigin: true,