From 5e6aa7920a825d1a06d4ac44db0c1be4b4ff5281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Mon, 15 Jun 2026 08:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=20CR-27=20Dashboard=20refre?= =?UTF-8?q?sh=20=E5=81=A5=E5=A3=AE=E6=80=A7+stage=20=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3+=E5=88=A0=E6=AD=BB=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M1 refresh 包 try/catch+console.error(原 Promise.all 无兜底 unhandledrejection);M3 getProjectStage planning→planning(蓝)/cancelled→cancelled(灰) 颜色与 label 语义一致(原 planning 归 coding 紫/cancelled 归 testing 橙颜色撒谎)+CSS 新增;L4 决策/批注 panel 死代码删(模板+CSS,功能未实现)。批8,vue-tsc 0 --- src/views/Dashboard.vue | 114 +++++++--------------------------------- 1 file changed, 18 insertions(+), 96 deletions(-) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 75758a3..8933c14 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -98,26 +98,6 @@
{{ $t('dashboard.empty.noIdeas') }}
- - -
-
-

{{ $t('dashboard.recentDecisions') }}

-
-
- {{ $t('dashboard.empty.noData') }} -
-
- - -
-
-

{{ $t('dashboard.openAnnotations') }}

-
-
- {{ $t('dashboard.empty.noData') }} -
-
@@ -146,12 +126,14 @@ const stats = computed(() => [ ]) function getProjectStage(status: string): { stage: string; stageLabelKey: string; progress: number } { + // stage(颜色档)与 stageLabelKey(文案)语义必须一致: + // planning/cancelled 不再借用 coding/testing 颜色(否则颜色撒谎),改用专属颜色档。 switch (status) { - case 'planning': return { stage: 'coding', stageLabelKey: 'planning', progress: 20 } + case 'planning': return { stage: 'planning', stageLabelKey: 'planning', progress: 20 } case 'in_progress': return { stage: 'coding', stageLabelKey: 'coding', progress: 55 } case 'paused': return { stage: 'testing', stageLabelKey: 'paused', progress: 40 } case 'completed': return { stage: 'release', stageLabelKey: 'done', progress: 100 } - case 'cancelled': return { stage: 'testing', stageLabelKey: 'cancelled', progress: 0 } + case 'cancelled': return { stage: 'cancelled', stageLabelKey: 'cancelled', progress: 0 } default: return { stage: 'coding', stageLabelKey: 'coding', progress: 30 } } } @@ -200,7 +182,11 @@ function ideaStatusLabel(status: string): string { } async function refresh() { - await Promise.all([store.loadProjects(), store.loadTasks(), store.loadIdeas()]) + try { + await Promise.all([store.loadProjects(), store.loadTasks(), store.loadIdeas()]) + } catch (e) { + console.error('Dashboard refresh failed:', e) + } } function quickCapture() { @@ -400,9 +386,11 @@ onMounted(async () => { .project-dot { width: 6px; height: 6px; border-radius: 50%; } -.dot-coding { background: var(--df-accent); } -.dot-testing { background: var(--df-warning); } -.dot-release { background: var(--df-success); } +.dot-coding { background: var(--df-accent); } +.dot-testing { background: var(--df-warning); } +.dot-release { background: var(--df-success); } +.dot-planning { background: var(--df-info); } +.dot-cancelled { background: var(--df-text-dim); } .project-name { font-size: 12px; @@ -422,6 +410,8 @@ onMounted(async () => { .chip-coding { background: rgba(123,111,240,0.12); color: var(--df-accent); } .chip-testing { background: rgba(240,199,94,0.12); color: var(--df-warning); } .chip-release { background: rgba(61,219,160,0.12); color: var(--df-success); } +.chip-planning { background: rgba(94,175,240,0.12); color: var(--df-info); } +.chip-cancelled { background: rgba(255,255,255,0.06); color: var(--df-text-dim); } .project-bar-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; } .project-bar { @@ -439,6 +429,8 @@ onMounted(async () => { .fill-coding { background: var(--df-accent); } .fill-testing { background: var(--df-warning); } .fill-release { background: var(--df-success); } +.fill-planning { background: var(--df-info); } +.fill-cancelled { background: var(--df-text-dim); } .project-pct { font-family: var(--df-font-mono); @@ -501,76 +493,6 @@ onMounted(async () => { .idea-name { font-size: 12px; font-weight: 500; color: var(--df-text); display: block; } .idea-status { font-size: 10px; color: var(--df-text-dim); margin-top: 1px; display: block; } -/* ═══ Decision Rows ═══ */ -.decision-rows { display: flex; flex-direction: column; } -.decision-row { - display: flex; - gap: 10px; - padding: 7px 0; - border-bottom: 0.5px solid var(--df-border); -} -.decision-row:last-child { border-bottom: none; } - -.decision-marker { - width: 20px; height: 20px; - display: flex; align-items: center; justify-content: center; - font-size: 9px; - flex-shrink: 0; - border-radius: var(--df-radius-sm); -} -.marker-ai { background: rgba(94,175,240,0.12); color: var(--df-info); } -.marker-human { background: rgba(123,111,240,0.12); color: var(--df-accent); } - -.decision-q { font-size: 11px; color: var(--df-text-secondary); display: block; margin-bottom: 2px; } -.decision-a { - font-size: 11px; - font-weight: 500; - color: var(--df-accent); - display: block; - line-height: 1.3; -} -.decision-time { - font-family: var(--df-font-mono); - font-size: 9px; - color: var(--df-text-dim); - margin-top: 3px; - display: block; -} - -/* ═══ Annotation Rows ═══ */ -.anno-rows { display: flex; flex-direction: column; } -.anno-row { - display: flex; - align-items: center; - gap: 8px; - padding: 5px 0; - border-bottom: 0.5px solid var(--df-border); -} -.anno-row:last-child { border-bottom: none; } - -.anno-tag { - font-family: var(--df-font-mono); - font-size: 9px; - font-weight: 500; - padding: 2px 7px; - border-radius: var(--df-radius-sm); - min-width: 54px; - text-align: center; - letter-spacing: 0.5px; - flex-shrink: 0; -} -.tag-fixme { background: rgba(240,101,101,0.14); color: var(--df-danger); } -.tag-todo { background: rgba(94,175,240,0.12); color: var(--df-info); } -.tag-risk { background: rgba(240,199,94,0.12); color: #f0a830; } -.tag-question { background: rgba(94,175,240,0.10); color: var(--df-info); } - -.anno-text { - font-family: var(--df-font-mono); - font-size: 10px; - color: var(--df-text-secondary); - line-height: 1.3; -} - /* ═══ Responsive ═══ */ /* 窄窗口:单栏 */