Przeglądaj źródła

improve: 菜单判断处理

From-wh 2 lat temu
rodzic
commit
dd8eeb2a35

+ 1 - 0
template/admin/src/layout/component/aside.vue

@@ -120,6 +120,7 @@ export default {
     // 设置菜单导航是否固定(移动端)
     initMenuFixed(clientWidth) {
       this.clientWidth = clientWidth;
+      this.$emit('routesListChange');
     },
   },
   // 页面销毁时

+ 2 - 1
template/admin/src/layout/navBars/breadcrumb/setings.vue

@@ -275,7 +275,7 @@
             </el-radio-group>
           </div>
         </div>
-        <div class="layout-breadcrumb-seting-bar-flex mt15">
+        <div class="layout-breadcrumb-seting-bar-flex mt15" v-if="getThemeConfig.layout === 'columns'">
           <div class="layout-breadcrumb-seting-bar-flex-label">{{ $t('message.layout.fiveColumnsAsideStyle') }}</div>
           <div class="layout-breadcrumb-seting-bar-flex-value">
             <el-radio-group v-model="getThemeConfig.columnsAsideStyle" size="mini" @change="setLocalThemeConfig">
@@ -535,6 +535,7 @@ export default {
       if (this.$store.state.themeConfig.themeConfig.layout === layout) return false;
       this.$store.state.themeConfig.themeConfig.layout = layout;
       this.$store.state.themeConfig.themeConfig.isDrawer = false;
+      this.$store.state.themeConfig.themeConfig.columnsAsideStyle = 'columns-card';
       // this.initSetLayoutChange();
       this.setLocalTheme(this.$store.state.themeConfig.themeConfig.themeStyle);
     },

+ 6 - 2
template/admin/src/layout/navMenu/horizontal.vue

@@ -9,14 +9,18 @@
         @select="onHorizontalSelect"
       >
         <template v-for="val in menuList">
-          <el-submenu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
+          <el-submenu
+            :index="val.path"
+            v-if="val.is_show && val.children && val.children.length > 0"
+            :key="val.path"
+          >
             <template slot="title">
               <Icon :type="val.icon ? val.icon : ''" />
               <span>{{ $t(val.title) }}</span>
             </template>
             <SubItem :chil="val.children" />
           </el-submenu>
-          <template v-else>
+          <template v-else-if="val.is_show">
             <el-menu-item :index="val.path" :key="val.path">
               <template slot="title" v-if="!val.isLink || (val.isLink && val.isIframe)">
                 <Icon :type="val.icon ? val.icon : ''" />

+ 2 - 2
template/admin/src/layout/navMenu/subItem.vue

@@ -7,14 +7,14 @@
 <template>
   <div>
     <template v-for="val in chil">
-      <el-submenu :index="val.path" :key="val.path" v-if="!val.is_show_path && val.children && val.children.length > 0">
+      <el-submenu :index="val.path" :key="val.path" v-if="val.is_show && val.children && val.children.length > 0">
         <template slot="title">
           <i class="ivu-icon" :class="val.icon"></i>
           <span>{{ $t(val.title) }}</span>
         </template>
         <sub-item :chil="val.children" />
       </el-submenu>
-      <template v-else-if="!val.is_show_path">
+      <template v-else-if="val.is_show">
         <el-menu-item :index="val.path" :key="val.path">
           <template v-if="!val.isLink || (val.isLink && val.isIframe)">
             <i class="ivu-icon" :class="val.icon ? val.icon : ''"></i>

+ 2 - 2
template/admin/src/layout/navMenu/vertical.vue

@@ -12,7 +12,7 @@
       <template v-for="val in menuList">
         <el-submenu
           :index="val.path"
-          v-if="!val.is_show_path && val.children && val.children.length > 0"
+          v-if="val.is_show && val.children && val.children.length > 0"
           :key="val.path"
         >
           <template slot="title">
@@ -26,7 +26,7 @@
           </template>
           <SubItem :chil="val.children" />
         </el-submenu>
-        <template v-else-if="!val.is_show_path">
+        <template v-else-if="val.is_show">
           <el-menu-item :index="val.path" :key="val.path">
             <Icon
               :class="