From 6e30fb16e72db22a119285cb5b757b7a5e1b2206 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期三, 18 六月 2025 16:35:14 +0800
Subject: [PATCH] fix: 修复之前剩下的要求
---
src/layout/components/Settings/index.vue | 51 +++++++++++++++++++++++----------------------------
1 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue
index 7164a17..55ccec2 100644
--- a/src/layout/components/Settings/index.vue
+++ b/src/layout/components/Settings/index.vue
@@ -1,5 +1,5 @@
<template>
- <el-drawer v-model="showSettings" :withHeader="false" direction="rtl" size="300px">
+ <el-drawer v-model="showSettings" direction="rtl" size="300px">
<div class="setting-drawer-title">
<h3 class="drawer-title">涓婚椋庢牸璁剧疆</h3>
</div>
@@ -88,36 +88,36 @@
import usePermissionStore from '@/store/modules/permission'
import { handleThemeStyle } from '@/utils/theme'
-const { proxy } = getCurrentInstance();
+const { proxy } = getCurrentInstance()
const appStore = useAppStore()
const settingsStore = useSettingsStore()
const permissionStore = usePermissionStore()
-const showSettings = ref(false);
-const theme = ref(settingsStore.theme);
-const sideTheme = ref(settingsStore.sideTheme);
-const storeSettings = computed(() => settingsStore);
-const predefineColors = ref(["#409EFF", "#ff4500", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585"]);
+const showSettings = ref(false)
+const theme = ref(settingsStore.theme)
+const sideTheme = ref(settingsStore.sideTheme)
+const storeSettings = computed(() => settingsStore)
+const predefineColors = ref(["#800020", "#81D8D0", "#E85827", "#008C8C", "#002FA7", "#F9DC24", "#B05923", "#003153", "#8F4B28", "#4C0009"])
/** 鏄惁闇�瑕乼opnav */
function topNavChange(val) {
if (!val) {
- appStore.toggleSideBarHide(false);
- permissionStore.setSidebarRouters(permissionStore.defaultRoutes);
+ appStore.toggleSideBarHide(false)
+ permissionStore.setSidebarRouters(permissionStore.defaultRoutes)
}
}
function themeChange(val) {
- settingsStore.theme = val;
- handleThemeStyle(val);
+ settingsStore.theme = val
+ handleThemeStyle(val)
}
function handleTheme(val) {
- settingsStore.sideTheme = val;
- sideTheme.value = val;
+ settingsStore.sideTheme = val
+ sideTheme.value = val
}
function saveSetting() {
- proxy.$modal.loading("姝e湪淇濆瓨鍒版湰鍦帮紝璇风◢鍊�...");
+ proxy.$modal.loading("姝e湪淇濆瓨鍒版湰鍦帮紝璇风◢鍊�...")
let layoutSetting = {
"topNav": storeSettings.value.topNav,
"tagsView": storeSettings.value.tagsView,
@@ -126,36 +126,38 @@
"dynamicTitle": storeSettings.value.dynamicTitle,
"sideTheme": storeSettings.value.sideTheme,
"theme": storeSettings.value.theme
- };
- localStorage.setItem("layout-setting", JSON.stringify(layoutSetting));
+ }
+ localStorage.setItem("layout-setting", JSON.stringify(layoutSetting))
setTimeout(proxy.$modal.closeLoading(), 1000)
}
function resetSetting() {
- proxy.$modal.loading("姝e湪娓呴櫎璁剧疆缂撳瓨骞跺埛鏂帮紝璇风◢鍊�...");
+ proxy.$modal.loading("姝e湪娓呴櫎璁剧疆缂撳瓨骞跺埛鏂帮紝璇风◢鍊�...")
localStorage.removeItem("layout-setting")
setTimeout("window.location.reload()", 1000)
}
function openSetting() {
- showSettings.value = true;
+ showSettings.value = true
}
defineExpose({
- openSetting,
+ openSetting
})
</script>
<style lang='scss' scoped>
.setting-drawer-title {
margin-bottom: 12px;
- color: rgba(0, 0, 0, 0.85);
+ color: var(--el-text-color-primary, rgba(0, 0, 0, 0.85));
line-height: 22px;
font-weight: bold;
+
.drawer-title {
font-size: 14px;
}
}
+
.setting-drawer-block-checbox {
display: flex;
justify-content: flex-start;
@@ -174,13 +176,6 @@
height: 48px;
}
- .custom-img {
- width: 48px;
- height: 38px;
- border-radius: 5px;
- box-shadow: 1px 1px 2px #898484;
- }
-
.setting-drawer-block-checbox-selectIcon {
position: absolute;
top: 0;
@@ -197,7 +192,7 @@
}
.drawer-item {
- color: rgba(0, 0, 0, 0.65);
+ color: var(--el-text-color-regular, rgba(0, 0, 0, 0.65));
padding: 12px 0;
font-size: 14px;
--
Gitblit v1.9.3