SNAPSHOT W7 已部署稳定态 — 凯迪ERP+OA一体化平台 (MET 73.3%)

恢复点(restore point)。别人改崩后可 git reset --hard 回到此提交。

== 此快照内容 ==
- 后端 oa-backend: 734 控制器 / 711 实体 (Spring Boot 3.2.5 + SQLite, 端口8091)
- 前端 modern-ui/app: Vue3+Vite, 约700页 (构建产物已在 oa-backend/src/main/resources/static)
- 数据库 oa-backend/data/oa.db: 含全部演示数据 (强制入库, 6.6MB)
- 交接文档 go.md + go-code-reference/endpoints/entities/database.md
- 多代理建设脚本 .claude/wf-*.js

== 状态 ==
- 对 凯迪科技ERP_20260507.xlsx 合规 MET ~73.3% (PARTIAL 75: 34可建+6种子/bug+35外部硬天花板)
- 安全: 5轮红队+5轮复检, default-deny分级鉴权, 连续零可利用
- W3~W7 累计补完436缺口; W8末轮(40缺口)为半成品(源码树可编译但未集成)
- 运行: cd oa-backend; java -jar build/libs/oa-backend-0.1.0.jar --server.port=8091; admin/123456

== 排除(gitignore, 可再生) ==
node_modules / oa-backend/build / .jdks / *.log / Backup-ERP-* / 弃用的OFBiz核心(只保留modern-ui)
完整文件夹备份见同目录 Backup-ERP-20260615-191517/ (含上述全部, 仅缺 node_modules)

时间戳: 20260615-191517

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Qiufeng
2026-06-15 19:19:15 +08:00
co-authored by Claude Opus 4.8
commit 5e51dc3f56
10584 changed files with 2501339 additions and 0 deletions
@@ -0,0 +1,98 @@
# Design
## Source of truth
- Status: Active
- Last refreshed: 2026-06-09
- Primary product surfaces: `/modern/app/` admin shell, dashboard, domain admin pages, generated business pages, dedicated ERP workspaces, POS and commerce operator surfaces.
- Evidence reviewed: `plugins/modern-ui/UI.md`, `plugins/modern-ui/app/src/styles/erp-ui.css`, `tokens.css`, `base.css`, `element-overrides.css`, `erp-patterns.css`, `modern.css`, and ERP wrapper usage in `plugins/modern-ui/app/src/components/erp`.
## Brand
- Personality: quiet, operational, trustworthy, dense enough for repeated back-office work.
- Trust signals: stable navigation, visible permissions, explicit unavailable/error states, audit context, predictable action hierarchy.
- Avoid: marketing composition, decorative dashboards, isolated style experiments, and operator-facing engineering status language.
## Product goals
- Goals: make OFBiz administration usable as a production management site for orders, catalog, parties, finance, inventory, procurement, manufacturing, human resources, content, POS, commerce, reporting, security, and system operations.
- Non-goals: replacing business verification with structural coverage, adding a second design system, or turning Element Plus primitives into page-local bespoke styling.
- Success signals: business pages use ERP wrappers, work areas are compact and scan-friendly, actions are clearly ranked, and runtime/coverage/parity evidence is reported with precise scope.
## Personas and jobs
- Primary personas: operations clerk, finance operator, catalog manager, inventory coordinator, procurement user, HR admin, content manager, system administrator.
- User jobs: find records, compare rows, submit service actions, inspect permissions, review audit context, run reports, process exceptions, and continue interrupted work.
- Key contexts of use: desktop-first back-office sessions, high data density, repeated scanning, partial backend availability, permission-gated operations.
## Information architecture
- Primary navigation: `ErpAppShell` owns side navigation, top commands, session identity, module entry points, and support links.
- Core routes/screens: dashboard, domain admin pages, `#/pages/:pageId` generated pages, dedicated `Erp*Workspace` flows, report/POS/commerce surfaces.
- Content hierarchy: page header, tabs or local navigation, query/action band, primary work area, side context for audit, permissions, handoff, and receipts.
## Design principles
- Wrapper first: business pages depend on ERP wrappers and ERP patterns, not scattered Element Plus styling.
- Text first, color second: state copy explains the business meaning; color reinforces priority or risk.
- Dense, not cramped: use 4px spacing rhythm, 28/32/36px controls, compact tables, and clear grouping.
- One next action: each work area has one primary action and clear secondary/danger/overflow handling.
- Tradeoffs: prefer operational consistency over visual novelty; prefer structural reuse over one-off page polish.
## Visual language
- Color: primary blue for navigation, focus, and primary actions; success green for completed/healthy/connected; warning amber for pending/review/background processing; danger red for errors/rejection/cancel/delete; info gray for neutral metadata.
- Typography: 24px page titles, 18px large panel titles, 14px body and primary controls, 13px compact text, 12px status and metadata; letter spacing remains 0.
- Spacing/layout rhythm: 4px grid through `--erp-space-*`; desktop working width around 1180px; page sections are work areas, not nested decorative cards.
- Shape/radius/elevation: 4px/6px normal radius, 8px maximum; no decorative shadows on work surfaces; 1px borders and left state lines carry structure.
- Motion: Element Plus defaults only; avoid motion that delays data scanning or action completion.
- Imagery/iconography: icons support navigation/actions/status; back-office pages do not rely on ornamental imagery.
## Components
- Existing components to reuse: `ErpPageHeader`, `ErpSearchForm`, `ErpEntityForm`, `ErpDataTable`, `ErpActionBar`, `ErpStatusTag`, `ErpLookup`, `ErpUpload`, `ErpDrawer`, `ErpAuditTimeline`, `ErpPageRenderer`, `ErpAdapterBlock`, and dedicated `Erp*Workspace` components.
- New/changed components: add wrapper or pattern only when a repeated business need is not covered by existing wrappers.
- Variants and states: forms use search/entity/one-column densities; tables use compact scan rows; actions use primary/default/link/danger/overflow; states use loading, empty, unavailable, error, success, disabled, and permission explanations.
- Token/component ownership: `tokens.css` owns variables; `element-overrides.css` maps Element Plus; `erp-patterns.css` owns reusable ERP patterns; `modern.css` owns shell and page-layout composition.
## Accessibility
- Target standard: practical WCAG 2.1 AA for contrast, focus, keyboard access, and readable state copy.
- Keyboard/focus behavior: Element Plus focus rings must remain visible and use `--erp-color-focus-ring`.
- Contrast/readability: state colors must not carry meaning alone; pair with labels and descriptions.
- Screen-reader semantics: use tables for tabular data, descriptions for readonly facts, alerts for permission/error/unavailable states.
- Reduced motion and sensory considerations: avoid nonessential animation and color-only alerts.
## Responsive behavior
- Supported breakpoints/devices: desktop-first admin workflows; narrower viewports collapse side context and multi-column grids without changing business order.
- Layout adaptations: search forms move from four columns to fewer columns; entity forms from two columns to one; workbench side panels stack below main work.
- Touch/hover differences: POS and commerce may use larger controls; back-office pages keep compact density while preserving tap targets where needed.
## Interaction states
- Loading: skeleton or inline loading text stays inside the work area.
- Empty: explain whether no records match, permissions are missing, session is absent, service is unavailable, or data is flow-dependent.
- Error: keep the reason visible in the page; toast can supplement but not replace page feedback.
- Success: show action receipt or result context in the work area.
- Disabled: keep the disabled control visible when it teaches permission, session, or backend state.
- Offline/slow network: treat as unavailable/error with retry or next-step copy when the API contract supports it.
## Content voice
- Tone: short, concrete, business-operational Chinese.
- Terminology: current document, business data, submit action, permission context, pending queue, exception handoff, action receipt, business flow, audit record.
- Microcopy rules: do not expose component paths, generated source, internal coverage states, or implementation labels as the main operator narrative.
## Implementation constraints
- Framework/styling system: Vue 3, Element Plus, CSS tokens and patterns, ERP wrappers.
- Design-token constraints: pages do not define their own color, radius, spacing, shadow, button, table, or status systems.
- Performance constraints: generated pages and large admin routes must stay lightweight; prefer shared patterns over repeated page CSS.
- Compatibility constraints: original OFBiz metadata remains route, form, table, permission, action, and fallback source until business parity is signed off.
- Test/screenshot expectations: run build for changed UI code, runtime smoke for shell/pages, coverage for structural contracts, and parity checks only for scoped business behavior claims.
## Open questions
- [ ] Owner: product/design. Impact: decide whether POS and commerce should receive a separate touch-density token set or continue sharing the admin density with local overrides.
- [ ] Owner: QA/business. Impact: define representative old-vs-new business E2E scenarios by module before claiming workflow completion.