From 693c63dd4ea80db16f97c569df851a0f6fcf7906 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期六, 03 十二月 2022 17:37:50 +0800
Subject: [PATCH] bug修改

---
 src/store/index.js                     |   19 ++
 src/views/Synthesis/LeftMenu.vue       |    4 
 src/components/login.vue               |   15 +
 src/components/MapView/mapMenuPop.vue  |  148 +++++++++++-----
 src/components/mapsdk.vue              |   16 +
 src/views/maintenance/mochaitmo.vue    |   35 +++
 src/utils/auth.js                      |   13 +
 src/components/MapView/mapSpaceTop.vue |   52 +++--
 src/api/api.js                         |    4 
 src/views/Synthesis/index.vue          |    4 
 public/config/config.js                |    4 
 src/components/MapView/mapMenuTop.vue  |   83 ++++++--
 src/components/navMenu.vue             |   30 +++
 src/components/MapView/mapSpacePop.vue |  111 +++++++++++
 14 files changed, 425 insertions(+), 113 deletions(-)

diff --git a/public/config/config.js b/public/config/config.js
index 3ef8c78..3893467 100644
--- a/public/config/config.js
+++ b/public/config/config.js
@@ -1,6 +1,6 @@
-const BASE_URL = 'http://192.168.20.39:12316';
+const BASE_URL = 'http://192.168.20.39:12316/server';
 //webSocket 鏈嶅姟鍦板潃
-var socketUrl = 'ws://192.168.20.39:12316/ws/select';
+var socketUrl = 'ws://192.168.20.39:12316/server/ws/select';
 //鏁版嵁搴撶洃鎺у湴鍧�
 var sql_Url = 'http://192.168.20.39:8081/admin/druid/sql.html';
 //璺緞鍒嗘瀽鍦板潃
diff --git a/src/api/api.js b/src/api/api.js
index efbdf7f..26bbb9e 100644
--- a/src/api/api.js
+++ b/src/api/api.js
@@ -442,11 +442,11 @@
 
 //缁煎悎灞曠ず鑾峰彇
 export function select_Comprehensive_ByPageAndCount(params) {
-  return request.get('/comprehensive/selectAddrByPage', { params: params });
+  return request.get('/locate/selectAddrByPage', { params: params });
 }
 //缁煎悎灞曠ず鍦板悕瀹氫綅
 export function select_Comprehensive_SelectWktById(params) {
-  return request.get('/comprehensive/selectWktById', { params: params });
+  return request.get('/locate/selectWktById', { params: params });
 }
 //涓婁紶Shp鏂囦欢璇诲彇绗竴鏉¤褰曠殑WKT;
 export function inquiry_uploadShp(params) {
diff --git a/src/components/MapView/mapMenuPop.vue b/src/components/MapView/mapMenuPop.vue
index 4bfd496..7aa4cdd 100644
--- a/src/components/MapView/mapMenuPop.vue
+++ b/src/components/MapView/mapMenuPop.vue
@@ -14,32 +14,39 @@
     <div class="rightBox">
       <div class="rightTitle">
         <span>绠¢亾</span>
-        <el-link :underline="false" class="boxClose"
+        <el-link @click="closeMenuBox" :underline="false" class="boxClose"
           ><i class="el-icon-close"></i>
         </el-link>
       </div>
-      <el-table :data="tableData" height="220">
-        <el-table-column align="center" type="index" label="搴忓彿" width="50" />
-        <el-table-column label="瀹氫綅" width="100" align="center">
-          <template slot-scope="scope">
-            <el-button
-              icon="el-icon-map-location"
-              size="mini"
-              @click="spaceLocation(scope.$index, scope.row)"
-            ></el-button>
-          </template>
-        </el-table-column>
-        <el-table-column
-          v-for="(item, index) in attributeData"
-          :key="index"
-          :label="item.alias"
-          :prop="item.field"
-          show-overflow-tooltip
-          align="center"
-        ></el-table-column>
-      </el-table>
-      <div class="rightPage">
-        <!-- <el-pagination
+      <div class="tableBox">
+        <el-table :data="tableData" style="height: 100%; width: 100%">
+          <el-table-column
+            align="center"
+            type="index"
+            label="搴忓彿"
+            width="50"
+          />
+          <el-table-column label="瀹氫綅" width="100" align="center">
+            <template slot-scope="scope">
+              <el-button
+                icon="el-icon-map-location"
+                size="mini"
+                @click="spaceLocation(scope.$index, scope.row)"
+              ></el-button>
+            </template>
+          </el-table-column>
+          <el-table-column
+            v-for="(item, index) in attributeData"
+            :key="index"
+            :label="item.alias"
+            :prop="item.field"
+            show-overflow-tooltip
+            align="center"
+          ></el-table-column>
+        </el-table>
+      </div>
+      <!-- <div class="rightPage"> -->
+      <!-- <el-pagination
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="listPage.pageIndex"
@@ -49,7 +56,7 @@
           :total="listPage.pageCount"
         >
         </el-pagination> -->
-      </div>
+      <!-- </div> -->
     </div>
   </div>
 </template>
@@ -201,6 +208,15 @@
       }
       this.tableData = data.result;
     },
+    closeMenuBox() {
+      if (this.imagePoint != null) {
+        sgworld.Creator.DeleteObject(this.imagePoint);
+        this.imagePoint = null;
+      }
+      sgworld.Creator.SimpleGraphic.clear();
+      this.$store.state.mapPopBoolean = false;
+      this.$store.state.mapPopBoxFlag = null;
+    },
   },
   created() {
     this.setTableAll();
@@ -252,6 +268,9 @@
       color: white;
       width: 100%;
     }
+    .tableBox {
+      height: 327px;
+    }
     .rightPage {
       position: absolute;
       bottom: 10px;
@@ -264,31 +283,64 @@
       color: white;
     }
   }
-}
-</style>
-<style lang="less">
-/deep/ .el-table,
-.el-table__expanded-cell {
-  background-color: transparent !important;
-}
+  /deep/ .el-table {
+    background-color: transparent;
 
-/* 琛ㄦ牸鍐呰儗鏅鑹� */
-/deep/ .el-table th,
-.el-table tr,
-.el-table td {
-  background-color: transparent !important;
-  color: white;
-}
-/*鏈�澶栧眰閫忔槑*/
-/deep/ .el-table,
-/deep/ .el-table__expanded-cell {
-  background-color: transparent;
-}
-/* 琛ㄦ牸鍐呰儗鏅鑹� */
-/deep/ .el-table th,
-/deep/ .el-table tr,
-/deep/ .el-table td {
-  background-color: transparent;
+    th,
+    td {
+      background-color: transparent;
+    }
+    .el-table__expanded-cell {
+      background-color: transparent !important;
+    }
+
+    // 琛ㄥご鑳屾櫙鑹�
+    th.el-table__cell {
+      background-color: #303030;
+      color: #fff;
+    }
+    tr > td {
+      background-color: #303030;
+      color: #fff;
+    }
+
+    // hover鏁堟灉
+    tr:hover > td {
+      background-color: rgba(255, 255, 255, 0.3) !important;
+    }
+
+    tbody tr:hover {
+      background-color: rgba(255, 255, 255, 0.3) !important;
+      // text-align: center;
+    }
+
+    // 婊氬姩鏉″楂�
+    .el-table__body-wrapper::-webkit-scrollbar {
+      width: 5px;
+      height: 5px;
+    }
+
+    .el-table__body-wrapper::-webkit-scrollbar {
+      width: 5px;
+      /*婊氬姩鏉″搴�*/
+      height: 5px;
+      /*婊氬姩鏉¢珮搴�*/
+    }
+    /*瀹氫箟婊氬姩鏉¤建閬� 鍐呴槾褰�+鍦嗚*/
+    .el-table__body-wrapper::-webkit-scrollbar-track {
+      box-shadow: 0px 1px 3px #216fe6 inset;
+      /*婊氬姩鏉$殑鑳屾櫙鍖哄煙鐨勫唴闃村奖*/
+      border-radius: 10px;
+    }
+
+    /*瀹氫箟婊戝潡 鍐呴槾褰�+鍦嗚*/
+    .el-table__body-wrapper::-webkit-scrollbar-thumb {
+      box-shadow: 0px 1px 3px #216fe6 inset;
+      border-radius: 6px;
+      background-color: #216fe6;
+    }
+  }
 }
 </style>
+<style lang="less"></style>
 <style scoped lang="less"></style>
diff --git a/src/components/MapView/mapMenuTop.vue b/src/components/MapView/mapMenuTop.vue
index 33cfaa7..a327f84 100644
--- a/src/components/MapView/mapMenuTop.vue
+++ b/src/components/MapView/mapMenuTop.vue
@@ -7,20 +7,19 @@
           :title="treeChange"
           placeholder="璇烽�夋嫨..."
         >
-          <el-option
-            :value="menuTopFrom.queryLayer"
-            style="overflow: auto; height: 100%"
-          >
-            <el-tree
-              :data="layerData"
-              show-checkbox
-              node-key="id"
-              ref="tree"
-              accordion
-              highlight-current
-              :props="defaultProps"
-            >
-            </el-tree>
+          <el-option :value="menuTopFrom.queryLayer" style="height: 100%">
+            <div style="height: 200px; overflow: auto">
+              <el-tree
+                :data="layerData"
+                show-checkbox
+                node-key="id"
+                ref="tree"
+                accordion
+                highlight-current
+                :props="defaultProps"
+              >
+              </el-tree>
+            </div>
             <div style="margin-top: 5px">
               <el-button size="mini" plain @click="getCheckedNodes"
                 >纭</el-button
@@ -38,7 +37,11 @@
       </el-form-item>
 
       <el-form-item>
-        <el-select v-model="menuTopFrom.queryType" placeholder="璇烽�夋嫨...">
+        <el-select
+          @change="changeValue($event)"
+          v-model="menuTopFrom.queryType"
+          placeholder="璇烽�夋嫨..."
+        >
           <el-option
             v-for="item in queryOption"
             :key="item.value"
@@ -52,19 +55,20 @@
         <input
           :accept="'.shp, .shx, .dbf, .prj'"
           style="display: none"
+          ref="pathClear"
           type="file"
           name="file"
           id="getMenuTopFile"
           multiple="multiple"
           @change="setMenuTopFile()"
         />
-        <el-link @click="getMenuTopFile" :underline="false"
+        <!-- <el-link @click="getMenuTopFile" :underline="false"
           >瀵煎叆閫夋嫨鑼冨洿</el-link
-        >
+        > -->
       </el-form-item>
       <el-form-item>
         <el-button plain @click="getAttributeQuery">鏌ヨ</el-button>
-        <el-button type="info" plain>閲嶇疆</el-button>
+        <el-button type="info" @click="clearQuery" plain>閲嶇疆</el-button>
       </el-form-item>
     </el-form>
   </div>
@@ -118,6 +122,10 @@
           value: 'polygon',
           label: '澶氳竟褰�',
         },
+        {
+          value: 'inputFile',
+          label: '瀵煎叆閫夋嫨鑼冨洿',
+        },
       ],
       defaultProps: {
         children: 'children',
@@ -134,6 +142,15 @@
     this.getAllTable();
   },
   methods: {
+    changeValue(value) {
+      // var obj = {};
+      // obj = this.queryOption.find(function (item) {
+      //   return item.value === value;
+      // });
+      // if (obj.value == 'inputFile') {
+      //   this.getMenuTopFile();
+      // }
+    },
     async getAllTable() {
       const data = await inquiry_SelectTabs();
       if (data.code != 200) {
@@ -198,6 +215,7 @@
             return this.$message.error('鐢ㄦ埛瑙掕壊璇锋眰閿欒');
           }
           this.$store.state.mapMenuShpFile = rs.result;
+          this.showMapMenuPop();
         },
         error: (e) => {
           console.log(e);
@@ -212,8 +230,7 @@
       //娓呯┖鏍囩粯
       sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
       sgworld.Creator.SimpleGraphic.clear();
-      var val = document.getElementById('getMenuTopFile').files;
-      if (!val || !val.length) {
+      if (this.menuTopFrom.queryType != 'inputFile') {
         sgworld.Creator.createSimpleGraphic(
           this.menuTopFrom.queryType,
           {},
@@ -222,7 +239,7 @@
           }
         );
       } else {
-        this.showMapMenuPop();
+        this.getMenuTopFile();
       }
     },
     setTurfGeometry(res) {
@@ -296,7 +313,6 @@
       this.showMapMenuPop();
     },
     showMapMenuPop() {
-      console.log(this.treeChange);
       this.$store.state.mapSpaceQueryLayer = this.treeChange;
       if (
         this.$store.state.mapPopBoolean != true &&
@@ -307,8 +323,17 @@
       }
       this.$bus.$emit('changeMapMenuTop', 'true');
       //娓呯┖inputFile
-      var file = document.getElementById('getMenuTopFile');
-      file.outerHTML = file.outerHTML;
+      // var file = document.getElementById('getMenuTopFile');
+      // file.outerHTML = file.outerHTML;
+      this.$refs.pathClear.value = '';
+    },
+    clearQuery() {
+      this.$refs.pathClear.value = '';
+      this.treeChange = [];
+      this.menuTopFrom.queryLayer = null;
+      this.menuTopFrom.queryType = 'rectangle';
+      this.$refs.tree.setCheckedKeys([]);
+      sgworld.Creator.SimpleGraphic.clear();
     },
     setCartesianToEightFour(res) {
       var std = {};
@@ -323,7 +348,7 @@
 };
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
 .menuBox {
   width: 98%;
   height: 100%;
@@ -338,4 +363,12 @@
   padding: 4px 20px;
   font-weight: 400;
 }
+/deep/.el-input__inner {
+  background-color: transparent !important ;
+  color: #fff;
+  border: 1px solid;
+}
+/deep/ .el-select .el-input__inner {
+  border-color: #fff !important;
+}
 </style>
diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue
index 610fdd7..9c43282 100644
--- a/src/components/MapView/mapSpacePop.vue
+++ b/src/components/MapView/mapSpacePop.vue
@@ -79,7 +79,7 @@
         </el-table>
       </div>
 
-      <div class="bottomPage">
+      <div class="bottomPage pagination_box">
         <el-pagination
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
@@ -358,15 +358,16 @@
 };
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
 .menuPop {
-  width: 100%;
-  height: 100%;
+  width: calc(100% - 1px);
+  height: calc(100% - 1px);
   margin: 0;
   padding: 0;
   overflow: hidden;
   border: 1px solid gray;
   float: left;
+
   .rightTitle {
     padding: 5px;
     color: white;
@@ -382,5 +383,107 @@
     position: absolute;
     bottom: 1%;
   }
+  // 璁剧疆杈撳叆妗嗙殑鑳屾櫙鑹层�佸瓧浣撻鑹层�佽竟妗嗗睘鎬ц缃紱
+  /deep/.el-input__inner {
+    background-color: transparent !important ;
+    color: #fff;
+    border: 1px solid;
+  }
+  /deep/ .el-select .el-input__inner {
+    border-color: #fff !important;
+  }
+  /deep/ .el-table {
+    background-color: transparent;
+
+    th,
+    td {
+      background-color: transparent;
+    }
+    .el-table__expanded-cell {
+      background-color: transparent !important;
+    }
+
+    // 琛ㄥご鑳屾櫙鑹�
+    th.el-table__cell {
+      background-color: #303030;
+      color: #fff;
+    }
+    tr > td {
+      background-color: #303030;
+      color: #fff;
+    }
+
+    // hover鏁堟灉
+    tr:hover > td {
+      background-color: rgba(255, 255, 255, 0.3) !important;
+    }
+
+    tbody tr:hover {
+      background-color: rgba(255, 255, 255, 0.3) !important;
+      // text-align: center;
+    }
+
+    // 婊氬姩鏉″楂�
+    .el-table__body-wrapper::-webkit-scrollbar {
+      width: 5px;
+      height: 5px;
+    }
+
+    .el-table__body-wrapper::-webkit-scrollbar {
+      width: 5px;
+      /*婊氬姩鏉″搴�*/
+      height: 5px;
+      /*婊氬姩鏉¢珮搴�*/
+    }
+    /*瀹氫箟婊氬姩鏉¤建閬� 鍐呴槾褰�+鍦嗚*/
+    .el-table__body-wrapper::-webkit-scrollbar-track {
+      box-shadow: 0px 1px 3px #216fe6 inset;
+      /*婊氬姩鏉$殑鑳屾櫙鍖哄煙鐨勫唴闃村奖*/
+      border-radius: 10px;
+    }
+
+    /*瀹氫箟婊戝潡 鍐呴槾褰�+鍦嗚*/
+    .el-table__body-wrapper::-webkit-scrollbar-thumb {
+      box-shadow: 0px 1px 3px #216fe6 inset;
+      border-radius: 6px;
+      background-color: #216fe6;
+    }
+  }
+  .pagination_box {
+    margin-top: 20px;
+    /deep/.el-input__inner {
+      background-color: transparent !important;
+      border: 1px solid;
+      color: white;
+    }
+    /deep/.el-pagination__total {
+      color: white;
+    }
+    /deep/.el-pagination__jump {
+      color: white;
+    }
+    /deep/.el-pager li.active {
+      color: #409eff;
+    }
+    /deep/.el-pager li {
+      color: white;
+      background: transparent;
+    }
+    /deep/.el-pager li {
+      color: white;
+    }
+    /deep/.btn-prev {
+      background: transparent;
+    }
+    /deep/.btn-next {
+      background: transparent;
+    }
+    /deep/.btn-next i {
+      color: white;
+    }
+    /deep/.btn-prev i {
+      color: white;
+    }
+  }
 }
 </style>
diff --git a/src/components/MapView/mapSpaceTop.vue b/src/components/MapView/mapSpaceTop.vue
index 60d546f..1406bdd 100644
--- a/src/components/MapView/mapSpaceTop.vue
+++ b/src/components/MapView/mapSpaceTop.vue
@@ -1,23 +1,22 @@
 <template>
   <div class="spaceBox">
     <el-select v-model="menuTopFrom.queryLayer" placeholder="璇烽�夋嫨...">
-      <el-option
-        :value="menuTopFrom.queryLayer"
-        style="overflow: auto; height: 100%"
-      >
-        <el-tree
-          :data="layerData"
-          :props="defaultProps"
-          :show-checkbox="true"
-          :check-on-click-node="true"
-          :check-strictly="true"
-          node-key="id"
-          @check="menuTreeCheck"
-          ref="treeForm"
-          :default-expanded-keys="[1]"
-          accordion
-        >
-        </el-tree>
+      <el-option :value="menuTopFrom.queryLayer" style="height: 100%">
+        <div style="height: 200px; overflow: auto">
+          <el-tree
+            :data="layerData"
+            :props="defaultProps"
+            :show-checkbox="true"
+            :check-on-click-node="true"
+            :check-strictly="true"
+            node-key="id"
+            @check="menuTreeCheck"
+            ref="treeForm"
+            :default-expanded-keys="[1]"
+            accordion
+          >
+          </el-tree>
+        </div>
         <div style="margin-top: 5px">
           <el-button size="mini" plain @click="getCheckedNodes">纭</el-button>
           <el-button size="mini" type="info" plain @click="resetCheckedNodes"
@@ -113,11 +112,28 @@
   overflow: hidden;
 }
 </style>
-<style lang="less">
+<style lang="less" scoped>
 .el-tree .el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner {
   display: inline-block;
 }
 .el-tree .el-tree-node .el-checkbox .el-checkbox__inner {
   display: none;
 }
+
+/deep/.el-form-item__label {
+  color: white;
+}
+/deep/.el-input__inner {
+  background-color: transparent !important ;
+  color: #fff !important;
+  border: 1px solid;
+}
+
+/deep/ .el-input__inner {
+  border-color: #fff !important;
+}
+/deep/.el-select-dropdown {
+  border-color: white;
+  opacity: 0.85;
+}
 </style>
diff --git a/src/components/login.vue b/src/components/login.vue
index 9957012..0588ded 100644
--- a/src/components/login.vue
+++ b/src/components/login.vue
@@ -155,6 +155,7 @@
 import { getPerms } from '../api/api';
 import validCode from './verificationCode.vue';
 import { mapActions } from 'vuex';
+import moment from 'moment';
 
 export default {
   components: { validCode },
@@ -208,16 +209,18 @@
     getCode(data) {
       this.validCode = data; //鍦╠ata涓畾涔変竴涓� validCode:'',鐢ㄦ潵璁板綍楠岃瘉鐮併��
     },
+
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.loading = true;
-
           this.login(this.loginForm)
             .then((response) => {
+              this.setCookies(response);
               getPerms().then((res) => {
                 if (res.code == 200) {
                   this.$store.commit('getPermsEntity', res.result);
+
                   if (res.result.length != 0) {
                     this.$router.push('/');
                   }
@@ -241,6 +244,16 @@
         }
       });
     },
+    setCookies(res) {
+      var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss');
+      var LfPrems = {
+        token: res.result.token,
+        uname: res.result.uname,
+        time: timeData,
+      };
+      LfPrems = JSON.stringify(LfPrems);
+      localStorage.setItem('LFToken', LfPrems);
+    },
   },
   created() {},
 };
diff --git a/src/components/mapsdk.vue b/src/components/mapsdk.vue
index 37f01d3..41a8d33 100644
--- a/src/components/mapsdk.vue
+++ b/src/components/mapsdk.vue
@@ -75,7 +75,7 @@
                 ></el-input>
               </el-form-item>
               <el-form-item>
-                <el-button type="info">鏌ヨ</el-button>
+                <el-button @click="setQueryTable" type="info">鏌ヨ</el-button>
               </el-form-item>
             </el-form>
             <el-table :data="tableData" height="200px" style="width: 100%">
@@ -428,6 +428,11 @@
     },
     handleCurrentChange(val) {
       this.listData.pageIndex = val;
+      this.getToponymicData();
+    },
+    setQueryTable() {
+      this.listData.pageSize = 10;
+      this.listData.pageIndex = 1;
       this.getToponymicData();
     },
     async getToponymicData() {
@@ -824,12 +829,14 @@
     }
 
     .box-card {
-      background-color: rgba(0, 0, 0, 0.6);
+      background: #303030;
+      opacity: 0.85;
       border: 1px solid rgba(32, 160, 255, 0.6);
       color: white;
     }
     .menu_Top {
-      background: rgba(0, 0, 0, 0.5);
+      background: #303030;
+      opacity: 0.85;
       width: 100%;
       height: 6%;
       padding: 1%;
@@ -837,7 +844,8 @@
       z-index: 40;
     }
     .menu_Popup {
-      background: rgba(0, 0, 0, 0.6);
+      background: #303030;
+      opacity: 0.85;
       width: 60%;
       height: 45%;
 
diff --git a/src/components/navMenu.vue b/src/components/navMenu.vue
index 4a84824..c9c21bc 100644
--- a/src/components/navMenu.vue
+++ b/src/components/navMenu.vue
@@ -64,7 +64,7 @@
 import { logout, selectMenuRecursive } from '@/api/api';
 import { removeToken, getToken } from '@/utils/auth';
 import customElMenu from '../components/customElMenu.vue';
-import { queryMenuTree } from '../api/api';
+import { queryMenuTree, getPerms } from '../api/api';
 import colorChange from '../views/maintenance/colorChange.vue';
 import { containsCoordinate } from 'ol/extent';
 import Vue from 'vue';
@@ -126,6 +126,30 @@
   },
   computed: {},
   methods: {
+    async getCookies() {
+      var boolean = this.getTimeCookies();
+      if (boolean != true) {
+        this.$router.push('/login');
+        return;
+      }
+      if (this.$store.state.permsEntity.length == 0) {
+        const data = await getPerms();
+        this.$store.state.permsEntity = data.result;
+      }
+      this.$store.state.uname = JSON.parse(
+        localStorage.getItem('LFToken')
+      ).uname;
+      this.$router.push('/');
+    },
+    getTimeCookies() {
+      var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time);
+      var time2 = new Date();
+      if (time2 > time1) {
+        return false;
+      } else {
+        return true;
+      }
+    },
     //涓婚鍒囨崲
     setThemeColors() {},
     //榧犳爣绉诲叆鑿滃崟浜嬩欢
@@ -152,6 +176,7 @@
 
       this.changeSelectStyle = index;
     },
+
     setShowFalseDiv(bolean) {
       var index = this.showFlag;
       let newItem = this.listMenu[index];
@@ -165,6 +190,7 @@
       this.$store.commit('currentPerms', res.perms);
     },
     async getMenuTree() {
+      this.getCookies();
       const data = await queryMenuTree();
       var that = this;
       if (data.code == 200) {
@@ -508,7 +534,7 @@
   }
   .secondMenuDiv {
     position: absolute;
-    z-index: 30;
+    z-index: 1024;
     margin-top: 10px;
     border: 1px solid white;
     border-radius: 5px;
diff --git a/src/store/index.js b/src/store/index.js
index dce886f..1421aaf 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -141,9 +141,9 @@
                 duration: 5 * 1000,
               });
             }
-
             commit('SET_UNAME', data.result.uname);
             commit('SET_TOKEN', data.result.token);
+
             setToken(data.result.token);
             resolve(data);
           })
@@ -152,6 +152,23 @@
           });
       });
     },
+    setCookies(res) {
+      var value = localStorage.getItem('LFToken');
+      if (value != null) {
+        this.rmCookies();
+      }
+      var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss');
+      var token = res.result;
+      var LfPrems = {
+        token: token,
+        time: timeData,
+      };
+      LfPrems = JSON.stringify(LfPrems);
+      localStorage.setItem('LFToken', LfPrems);
+    },
+    rmCookies() {
+      localStorage.removeItem('LFToken');
+    },
     getpublickey({ commit, state }, userInfo) {
       return new Promise((resolve, reject) => {
         getPublicKey(userInfo)
diff --git a/src/utils/auth.js b/src/utils/auth.js
index c6b74ea..8cfd2a3 100644
--- a/src/utils/auth.js
+++ b/src/utils/auth.js
@@ -22,8 +22,11 @@
 // }
 //===========================
 //=======浣跨敤sessionStorage======
+
 const TokenKey = 'Admin-Token';
+
 export function getToken() {
+  console.log(window.sessionStorage.getItem(TokenKey));
   return window.sessionStorage.getItem(TokenKey);
 }
 
@@ -34,3 +37,13 @@
 export function removeToken() {
   return window.sessionStorage.removeItem(TokenKey);
 }
+// export function setCookies(res) {
+//   var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss');
+//   var token = res.result;
+//   var LfPrems = {
+//     token: token,
+//     time: timeData,
+//   };
+//   LfPrems = JSON.stringify(LfPrems);
+//   localStorage.setItem('LFToken', LfPrems);
+// }
diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue
index b860782..8812b0e 100644
--- a/src/views/Synthesis/LeftMenu.vue
+++ b/src/views/Synthesis/LeftMenu.vue
@@ -550,11 +550,11 @@
     },
     setIquery(res) {
       switch (res) {
-        case 'e1':
+        case 'e2':
           this.$store.state.mapMenuBoolean = true;
           this.$store.state.mapMenuBoxFlag = '1';
           break;
-        case 'e2':
+        case 'e1':
           this.$store.state.mapMenuBoolean = true;
           this.$store.state.mapMenuBoxFlag = '2';
           break;
diff --git a/src/views/Synthesis/index.vue b/src/views/Synthesis/index.vue
index 4b29cb9..60f9ecb 100644
--- a/src/views/Synthesis/index.vue
+++ b/src/views/Synthesis/index.vue
@@ -156,6 +156,10 @@
     },
   },
   mounted() {
+    this.$store.state.mapMenuBoolean = false;
+    this.$store.state.mapMenuBoxFlag = null;
+    this.$store.state.mapPopBoolean = false;
+    this.$store.state.mapPopBoxFlag = null;
     this.initMap();
   },
   //鍒濆鍖栬彍鍗曟巿鏉�
diff --git a/src/views/maintenance/mochaitmo.vue b/src/views/maintenance/mochaitmo.vue
index 42b1cd8..3e9eb76 100644
--- a/src/views/maintenance/mochaitmo.vue
+++ b/src/views/maintenance/mochaitmo.vue
@@ -87,7 +87,7 @@
 import databaseMonitoring from '@/views/maintenance/databaseMonitoring.vue'; //鏁版嵁搴撶洃鎺�
 import systemMonitoring from '@/views/maintenance/systemMonitoring.vue'; //绯荤粺鐩戞帶
 import parameterConfiguration from '@/views/maintenance/parameterConfiguration.vue'; //绯荤粺閰嶇疆
-import { selectMenuRecursive, queryMenuTree } from '../../api/api';
+import { selectMenuRecursive, queryMenuTree, getPerms } from '../../api/api';
 import customElMenu from '../../components/customElMenu.vue';
 export default {
   components: {
@@ -132,11 +132,33 @@
       formLabelWidth: '70px',
     };
   },
-  created() {},
-  mounted() {
+  created() {
     this.getTreeData();
   },
+  mounted() {},
   methods: {
+    async getCookies() {
+      var boolean = this.getTimeCookies();
+      if (boolean != true) {
+        this.$router.push('/login');
+        return;
+      }
+      if (this.$store.state.permsEntity.length == 0) {
+        const data = await getPerms();
+        this.$store.state.permsEntity = data.result;
+      }
+      var store = this.menuList[0];
+      this.setViewController(store);
+    },
+    getTimeCookies() {
+      var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time);
+      var time2 = new Date();
+      if (time2 > time1) {
+        return false;
+      } else {
+        return true;
+      }
+    },
     //鑾峰彇鏍�
     async getTreeData() {
       const data = await queryMenuTree();
@@ -150,7 +172,8 @@
             return value.type == 1;
           });
           this.menuList = this.treeData(menuList);
-          this.setViewController(this.menuList[0]);
+          this.getCookies();
+          //
         } else {
           alert('鏆傛棤鑿滃崟鏍忔暟鎹�');
         }
@@ -161,6 +184,9 @@
       // this.treeList = this.treeData(data.result);
     },
     setViewController(res) {
+      if (res == null) {
+        return;
+      }
       if (res.children != null) {
         this.setViewController(res.children[0]);
       } else {
@@ -187,6 +213,7 @@
     },
 
     handleselect(index, indexPath, e) {
+      this.getTimeCookies();
       var data = e.$attrs.perms;
       this.$store.state.currentPerms = data.perms;
       var index = data.url;

--
Gitblit v1.9.3