From 842ff0e395dd5a2a7e3b69b5378cd64a987954f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Tue, 1 Jul 2025 10:45:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9A=97=E8=89=B2=E4=B8=BB=E9=A2=98=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/knowledgeFile/documentLog.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/views/knowledgeFile/documentLog.vue b/src/views/knowledgeFile/documentLog.vue index b3c9b87..8dc4e76 100644 --- a/src/views/knowledgeFile/documentLog.vue +++ b/src/views/knowledgeFile/documentLog.vue @@ -43,7 +43,7 @@ } }); - // 定义主题规则 + // 定义亮色主题规则 monaco.editor.defineTheme('customLogTheme', { base: 'vs', inherit: true, @@ -51,7 +51,19 @@ { token: 'uuid', foreground: '#808080' }, // 灰色 { token: 'timestamp', foreground: '#CE9178' }, // 紫色 ], - colors: {} + colors: { } + }); + // 定义暗色主题规则 + monaco.editor.defineTheme('customLogThemeDark', { + base: 'vs-dark', + inherit: true, + rules: [ + { token: 'uuid', foreground: '#808080' }, // 灰色 + { token: 'timestamp', foreground: '#CE9178' }, // 紫色 + ], + colors: { + 'editor.background': '#1f2329' + } }); } @@ -97,7 +109,7 @@ const observeThemeChange = () => { const body = document.body; observer = new MutationObserver(() => { - const newTheme = body.getAttribute('theme') === 'dark' ? 'vs-dark' : 'vs'; + const newTheme = body.getAttribute('theme') === 'dark' ? 'customLogThemeDark' : 'customLogTheme'; monaco.editor.setTheme(newTheme); }); observer.observe(body, { attributes: true, attributeFilter: ['theme'] }); @@ -105,7 +117,7 @@ const observeThemeChange = () => { // 设置初始主题 const setInitialTheme = () => { const body = document.body; - const initialTheme = body.getAttribute('theme') === 'dark' ? 'vs-dark' : 'vs'; + const initialTheme = body.getAttribute('theme') === 'dark' ? 'customLogThemeDark' : 'customLogTheme'; monaco.editor.setTheme(initialTheme); }; // 生命周期钩子 -- Gitee From 943236124701a546837406107295642b05a844f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Wed, 2 Jul 2025 15:09:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=84=E6=B5=8Btable?= =?UTF-8?q?=E8=A1=8C=E9=94=AE=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E6=95=B0=E6=8D=AE=E5=94=AF=E4=B8=80=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/evaluate/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/evaluate/index.vue b/src/views/evaluate/index.vue index 10f9049..84e277c 100644 --- a/src/views/evaluate/index.vue +++ b/src/views/evaluate/index.vue @@ -34,8 +34,9 @@ - + -- Gitee