feat(theme): global search button toggle

- 在主题设置中添加全局搜索按钮的显示控制选项
- 更新多语言文件,添加全局搜索按钮显示控制的翻译
- 修改全局头部组件,根据主题设置决定是否显示全局搜索按钮
- 在主题抽屉中添加全局搜索按钮显示控制的开关
This commit is contained in:
t8y2 2025-05-29 11:09:12 +08:00 committed by Soybean
parent dfb647a82c
commit 75455b006c
6 changed files with 20 additions and 1 deletions

View File

@ -38,7 +38,7 @@ const { isFullscreen, toggle } = useFullscreen();
<GlobalBreadcrumb v-if="!appStore.isMobile" class="ml-12px" />
</div>
<div class="h-full flex-y-center justify-end">
<GlobalSearch />
<GlobalSearch v-if="themeStore.header.globalSearch.visible" />
<FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" />
<LangSwitch
v-if="themeStore.header.multilingual.visible"

View File

@ -130,6 +130,9 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
<SettingItem key="9" :label="$t('theme.header.multilingual.visible')">
<NSwitch v-model:value="themeStore.header.multilingual.visible" />
</SettingItem>
<SettingItem key="10" :label="$t('theme.header.globalSearch.visible')">
<NSwitch v-model:value="themeStore.header.globalSearch.visible" />
</SettingItem>
</TransitionGroup>
</template>

View File

@ -112,6 +112,9 @@ const local: App.I18n.Schema = {
},
multilingual: {
visible: 'Display multilingual button'
},
globalSearch: {
visible: 'Display GlobalSearch button'
}
},
tab: {

View File

@ -112,6 +112,9 @@ const local: App.I18n.Schema = {
},
multilingual: {
visible: '显示多语言按钮'
},
globalSearch: {
visible: '显示全局搜索按钮'
}
},
tab: {

View File

@ -30,6 +30,9 @@ export const themeSettings: App.Theme.ThemeSetting = {
},
multilingual: {
visible: true
},
globalSearch: {
visible: true
}
},
tab: {

View File

@ -58,6 +58,10 @@ declare namespace App {
/** Whether to show the multilingual */
visible: boolean;
};
globalSearch: {
/** Whether to show the GlobalSearch */
visible: boolean;
};
};
/** Tab */
tab: {
@ -377,6 +381,9 @@ declare namespace App {
multilingual: {
visible: string;
};
globalSearch: {
visible: string;
};
};
tab: {
visible: string;