From 389026d348722721daf910f7c9d4e6eddd746bbc Mon Sep 17 00:00:00 2001
From: ray <1490493387@qq.com>
Date: Sat, 6 Jul 2024 10:20:54 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E9=A1=B9=20class=20=E7=B1=BB=E5=90=8D=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E3=80=81=E5=AE=8C=E5=96=84=E6=96=B9=E6=B3=95=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/components/Settings/index.vue | 26 ++++++++++--------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue
index 49b44715..ad3782cd 100644
--- a/src/layout/components/Settings/index.vue
+++ b/src/layout/components/Settings/index.vue
@@ -17,7 +17,7 @@
{{ $t("settings.interface") }}
-
+
{{ $t("settings.themeColor") }}
-
+
{{ $t("settings.tagsView") }}
-
+
{{ $t("settings.fixedHeader") }}
-
+
{{ $t("settings.sidebarLogo") }}
-
+
{{ $t("settings.watermark") }}
@@ -73,25 +73,19 @@ const settingsVisible = computed({
},
});
-/**
- * 切换主题颜色
- */
+/** 切换主题颜色 */
function changeThemeColor(color: string) {
settingsStore.changeThemeColor(color);
}
-/**
- * 切换主题
- */
+/** 切换主题 */
const isDark = ref
(settingsStore.theme === ThemeEnum.DARK);
const changeTheme = (val: any) => {
isDark.value = val;
settingsStore.changeTheme(isDark.value ? ThemeEnum.DARK : ThemeEnum.LIGHT);
};
-/**
- * 切换布局
- */
+/** 切换布局 */
function changeLayout(layout: string) {
settingsStore.changeLayout(layout);
if (layout === LayoutEnum.MIX) {
@@ -99,6 +93,7 @@ function changeLayout(layout: string) {
}
}
+/** 重新激活顶部菜单 */
function againActiveTop(newVal: string) {
const parent = findOutermostParent(permissionStore.routes, newVal);
if (appStore.activeTopMenu !== parent.path) {
@@ -106,6 +101,7 @@ function againActiveTop(newVal: string) {
}
}
+/** 递归查找最外层父节点 */
function findOutermostParent(tree: any[], findName: string) {
let parentMap: any = {};
@@ -136,7 +132,7 @@ function findOutermostParent(tree: any[], findName: string) {