From a05f7ec322a2795301d727378ed1de4fe83e8bed Mon Sep 17 00:00:00 2001 From: Cccc_ Date: Sat, 3 Jan 2026 12:58:27 +0800 Subject: [PATCH] frontend: support more missing dark mode style --- frontend/src/antd-theme.js | 2 +- frontend/src/components/CrontabEditor.vue | 74 ++++++ frontend/src/components/FieldConfigEditor.vue | 12 +- frontend/src/components/Navbar.vue | 2 +- frontend/src/style.css | 216 +++++++++++++++++- frontend/src/views/admin/TemplatesView.vue | 38 +-- frontend/tailwind.config.js | 2 +- 7 files changed, 307 insertions(+), 39 deletions(-) diff --git a/frontend/src/antd-theme.js b/frontend/src/antd-theme.js index d18ac4a..f29d504 100644 --- a/frontend/src/antd-theme.js +++ b/frontend/src/antd-theme.js @@ -3,7 +3,7 @@ import { theme } from 'ant-design-vue' /** * Ant Design Vue 主题配置 * 匹配现有 Material Design 3 色彩系统 - * @param {boolean} isDark - 是否为暗黑模式 + * @param {boolean} isDark - 是否为暗色模式 */ export default function getAntdTheme(isDark = false) { return { diff --git a/frontend/src/components/CrontabEditor.vue b/frontend/src/components/CrontabEditor.vue index ce6f1d6..7b77e83 100644 --- a/frontend/src/components/CrontabEditor.vue +++ b/frontend/src/components/CrontabEditor.vue @@ -330,6 +330,12 @@ onBeforeUnmount(() => { border-radius: 4px; padding: 16px; background: #f5f7fa; + transition: all 0.3s; +} + +.dark .crontab-editor { + border-color: #3a3a3c; + background: #2c2c2e; } .mode-tabs { @@ -337,6 +343,11 @@ onBeforeUnmount(() => { gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #ebeef5; + transition: border-color 0.3s; +} + +.dark .mode-tabs { + border-bottom-color: #3a3a3c; } .mode-tab { @@ -351,11 +362,20 @@ onBeforeUnmount(() => { transition: all 0.3s; } +.dark .mode-tab { + color: #a0a0a3; +} + .mode-tab.active { color: #409eff; border-bottom-color: #409eff; } +.dark .mode-tab.active { + color: #81c784; + border-bottom-color: #81c784; +} + .mode-content { margin: 16px 0; } @@ -364,10 +384,20 @@ onBeforeUnmount(() => { padding: 12px; background: white; border-radius: 4px; + transition: background 0.3s; +} + +.dark .quick-option { + background: #1c1c1e; } .option-label { font-weight: 600; + color: #1c1b1f; +} + +.dark .option-label { + color: #e5e5e7; } .option-desc { @@ -376,6 +406,10 @@ onBeforeUnmount(() => { font-size: 12px; } +.dark .option-desc { + color: #a0a0a3; +} + .expression-input { margin: 12px 0; } @@ -386,11 +420,19 @@ onBeforeUnmount(() => { font-size: 12px; } +.dark .help-text { + color: #a0a0a3; +} + .help-text a { color: #409eff; text-decoration: none; } +.dark .help-text a { + color: #81c784; +} + .help-text a:hover { text-decoration: underline; } @@ -400,11 +442,21 @@ onBeforeUnmount(() => { padding: 12px; background: white; border-radius: 4px; + transition: background 0.3s; +} + +.dark .preview-section { + background: #1c1c1e; } .preview-section h4 { margin: 0 0 8px 0; font-size: 14px; + color: #1c1b1f; +} + +.dark .preview-section h4 { + color: #e5e5e7; } .execution-list { @@ -414,6 +466,10 @@ onBeforeUnmount(() => { color: #606266; } +.dark .execution-list { + color: #a0a0a3; +} + .validation-message { padding: 8px 12px; border-radius: 4px; @@ -427,15 +483,33 @@ onBeforeUnmount(() => { border: 1px solid #c6e2ff; } +.dark .validation-message.success { + background: rgba(129, 199, 132, 0.1); + color: #81c784; + border-color: rgba(129, 199, 132, 0.3); +} + .validation-message.error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde7e7; } +.dark .validation-message.error { + background: rgba(244, 67, 54, 0.1); + color: #ef5350; + border-color: rgba(244, 67, 54, 0.3); +} + .validation-message.info { background: #f4f4f5; color: #909399; border: 1px solid #ebeef5; } + +.dark .validation-message.info { + background: #2c2c2e; + color: #a0a0a3; + border-color: #3a3a3c; +} diff --git a/frontend/src/components/FieldConfigEditor.vue b/frontend/src/components/FieldConfigEditor.vue index 5114cc8..1a945c5 100644 --- a/frontend/src/components/FieldConfigEditor.vue +++ b/frontend/src/components/FieldConfigEditor.vue @@ -281,15 +281,5 @@ const removeOption = (index) => { diff --git a/frontend/src/components/Navbar.vue b/frontend/src/components/Navbar.vue index 2c55084..0d6c10d 100644 --- a/frontend/src/components/Navbar.vue +++ b/frontend/src/components/Navbar.vue @@ -142,7 +142,7 @@ - +

任务模板管理

-

JSON 映射架构 - 配置即结构,字段名保持原样

+

JSON 映射架构 - 配置即结构,字段名保持原样

@@ -42,8 +42,8 @@ >
-

{{ template.name }}

-

{{ template.description || '无描述' }}

+

{{ template.name }}

+

{{ template.description || '无描述' }}

{{ template.is_active ? '已启用' : '已禁用' }} @@ -77,7 +77,7 @@
-