huangmp 4 лет назад
Родитель
Сommit
e359aab0dd
5 измененных файлов с 31 добавлено и 2 удалено
  1. 3 1
      src/components/map/divide.vue
  2. 3 0
      src/main.js
  3. 1 1
      src/page/index/top/index.vue
  4. 3 0
      src/page/login/userlogin.vue
  5. 21 0
      src/util/cache.js

+ 3 - 1
src/components/map/divide.vue

@@ -577,6 +577,7 @@
        * 更新标记集合
        */
       updateGeometries(styleId = 'marker') {
+        console.log('updateGeometries');
         //更新标点坐标
         if (this.$isEmpty(this.coordinates)) {
           markers.setGeometries([])
@@ -608,7 +609,7 @@
         infoWindow.close(); //初始关闭信息窗关闭
         //监听标注点击事件
         markers.on("click", (evt) => {
-          console.log(this.operaType == 0);
+          console.log('markers.on');
           let item = evt.geometry.properties
           if (this.operaType == 0) {
             this.openInfoWindow(item)
@@ -678,6 +679,7 @@
         editor.setSelectable(true)
       },
       async createUpdateWapper() {
+        console.log(createUpdateWapper);
         this.removeEditRemark()
         this.operaType = 0
         editor.setSelectable(false)

+ 3 - 0
src/main.js

@@ -34,6 +34,9 @@ require('echarts');
 Vue.prototype.$datavAlert = alert;
 
 
+//缓存
+import simpleCache from "@/util/cache.js"
+Vue.prototype.$cache = simpleCache
 // 添加动画
 import animated from 'animate.css'
 Vue.use(animated)

+ 1 - 1
src/page/index/top/index.vue

@@ -53,7 +53,7 @@
       <div style="margin-left: 20px;"></div>
       <el-dropdown>
         <span class="el-dropdown-link">
-          <i class="icon" style="cursor: pointer;">{{userInfo.userName || 'admin'}}</i>
+          <i class="icon" style="cursor: pointer;">{{$cache.get('userName')||'admin'}}</i>
           <i class="el-icon-arrow-down el-icon--right icon" style="font-size: 18px;"></i>
         </span>
         <el-dropdown-menu slot="dropdown">

+ 3 - 0
src/page/login/userlogin.vue

@@ -69,6 +69,8 @@
   import {
     getTenantTypeByTenantId
   } from "@/api/system/tenanttype"
+  
+  import {setStore} from "@/util/store.js"
 
   export default {
     name: "userlogin",
@@ -148,6 +150,7 @@
               spinner: "el-icon-loading"
             });
             this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
+              this.$cache.put('userName',this.loginForm.username)
               // this.$router.push({path: this.tagWel.value});
               getByTenantId(this.loginForm.tenantId).then(res => {
                 var _this = this;

+ 21 - 0
src/util/cache.js

@@ -0,0 +1,21 @@
+import { getStore,setStore } from "./store.js"
+
+let simpleCache={}
+
+
+simpleCache.put=(name,content)=>{
+  let parmas={
+    name,
+    content
+  }
+  setStore(parmas)
+}
+
+simpleCache.get=(name)=>{
+  let params={
+    name
+  }
+  return getStore(params)
+}
+
+export default simpleCache