Browse Source

动态配置菜单搜索显示

tongshangming 8 months ago
parent
commit
34617bb9a7
2 changed files with 6 additions and 2 deletions
  1. 5 2
      src/components/core/GlobalHeader.vue
  2. 1 0
      src/config/defaultSetting.ts

+ 5 - 2
src/components/core/GlobalHeader.vue

@@ -150,7 +150,7 @@ const handleSelect = (menu: any) => {
         </div>
       </div>
       <div class="flex items-center">
-        <el-button link @click="searchVisible = true">
+        <el-button link @click="searchVisible = true" v-if="config.showMenuSearch">
           <el-icon :size="iconSize" :fill="headerStyle.color">
             <Search />
           </el-icon>
@@ -214,7 +214,7 @@ const handleSelect = (menu: any) => {
     <GlobalSetting v-model="settingVisible"></GlobalSetting>
     <GlobalNews v-model="newsVisible"></GlobalNews>
 
-    <el-dialog v-model="searchVisible" width="600px">
+    <el-dialog title="菜单搜索" v-model="searchVisible" width="600px" class="menu-dialog" v-if="config.showMenuSearch">
       <el-autocomplete
         class="w-full"
         v-model="searchValue"
@@ -261,4 +261,7 @@ const handleSelect = (menu: any) => {
   align-items: center;
   outline: none;
 }
+:deep(.el-dialog__body) {
+  height: 350px;
+}
 </style>

+ 1 - 0
src/config/defaultSetting.ts

@@ -5,6 +5,7 @@ export default {
   themeStyle: 'nav-light', // 主题样式 nav-dark  nav-light  header-dark
   themeNav: 'left', // left | top
   showTabs: true, // 显示标签页
+  showMenuSearch: true, // 显示标签页
   keepAliveTabs: true, // 标签页持久化
   logoInHeader: true, // logo及title是否显示在头部,false时显示在左侧
   multiTenant: false, // 开启多租户