Procházet zdrojové kódy

修改图标及显示

lex-xin před 4 roky
rodič
revize
12ee1ae077

+ 1 - 1
src/App.vue

@@ -377,7 +377,7 @@ input[type="number"] {
     background-color: #F56C6C;
     border-radius: 50%;
     right: -10px;
-    top: -4px;
+    top: 15px;
   }
 }
 </style>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
src/assets/images/base/base-home.svg


+ 2 - 1
src/layout/components/Navbar.vue

@@ -49,7 +49,8 @@
           </div>
           <span slot="reference" style="display: flex;align-items: center;justify-content: center;">
             <!-- {{ organName.length > 10 ? organName.substr(0, 10) + "..." : organName }} -->
-            <i class="el-icon-s-home" style="font-size: 23px; color: #1A1A1A;"></i>
+            <!-- <i class="el-icon-s-home" style="font-size: 23px; color: #1A1A1A;"></i> -->
+            <img src="@/assets/images/base/base-home.svg" style="width: 23px;">
           </span>
         </el-popover>
       </div>

+ 32 - 2
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,5 +1,5 @@
 <template>
-  <div v-if="!item.hidden" class="menu-wrapper">
+  <div v-if="!item.hidden" v-show="menuIsShow(item)" class="menu-wrapper">
     <template
       v-if="
         hasOneShowingChild(item.children, item) &&
@@ -52,7 +52,7 @@ import { isExternal } from "@/utils/validate";
 import Item from "./Item";
 import AppLink from "./Link";
 import FixiOSBug from "./FixiOSBug";
-
+import { getBelongTopMenuPath } from '@/utils/permission';
 export default {
   name: "SidebarItem",
   components: { Item, AppLink },
@@ -71,6 +71,10 @@ export default {
       type: String,
       default: "",
     },
+    activeTopMenu: {
+          type: String,
+          default: ''
+      }
   },
   data() {
     // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
@@ -81,7 +85,33 @@ export default {
   mounted() {
     this.onlyOneChild = null;
   },
+  computed: {
+    getActiveTopMenu: function () {
+      if (this.activeTopMenu !== '') {
+          return this.activeTopMenu;
+      }
+      const route = this.$route;
+      /*
+      const { meta, path } = route;
+      if (meta.belongTopMenu) {
+          return meta.belongTopMenu;
+      }
+      return '/' + path.split('/')[1];
+      */
+      return getBelongTopMenuPath(route);
+    },
+  },
   methods: {
+    menuIsShow(route) {
+        let activeTopMenu = this.basePath;
+        const { meta } = route;
+        if (meta.belongTopMenu) {
+            activeTopMenu = meta.belongTopMenu;
+        }
+        //
+        // console.log(activeTopMenu, this.getActiveTopMenu)
+        return activeTopMenu === this.getActiveTopMenu;
+    },
     hasOneShowingChild(children = [], parent) {
       const showingChildren = children.filter((item) => {
         if (item.hidden) {

+ 6 - 1
src/layout/components/Sidebar/index.vue

@@ -15,7 +15,12 @@
         <template v-for="route in permission_routes">
           <template v-if="!route.hidden">
             <!-- <sidebar-item  v-for="route2 in route.children" :key="route.path + '/' + route2.path" :item="route2" :base-path="route.path" :resolve-path="route.path" :active-top-menu="getTopMenuActive" /> -->
-            <sidebar-menu-item v-for="route2 in route.children" :key="route.path + '/' + route2.path" :routes="route2" :base-path="route.path" :resolve-path="route.path" :active-top-menu="getTopMenuActive"/>
+            <!-- <sidebar-menu-item v-for="route2 in route.children" :key="route.path + '/' + route2.path" :routes="route2" :base-path="route.path" :resolve-path="route.path" :active-top-menu="getTopMenuActive"/> -->
+            <sidebar-item v-for="(route2) in route.children"
+                      :key="route.path + '/' + route2.path"
+                      :item="route2"
+                      :active-top-menu="getTopMenuActive"
+                      :base-path="route2.path" />
           </template>
         </template>
         <!-- <sidebar-item v-for="(route,index) in permission_routes"

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů