diff --git a/src/views/evaluate/index.vue b/src/views/evaluate/index.vue
index 10f9049da2189148eb1148a6c9c06795fafe2a98..84e277c9df80cd4bad8cc572d9aaf4733d517ec5 100644
--- a/src/views/evaluate/index.vue
+++ b/src/views/evaluate/index.vue
@@ -34,8 +34,9 @@
-
+
diff --git a/src/views/knowledgeFile/documentLog.vue b/src/views/knowledgeFile/documentLog.vue
index b3c9b876554818e959f5196e2a83a02b89b94aad..8dc4e76c053dd5a5847e705a7f1bae8ec8331b1f 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);
};
// 生命周期钩子