feat(strategy-map): live board reading map_objectives + kpi_targets (read-only)
Task: finance-20261011-strategy-map-frontend-fullstack (P2, read-only integration)
- backend/app/utils/strategy_board.py: single source of truth for the level
caliber (layer colors, inverse-kpi explicit whitelist, status class by
unit, zero guard, period ranking, latest-actual picking). Pure functions.
- backend/app/api/maps.py: GET /api/cma/maps/{map_id}/strategy-board
- nodes straight from map_objectives (sorted by sort_order, id)
- node<->kpi binding with 4-step fallback, binding_source echoed back
- targets from kpi_targets (target_type compatible: yearly + annual),
deduped per (kpi_id, period) with yearly preferred
- actuals from kpi_values actual-only scope, latest period
- causality edges from kpi_causality, out-of-map endpoints dropped+counted
- entity_id taken from the token only (no cross-tenant reads)
- zero writes; nothing is persisted by this endpoint
- frontend/src/views/StrategyMap.vue: /strategy-map live board (4 swim lanes
bottom-up, node cards, 20 causality arrows in SVG, period switch, A3 print).
No emoji, null guards everywhere (no toFixed on null).
- api/index.ts + router/index.ts + permission.ts: route + menu registration
(/strategy-map, zone A read-only, roles ceo/finance/business/it).
- backend/tests/test_strategy_board_20261011.py: 33 cases (spec section 4 /
4.1 / 4.2 / 4.3 + section 7 fixtures + threshold boundaries + period rank).
- backend/tests/test_map_objectives_kpis_form_20261011.py: 14 cases for the
four kpis column shapes (list, json string, object list, NULL/[]/weird).
Not included: push + backend restart (production write, separate gate).
(cherry picked from commit c675bde6b4beaf1d8a9d02a80f5434203a53f348)
This commit is contained in:
@@ -67,6 +67,8 @@ export const mapApi = {
|
||||
delete: (id: number) => api.delete(`/maps/${id}`),
|
||||
batchDelete: (ids: number[]) => api.post('/maps/batch-delete', { ids }),
|
||||
createWithTemplate: (data: any) => api.post('/maps/create-with-template', data),
|
||||
// 战略地图活看板(只读,2026-10-11 finance-20261011-strategy-map-frontend-fullstack)
|
||||
strategyBoard: (id: number, params?: any) => api.get(`/maps/${id}/strategy-board`, { params }),
|
||||
// 战略地图版本管理(2026-09-08 project-20260908-map-versions-page)
|
||||
versions: (mapId: number) => api.get(`/maps/${mapId}/versions`),
|
||||
versionDetail: (mapId: number, vid: number) => api.get(`/maps/${mapId}/versions/${vid}`),
|
||||
|
||||
Reference in New Issue
Block a user