diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index f2dabc7..9460e3e 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -7,7 +7,8 @@ const routes: RouteRecordRaw[] = [ path: '/', component: () => import('@/views/Layout.vue'), children: [ - { path: '', redirect: '/backtest/new' }, + { path: '', redirect: '/dashboard' }, + { path: 'dashboard', name: 'dashboard', component: () => import('@/views/Dashboard.vue') }, { path: 'backtest/new', name: 'bt-new', component: () => import('@/views/backtest/New.vue') }, { path: 'backtest/progress/:id', name: 'bt-progress', component: () => import('@/views/backtest/Progress.vue') }, { path: 'backtest/result/:id', name: 'bt-result', component: () => import('@/views/backtest/Result.vue') }, diff --git a/frontend/src/style.css b/frontend/src/style.css index d8e8d11..6e7ea4e 100644 --- a/frontend/src/style.css +++ b/frontend/src/style.css @@ -2,3 +2,4 @@ @import './styles/tokens.css'; @import './styles/element-dark.css'; @import './styles/reset.css'; +@import './styles/chips.css'; diff --git a/frontend/src/styles/chips.css b/frontend/src/styles/chips.css new file mode 100644 index 0000000..36b1a0c --- /dev/null +++ b/frontend/src/styles/chips.css @@ -0,0 +1,82 @@ +/* 全局 chip / 状态色 —— 所有页面复用(红涨绿跌 A 股配色,深色主题) */ +.chip { + display: inline-block; + padding: 1px 8px; + border-radius: 4px; + font-size: 12px; + font-weight: 500; + line-height: 18px; + white-space: nowrap; +} + +/* 任务类型 */ +.chip-cta { + color: var(--brand); + background: rgba(24, 144, 255, 0.14); +} +.chip-optimize { + color: #13c2c2; + background: rgba(19, 194, 194, 0.14); +} +.chip-factor { + color: #b37feb; + background: rgba(179, 127, 235, 0.14); +} +.chip-paper { + color: #d29922; + background: rgba(210, 153, 34, 0.14); +} + +/* 状态 */ +.st-done { + color: var(--down); + background: rgba(63, 185, 80, 0.14); +} +.st-failed { + color: var(--danger); + background: rgba(248, 81, 73, 0.14); +} +.st-running { + color: var(--brand); + background: rgba(24, 144, 255, 0.14); +} +.st-pending { + color: var(--warn); + background: rgba(210, 153, 34, 0.14); +} + +/* 涨跌(红涨绿跌) */ +.up { + color: var(--up); +} +.down { + color: var(--down); +} + +/* 通用文字层级 */ +.mono { + font-family: var(--mono); + font-size: 12px; + color: var(--text); +} +.muted { + color: var(--text-2); + font-size: 12px; +} + +/* 计数徽标 */ +.count-badge { + display: inline-block; + margin-left: 8px; + padding: 0 8px; + min-width: 24px; + height: 22px; + line-height: 22px; + text-align: center; + font-size: 12px; + font-weight: 600; + color: var(--text-2); + background: var(--bg-hover); + border-radius: 11px; + vertical-align: middle; +} diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue new file mode 100644 index 0000000..dc8c847 --- /dev/null +++ b/frontend/src/views/Dashboard.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/frontend/src/views/Layout.vue b/frontend/src/views/Layout.vue index ed19fb4..cea7aff 100644 --- a/frontend/src/views/Layout.vue +++ b/frontend/src/views/Layout.vue @@ -32,6 +32,7 @@ function onLogout(): void { 三国量化 + 工作台