From f6edee889e34cc5de979e05eac4dffe81e29a9f9 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 17 四月 2023 16:55:13 +0800
Subject: [PATCH] 1.多排备份

---
 src/layout/components/Navbar.vue |   52 ++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 3f7e36f..1b24596 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -5,29 +5,32 @@
       :class="{'display_btw':$store.state.settings.menuIsHorizontal}"
       :style="{background: $store.state.settings.headBackgroundColorValue? '#304156':'#fff'}"
     >
+
       <hamburger
         v-if="!$store.state.settings.menuIsHorizontal"
         :is-active="sidebar.opened"
         class="hamburger-container"
         @toggleClick="toggleSideBar"
       />
-      <!--      :style="{marginLeft:$store.state.settings.menuIsHorizontal?'50px':'40px'}"-->
+
       <breadcrumb
         class="breadcrumb-container"
-        :style="{marginLeft:$store.state.settings.menuIsHorizontal?'20px':''}"
+        :style="{marginLeft:$store.state.settings.menuIsHorizontal?'60px':'40px'}"
       />
 
-      <!--椤甸潰鍒锋柊鍔熻兘  鏆備笉寮�鍙�   鏈夐渶姹備簡鍐嶅紑鍙�-->
-      <!--      <el-tooltip class="item" effect="dark" content="鍒锋柊椤甸潰" placement="bottom">-->
-      <!--                <PageRefresh-->
-      <!--                  :style="{-->
-      <!--                    color:$store.state.settings.headBackgroundColorValue?'#fff':'#000',-->
-      <!--                    marginLeft:$store.state.settings.menuIsHorizontal?'20px':'50px'-->
-      <!--                  }"-->
-      <!--                  style="position: absolute;"-->
-      <!--                  @click="pageRefreshClick"-->
-      <!--                />-->
-      <!--      </el-tooltip>-->
+      <el-tooltip class="item" effect="dark" content="鍒锋柊椤甸潰" placement="bottom">
+        <div
+          :style="{
+            color:$store.state.settings.headBackgroundColorValue?'#fff':'#000',
+            marginLeft:$store.state.settings.menuIsHorizontal?'10px':'44px',
+            position:'absolute',
+          }"
+          style="padding:0 8px"
+          @click="pageRefreshClick"
+        >
+          <i class="el-icon-refresh-right" style="font-size: 20px;cursor: pointer;line-height:50px" />
+        </div>
+      </el-tooltip>
 
       <el-menu
         v-if="$store.state.settings.menuIsHorizontal"
@@ -147,7 +150,6 @@
 import Search from '@/components/HeaderSearch'
 import Screenfull from '@/components/Screenfull'
 import variables from '@/styles/variables.scss'
-import PageRefresh from '@/components/PageRefresh/PageRefresh'
 
 export default {
   components: {
@@ -155,8 +157,7 @@
     Breadcrumb,
     Hamburger,
     Search,
-    Screenfull,
-    PageRefresh
+    Screenfull
   },
   directives: { elDragDialog },
   data() {
@@ -200,6 +201,9 @@
       }
     }
   },
+  inject: [
+    'reload'
+  ],
   created() {
     this.usercode = getCookie('navTabId')
     this.username = getCookie('username')
@@ -234,6 +238,22 @@
     }
   },
   methods: {
+    pageRefreshClick() {
+      this.reload()
+      const tabViews = this.$store.state.tagsView.visitedViews.map(item => {
+        return {
+          fullPath: item.fullPath,
+          hash: item.hash,
+          meta: { ...item.meta },
+          name: item.name,
+          params: { ...item.params },
+          path: item.path,
+          query: { ...item.query },
+          title: item.title
+        }
+      })
+      sessionStorage.setItem('tabViews', JSON.stringify(tabViews))
+    },
     handleSelect(key, keyPath) {
       // console.log(key, keyPath)
     },

--
Gitblit v1.9.3