Przeglądaj źródła

第一次进入业务线选择导航fix bug

princeLee 4 lat temu
rodzic
commit
890f065299

+ 0 - 48
src/layout/components/Sidebar/index.vue

@@ -21,13 +21,6 @@
       <el-divider style="color: #EEF0F5; margin: 0px;" />
       <hamburger :is-active="sidebar.opened" class="hamburger-containers" @toggleClick="toggleSideBar" />
     </el-footer>
-    <div v-if="!isKnownBusness && bizId !== -1" class="business-guide">
-      <div class="guide-dialog">
-        <div class="guide-close"><i class="el-icon-error" @click="knownBusness()" /></div>
-        <div class="guide-title">业务线切换在这里哦!</div>
-        <div class="guide-confirm" @click="knownBusness()">好的,我知道了</div>
-      </div>
-    </div>
   </el-container>
 </template>
 
@@ -45,7 +38,6 @@ export default {
   mixins: [websocket],
   data() {
     return {
-      isKnownBusness: localStorage.getItem('known-business') || false,
       activeRoutes: []
     }
   },
@@ -94,10 +86,6 @@ export default {
     Logout() {
       location.href = logoutUrl
     },
-    knownBusness() {
-      localStorage.setItem('known-business', true)
-      this.isKnownBusness = true
-    },
     websocketonmessage(e) { // websocket数据接收
       const { hasReminding } = JSON.parse(e.data)
       if (hasReminding) {
@@ -138,40 +126,4 @@ export default {
 .el-submenu__title i {
   color: #333B4A;
 }
-.business-guide {
-  position: fixed;
-  height: 100vh;
-  width: 100vw;
-  z-index: 99;
-  background-color: rgba(0, 0, 0, 0.25);
-  font-size: 18px;
-  color: #FFFFFF;
-  .guide-dialog {
-    cursor: pointer;
-    width: 250px;
-    height: 215px;
-    padding-top: 110px;
-    position: relative;
-    left: 30px;
-    top: 15px;
-    background-image: url('../../../assets/bisness_guide.png');
-    background-size: contain;
-  }
-  .guide-close {
-    display: flex;
-    justify-content: flex-end;
-    padding: 0 10px;
-  }
-  .guide-title {
-    text-align: center;
-  }
-  .guide-confirm {
-    color: #409EFF;
-    background-color: #FFFFFF;
-    width: 140px;
-    margin: 10px auto;
-    text-align: center;
-    border-radius: 4px;
-  }
-}
 </style>

+ 55 - 1
src/views/newLayout/layout.vue

@@ -4,6 +4,13 @@
     <Head />
     <Aside />
     <Main />
+    <div v-if="!isKnownBusness && bizId !== -1" class="business-guide">
+      <div class="guide-dialog">
+        <div class="guide-close"><i class="el-icon-error" @click="knownBusness()" /></div>
+        <div class="guide-title">业务线切换在这里哦!</div>
+        <div class="guide-confirm" @click="knownBusness()">好的,我知道了</div>
+      </div>
+    </div>
   </div>
 </template>
 <script>
@@ -18,8 +25,19 @@ export default {
     Main,
     Head
   },
+  data() {
+    return {
+      isKnownBusness: localStorage.getItem('known-business') || false
+    }
+  },
   computed: {
-    ...mapGetters(['noNetwork'])
+    ...mapGetters(['noNetwork', 'bizId'])
+  },
+  methods: {
+    knownBusness() {
+      localStorage.setItem('known-business', true)
+      this.isKnownBusness = true
+    }
   }
 }
 </script>
@@ -39,6 +57,42 @@ export default {
   animation: loading linear 5s infinite;
   background: linear-gradient(0.25turn, #3f87a6, #ebf8e1, #f69d3c);
 }
+.business-guide {
+  position: fixed;
+  height: 100vh;
+  width: 100vw;
+  z-index: 99;
+  background-color: rgba(0, 0, 0, 0.25);
+  font-size: 18px;
+  color: #FFFFFF;
+  .guide-dialog {
+    cursor: pointer;
+    width: 250px;
+    height: 215px;
+    padding-top: 110px;
+    position: relative;
+    left: 0;
+    top: 15px;
+    background-image: url('../../assets/bisness_guide.png');
+    background-size: contain;
+  }
+  .guide-close {
+    display: flex;
+    justify-content: flex-end;
+    padding: 0 10px;
+  }
+  .guide-title {
+    text-align: center;
+  }
+  .guide-confirm {
+    color: #409EFF;
+    background-color: #FFFFFF;
+    width: 140px;
+    margin: 10px auto;
+    text-align: center;
+    border-radius: 4px;
+  }
+}
 @keyframes loading{
   from{
     width: 0