refactor: 界面重构美化

This commit is contained in:
Ray.Hao
2026-05-11 11:54:22 +08:00
parent 66615279eb
commit fe0775fbdb
31 changed files with 2836 additions and 2172 deletions

View File

@@ -15,6 +15,7 @@ export const useAppStore = defineStore("app", () => {
withoutAnimation: false,
});
const activeTopMenuPath = useStorage(STORAGE_KEYS.ACTIVE_TOP_MENU_PATH, "");
const contentFullscreen = ref(false);
const locale = computed(() => (language?.value === "en" ? en : zhCn));
@@ -49,6 +50,10 @@ export const useAppStore = defineStore("app", () => {
activeTopMenuPath.value = val;
}
function toggleContentFullscreen() {
contentFullscreen.value = !contentFullscreen.value;
}
return {
device,
sidebar,
@@ -56,12 +61,14 @@ export const useAppStore = defineStore("app", () => {
locale,
size,
activeTopMenu,
contentFullscreen,
toggleDevice,
changeSize,
changeLanguage,
toggleSidebar,
closeSideBar,
openSideBar,
toggleContentFullscreen,
activeTopMenuPath,
};
});

View File

@@ -32,6 +32,12 @@ export const useSettingsStore = defineStore("setting", () => {
// 主题
const theme = useStorage<ThemeMode>(STORAGE_KEYS.THEME, defaults.theme);
const themeColor = useStorage(STORAGE_KEYS.THEME_COLOR, defaults.themeColor);
// 旧默认值 → 新默认值 自动迁移(用户自定义的颜色不会被覆盖)
const LEGACY_DEFAULTS = ["#4080FF", "#4080ff", "#2563EB", "#2563eb"];
if (LEGACY_DEFAULTS.includes(themeColor.value)) {
themeColor.value = defaults.themeColor;
}
const resolvedTheme = ref<ThemeMode>(resolveThemeMode(theme.value));
// 特殊模式

View File

@@ -218,6 +218,7 @@ export const useTagsViewStore = defineStore("tagsView", () => {
title: route.meta.title as string,
path: route.path,
fullPath: route.fullPath,
icon: route.meta?.icon as string | undefined,
affix: route.meta?.affix,
keepAlive: route.meta?.keepAlive,
query: route.query,