diff --git a/docs/superpowers/plans/2026-06-02-data-dashboard-frontend.md b/docs/superpowers/plans/2026-06-02-data-dashboard-frontend.md index 1870e5a..21fb430 100644 --- a/docs/superpowers/plans/2026-06-02-data-dashboard-frontend.md +++ b/docs/superpowers/plans/2026-06-02-data-dashboard-frontend.md @@ -15,7 +15,7 @@ ## 文件总览 -**Create(15 个)**: +**Create(13 个)**: - `frontend/pages/dashboard/dashboard.vue` - `frontend/pages/dashboard/components/DashboardHeader.vue` - `frontend/pages/dashboard/components/CrystalOverview.vue` @@ -27,8 +27,6 @@ - `frontend/pages/dashboard/components/LevelDistribution.vue` - `frontend/pages/dashboard/components/UpcomingUpgrades.vue` - `frontend/pages/dashboard/components/RecentUpgrades.vue` -- `frontend/pages/dashboard/components/SectionSkeleton.vue` -- `frontend/pages/dashboard/components/EmptyState.vue` - `frontend/composables/useDashboardData.js` - `frontend/utils/mock/dashboard.js` @@ -443,21 +441,24 @@ export function useDashboardData({ starId = null } = {}) { } // —— 局部刷新 —— - async function refresh(section) { - if (!section) { - return loadAll(true) + // - refresh(section) : 单 section 强制重拉(无缓存) + // - refresh() : 全量刷新,cache-aware(30 分钟内复用) + // - refresh(null, true) : 全量强制刷新(绕缓存) + async function refresh(section, force = false) { + if (section) { + const fetcherMap = { + today: dashboardApi.getTodayOverview, + curve: dashboardApi.get7DayIncomeCurve, + exhibition: dashboardApi.getExhibitionSummary, + likeIncome: dashboardApi.getLikeIncomeByLevel, + topAssets: dashboardApi.getTopAssets, + levels: dashboardApi.getLevelDistribution, + upgrades: dashboardApi.getUpgradeProgress, + } + if (!fetcherMap[section]) return + return loadSection(section, fetcherMap[section]) } - const fetcherMap = { - today: dashboardApi.getTodayOverview, - curve: dashboardApi.get7DayIncomeCurve, - exhibition: dashboardApi.getExhibitionSummary, - likeIncome: dashboardApi.getLikeIncomeByLevel, - topAssets: dashboardApi.getTopAssets, - levels: dashboardApi.getLevelDistribution, - upgrades: dashboardApi.getUpgradeProgress, - } - if (!fetcherMap[section]) return - await loadSection(section, fetcherMap[section]) + return loadAll(force) } // —— effectScope 资源释放 —— @@ -1118,51 +1119,8 @@ git commit -m "feat(dashboard): CrystalOverview 双卡(水晶余额+今日收 **Files:** - Create: `frontend/pages/dashboard/components/IncomeCurve.vue` -- Create: `frontend/pages/dashboard/chart-theme.json`(uCharts 主题配置) -- [ ] **Step 1: 创建 uCharts 主题配置 `frontend/pages/dashboard/chart-theme.json`** - -> **注意**:此文件路径在 Vue 项目中通过 `?url` 或 `import` 引入。H5 用 `import`,小程序/App 走条件编译。 - -```json -{ - "type": "barline", - "color": ["#FFCC14", "#1BAFEE"], - "padding": [16, 16, 8, 16], - "dataLabel": false, - "legend": { "show": false }, - "xAxis": { - "disableGrid": true, - "axisLine": false, - "fontColor": "#FFFFFF", - "fontSize": 9 - }, - "yAxis": { - "data": [{ "min": 0 }], - "disableGrid": true, - "axisLine": false, - "fontColor": "#FFFFFF", - "fontSize": 9 - }, - "extra": { - "bar": { - "type": "group", - "width": 18, - "activeBgColor": "#000000", - "activeBgOpacity": 0.1, - "linear": true, - "color": ["#FFDF77", "#B984FF", "#FF8183"] - }, - "line": { - "type": "curve", - "width": 2, - "activeType": "hollow" - } - } -} -``` - -- [ ] **Step 2: 完整实现 IncomeCurve.vue** +- [ ] **Step 1: 完整实现 IncomeCurve.vue** ```vue