From 78aa24460aeefc135d45219264cf7152ee3a63be Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 2 Sep 2024 15:27:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=96=E8=A7=82=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/theme/index.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/src/views/theme/index.vue b/ui/src/views/theme/index.vue index bce4d103a..621d89664 100644 --- a/ui/src/views/theme/index.vue +++ b/ui/src/views/theme/index.vue @@ -6,14 +6,19 @@
平台显示主题
+ +
+
平台显示主题
+ +
平台登陆设置
@@ -168,6 +173,8 @@ const themeForm = ref({ title: 'MaxKB', slogan: '欢迎使用 MaxKB 智能知识库' }) +const themeRadio = ref('') +const customColor = ref('') const rules = reactive({ title: [{ required: true, message: '请输入网站标题', trigger: 'blur' }], @@ -197,6 +204,12 @@ const onChange = (file: any, fileList: UploadFiles, attr: string) => { } function changeThemeHandle(val: string) { + if (val !== 'custom') { + themeForm.value.theme = val + user.setTheme(themeForm.value) + } +} +function customColorHandle(val: string) { themeForm.value.theme = val user.setTheme(themeForm.value) } @@ -236,6 +249,10 @@ onMounted(() => { router.push({ path: `/application` }) } if (themeInfo.value) { + themeRadio.value = themeList.some((v) => v === themeInfo.value.theme) + ? themeInfo.value.theme + : 'custom' + customColor.value = themeInfo.value.theme themeForm.value = themeInfo.value cloneTheme.value = cloneDeep(themeInfo.value) }