沉淀页面设计规则(page-design-rules-audit)

这个提交包含在:
2026-05-30 02:44:04 +08:00
父节点 3977d800f5
当前提交 75edec3f33
共修改 15 个文件,包含 2600 行新增和 61 行删除
@@ -160,6 +160,48 @@ change the visual treatment once while preserving component contracts.
- Focused Playwright screenshot coverage when changing login, Portal, primary
PC list pages or command-bar/table styling.
## Convention: Page Template Taxonomy
**What**: hyb-oa frontend pages use six layout templates. New or redesigned
pages must pick one primary template before implementation:
- `工作台总览`: Portal and mobile home. Compact summary, today's actionable
items, conditional progress/blocker/reminder sections.
- `任务处理列表`: workflow task queues. Pending summary, task list, processed
records and advanced filters.
- `业务台账列表`: reimbursement, contracts, projects, payments, AP and invoices.
Page-header primary action, command bar, list/table body and folded ledger
tools.
- `主从工作台`: procurement, assets and inventory checks. Left/index list plus
right/current-object detail and actions.
- `详情工作区`: reimbursement detail, workflow task detail, project detail and
future contract detail. Overview, facts/evidence, right-side summary/command
panel and history.
- `管理配置页`: people, organization, master data, approval rules, workflow
definitions, feature flags and audit logs. Grouped settings, searchable
tables and confirmed destructive/configuration actions.
**Contracts**:
- A page has one primary template. Local sections may reuse shared components,
but the page must not mix ledger, configuration, detail and dashboard patterns
without an explicit Trellis task.
- Mobile is the responsive expression of these templates: top status/focus,
card list or sectioned detail, bottom primary action. Do not create a PC shell
inside mobile routes.
- B-class business pages should usually choose `业务台账列表` or `主从工作台`.
Use a ledger when records open into details; use master-detail when users
select one object and edit/process it in the same workspace.
- A-class task pages must not drift into configuration surfaces. C-class
configuration pages must not appear as ordinary employee task pages.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright or screenshot checks for changed A-class, mobile or shared
template surfaces.
## Convention: Global Shell And Page Header Baseline
**What**: PC page redesigns should preserve the shared Wave0-2 shell and
@@ -168,8 +210,10 @@ header baseline instead of recreating page-local wrappers:
- `AppShellLayout` owns the PC shell background and content offset through
`app-shell` and `app-shell-main`.
- `Sidebar` and `NavLinks` own role-aware task navigation. The mental model is
a short primary task list plus collapsed `更多`; management configuration is
represented by one `管理` entry instead of many sidebar rows.
a task-first primary list plus collapsed `更多`; enabled OA-owned business
ledgers such as contracts, procurement, assets and projects should not be
hidden in `更多` by default when the current role has access. Management
configuration is represented by one `管理` entry instead of many sidebar rows.
- `Topbar` is a compact command surface: page title, group badge, user context,
global search and notifications. Do not expand it back into a large hero.
- `PageHeader` and `WorkspaceHeader` should use `page-header-shell`,
@@ -187,6 +231,10 @@ point and prevents each route from inventing a different title/action layout.
- Sidebar entries should be role-aware and task-first for domestic tech startups
under 10 people; do not expose all permission-allowed modules as a default
module catalog.
- Do show enabled, permission-allowed day-to-day business ledgers directly in
the primary sidebar, including `合同`, `采购`, `资产` and `项目` when relevant.
`更多` is for low-frequency, frozen, staged or occasional entries, not a
place to bury common work.
- Approvers see `待我处理`; ordinary employees should not see `待办` or
`审批待办` in the sidebar by default.
- PC leave navigation uses `请假记录` unless the current task explicitly opens OA
@@ -196,8 +244,9 @@ point and prevents each route from inventing a different title/action layout.
- Finance labels should use work names such as `付款`, `应付账款` and `票据`;
internal platform words like `AP 运营`, `ERP 集成` and `功能开关` should be
hidden behind management wording or renamed for users.
- `更多` is a lightweight collapsed row for low-frequency entries; do not add a
sidebar explanation card, subtitle or onboarding copy around it.
- `更多` is a lightweight collapsed row for low-frequency, frozen, staged or
occasional entries; do not add a sidebar explanation card, subtitle or
onboarding copy around it.
- Playwright navigation helpers should use exact names or anchored regex for
short sidebar labels such as `管理`, otherwise fuzzy role-name matching can
click longer labels such as `预算管理`.
@@ -220,6 +269,823 @@ point and prevents each route from inventing a different title/action layout.
`Topbar`, `NavLinks`, `PageHeader`, `WorkspaceHeader`, login, Portal or other
A-class pages.
## Convention: Action Placement Baseline
**What**: Page actions, filters, ledger tools and destructive commands use one
system-wide coordinate model. New and redesigned pages should not invent
page-local action placement.
**Contracts**:
- PC page primary action lives in the page header action area
(`WorkspaceHeader` / `PageHeader` actions). Keep one primary action per page
surface and at most two visible secondary actions.
- List filters live in the first command bar below the page header. Search,
status, scope and other common filters stay on the left; ledger tools such as
export, batch, statistics, templates and advanced filters stay on the right or
inside `台账工具` / `更多`.
- Row-level actions live at the right edge of a table row or at the tail of a
card. Prefer `查看详情`, `查看处理` and `继续编辑` over broad verbs that hide the
result.
- Detail pages keep facts and evidence in the main content. High-risk actions
such as approve, reject, return, pay, publish, delete and configuration
switching live in the right command panel or a clearly separated
`detail-action-stack`, with confirmation that includes the current object
summary.
- Form save/submit actions live at the form bottom on PC. Long forms may add a
right-side summary command panel, but the same action should not be repeated in
unrelated header, row and footer locations.
- Mobile pages use top status/focus content plus a bottom safe-area action
surface for the primary action. Do not copy PC command bars or wide tables
into mobile routes.
- Batch actions only appear after selection, as a contextual command bar or
bottom sticky bar.
- Destructive, financial, approval and configuration-changing actions must be
visually and structurally separated from normal navigation/edit actions.
**Why**: hyb-oa targets small teams where one person may switch roles many times
per day. Stable action coordinates reduce relearning and help a solo developer
avoid page-by-page exceptions.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright or screenshot checks when changing shared page headers,
command bars, task lists, detail action panels or mobile bottom actions.
## Convention: State-Driven Actions
**What**: Business actions are derived from explicit object state and current
actor context. Do not scatter page-local button conditions across route
components.
**Contracts**:
- Before redesigning a page with mutable business records, define or reference a
state matrix. The matrix must cover object state, actor role, primary action,
secondary actions, forbidden actions, reason text, risk level and confirmation
requirement.
- Common lifecycle states include draft, submitted, in approval, returned or
rejected, approved, pending execution or payment, completed or paid,
cancelled, abnormal and archived. Use the business module's real names when
they differ.
- Draft states prioritize edit, submit and delete draft. Do not show approval or
payment actions there.
- In-approval states prioritize progress, withdraw and supplement-material
actions. Approve, reject and return actions belong to the current user's
workflow task detail, not broad ledger rows.
- Returned or rejected states prioritize correction and resubmission.
- Approved-but-not-paid states route payment work to finance or cashier views;
ordinary employee views should explain the next step instead of exposing
executable payment controls.
- Payment actions such as mark paid, register payment, cancel payment, batch
payment and execute payment live only in payment, finance-processing,
payment-batch detail or an explicitly current finance task panel.
Reimbursement, procurement, contract and project ledgers/details show payment
status, receipt status, `查看付款`, `补回单` or a payment-record link instead
of executable payment controls.
- Paid, completed, archived and cancelled states are read-mostly. Print, export,
attachment download and history belong in `更多` or audit paths when allowed.
- Abnormal states must explain source, impact and next step. A red status label
alone is insufficient.
- Destructive, financial, approval and configuration-changing actions require
confirmation that shows the current object summary and writes audit evidence
when the backend supports it.
- The frontend may hide disabled actions or show reason text, but the backend
remains the source of truth for permission and state validation.
- Use destructive lifecycle verbs consistently: `删除` only for drafts,
non-effective temporary records or wrong materials that have not entered a
business process; `撤回` for initiator withdrawal during allowed workflow
states; `取消` when the business will not continue; `作废` when a numbered,
signed, paid, published or effective object becomes invalid; `归档` when a
completed object is locked for retention. Submitted business records should
not be physically deleted from ordinary UI paths.
**Why**: State-driven actions prevent pages from showing buttons that the user
cannot complete and keep reimbursement, procurement, contracts, assets and
payments consistent as the system grows.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright coverage for changed state/action behavior, especially
draft, rejected/returned, in-approval, approved, paid/completed, cancelled and
abnormal states.
## Convention: Role-Scoped Data Surfaces
**What**: The backend is the source of truth for permissions and data scope. The
frontend shapes the authorized capabilities into the current task role instead
of exposing every allowed tool at once.
**Contracts**:
- Ordinary employee views default to `我的`, `与我相关`, `我发起` and
`需要我补充`. Do not show company-wide ledgers, batch tools, export, audit,
configuration, internal IDs or other people's sensitive attachments by
default.
- Initiator views emphasize current status, next step, supplement-material
needs, approval/payment progress and whether edit or withdraw is allowed.
- Approver and processor views emphasize `待我处理` and the current node task.
Show approve, reject, return or transfer actions only when the server-backed
task assignment says the current user can act.
- Approval actions such as approve, reject, return and transfer execute only in
`待我处理`, workflow task detail, mobile approval detail or an explicitly
current task-processing panel. Business ledger rows and ordinary business
details use `查看处理`, `查看进度`, `补材料` or a link into the workflow task;
they must not duplicate approval action buttons.
- Finance and cashier views may expose authorized reimbursement, payment,
invoice, AP, receipt and exception operations. Full-scope, export, batch,
delegated creation and statistics tools belong in `台账工具`, `更多` or
role-only panels.
- Owner and project-lead views emphasize team/project scope, blockers, risks and
approvals. They should not drift into system configuration unless the route is
a management route.
- Admin views live under `管理` and cover people, organization, workflow,
feature flags, integrations, audit and troubleshooting. Do not mix these
controls into ordinary employee paths.
- Read-only or audit views can show authorized evidence but must not show
mutable edit, approval, payment, publish or disable actions.
- Do not add a global role or identity switcher. Multi-role users do not choose
`员工` / `财务` / `管理员` before using the system. Routes infer the most
relevant task view by default.
- Multi-role users may switch scope inside a specific authorized ledger, but the
default scope follows the page purpose: reimbursement starts with mine,
workflow tasks start with my tasks, ledgers start with relevant or recent
records, management starts with management scope. Use route-local scope
controls such as `我相关` / `我负责` / `财务处理` / `全范围`.
- Use explicit controls such as `我的 / 团队 / 全范围` only when the server grants
those scopes. Hiding controls in the frontend is not a security boundary.
- Unauthorized actions should usually be hidden. When explanation is useful,
show short natural Chinese reasons such as `当前节点不是你处理`, `已支付单据不可编辑`
or `仅财务可导出`.
**Why**: hyb-oa users often wear several hats. Role-scoped surfaces keep one
person's broad authority from turning every page into an admin console.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Role-focused Playwright coverage when changing visibility for employee,
approver, finance/owner or admin paths.
## Convention: User-Facing Identifiers And Copy Semantics
**What**: Ordinary product surfaces use business identifiers and natural
Chinese. Internal identifiers are auxiliary evidence for audit and
troubleshooting, not primary user-facing content.
**Contracts**:
- Use business identifiers, names or summaries as primary labels: reimbursement
number, purchase request number, contract number, asset number, payment batch
number and project name.
- Do not show UUID, taskId, entityId, permission code, role code, internal state
code, raw payload, full local path, API path, database field name, OCR
provider, debug trace, Secret or token on ordinary employee, approver,
finance or mobile paths.
- Audit logs, admin troubleshooting, integration failure details, printed
evidence and export handoff files may show necessary internal IDs when
authorized. Place them in low-priority areas such as `技术信息`, `审计信息` or
`排障信息`; never use them as the page title, card title, button label or
first ordinary list column.
- Show one primary identifier for the same object in one surface. Avoid placing
business number, UUID, taskId and entityId together unless the route is an
audit/troubleshooting route.
- Translate technical enum values and platform words into natural Chinese:
`PENDING_APPROVAL` becomes `审批中`; `REJECTED` becomes `已驳回` or
`被退回待补正`; `AP Operations` becomes `应付账款`; `Feature Flag` becomes
management wording.
- Time copy should answer the business question. Prefer `已等待多久`, `接收于`,
`提交于`, `支付于` and `归档于` over generic `更新时间` when the user needs to
decide what to do.
- Errors and abnormal states must explain source, impact and next step in
natural Chinese. Do not surface only HTTP codes, backend enum names or red
badges.
- Notifications and mobile cards use the shortest useful business identifier or
summary. Do not pack long technical IDs into small surfaces.
**Why**: Internal implementation language makes the product feel complex and
unfamiliar. Business identifiers and natural Chinese keep small-team workflows
legible.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- UI tests or screenshot review for changed list/detail/notification/mobile
surfaces to confirm internal IDs and technical enum names are not visible.
## Convention: Ledger List Defaults
**What**: Business list and ledger pages default to a light, task-oriented list.
Advanced ledger capabilities remain available but must not dominate the first
screen.
**Contracts**:
- Keep 3 to 5 high-frequency filters visible by default. Prioritize search,
status, scope and date/time; add business-specific filters such as project,
person or type only when they are genuinely frequent.
- The default view must match the route's main job: `我的报销`, `待我处理`,
`合同台账`, `资产台账` and similar task nouns. Do not default ordinary users
into company-wide management views.
- Rows and cards must answer what the object is, current state, why it relates
to the current user and the next action.
- Place common filters on the left side of the command bar below the page
header. Put export, batch, statistics, templates, full-scope, advanced
filters, delegated creation and low-frequency module links in `台账工具`,
`更多` or role-only panels.
- Batch actions appear only after selection, as a contextual command bar or
bottom sticky bar. High-risk batch actions such as approve, pay, delete or
publish require summary confirmation and result details.
- Export is not a primary page action. Explain export scope and sensitive
content when relevant; finance, contract, asset and invoice exports must stay
permissioned and auditable.
- PC ledgers may use pagination, sorting and density controls. Default columns
should be decision-supporting fields only; low-frequency fields belong in
details, column configuration or advanced filters.
- Empty states are status-specific. `没有草稿`, `没有被驳回`, `没有待处理` and
`没有异常` should not all share one generic explanatory panel.
- Mobile routes do not copy PC ledger tools. Use search, status filtering, card
lists and one primary action; leave complex analysis, export and broad-scope
management to PC.
- Contract, procurement, project and finance ledgers use a list-to-detail
boundary. The list is for discovery, filtering, status reading and navigation.
High-risk or sensitive actions such as contract download, archive, payment,
export, batch processing, void/cancel and sensitive attachment viewing belong
in detail workspaces, detail command panels or `台账工具`, with permission,
audit and confirmation.
- Default ledger scope follows the current task role: ordinary employees see
`我发起` / `我相关`, owners and project leads see `我负责` / `项目相关`, finance
sees `待复核` / `待付款` / `异常`, and admins may enter or switch to `全范围`.
Full scope, export and batch commands stay in `台账工具` or role-only panels,
not ordinary first screens.
- Contract ledgers in V1 are registration, archive, due/renewal reminder and
relation surfaces for project, procurement and payment context. Do not design
`/contracts-registry` as e-signature, legal-review, clause-library,
version-collaboration or full CLM software. If contract approval is needed,
link to the OA approval center or a separate future task instead of adding an
approval workspace inside the contract ledger.
- Procurement ledgers in V1 are request, approval, attachment, light
acceptance/archive and relation surfaces for project, contract and payment/AP
context. Do not design `/purchase-requests` as purchase-order lifecycle,
inventory, three-way matching, supplier-lifecycle, tendering or ERP software.
Approved procurement means the request was approved; it does not imply paid,
received into inventory or converted into a fixed asset.
- Project pages in V1 are light project ledgers for status, owner/member,
milestone/task, risk, delivery-record and related reimbursement, procurement,
contract and payment context. Do not design `/projects` as full project
management software with Gantt charts, complex dependencies, timesheets,
resource scheduling, OKR, portfolio management or large collaboration suites.
Project pages summarize and route; source records stay in their business
modules.
- Finance ledgers in V1 are payment-preparation, payment-batch, receipt-audit,
AP-status, invoice/OCR-status and agency-accounting handover summaries. Do
not design payment, AP or invoice pages as online banking, bank-statement
ingestion, ERP/general-ledger, voucher-generation, auto-reconciliation, tax
filing or full accounting software. Real payment stays in offline banking or
existing finance/accounting workflows; OA records status, evidence and
handover summaries.
- Payment actions require the finance/payment context: amount, payee or target
object, source records, offline payment explanation, evidence completeness,
receipt requirement and correction boundary. Do not place `标记已付款`,
`取消付款`, `批量付款` or `执行付款` directly in reimbursement, procurement,
contract or project ledgers/details.
- Cross-module relation sections are summary-and-route surfaces. Project,
procurement, contract, reimbursement, asset and payment pages may show related
business number/name, status, amount or quantity, owner, evidence completeness
and next-step summary, then link to the owning detail/task/finance page. Do not
duplicate the owning module's approval actions, payment actions, invoice/OCR
processing, contract-body download, sensitive attachment actions, state machine
or batch tools inside another module's relation card.
**Why**: The product's main complexity complaint is too many visible operations.
Light default ledgers keep daily work simple while preserving advanced finance
and management workflows.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright or screenshot checks when changing list filters, command
bars, `台账工具`, batch selection behavior, empty states or mobile list cards.
## Convention: Asset Registry Pages
**What**: Asset pages render `FA` fixed assets as a lightweight responsibility
ledger inside the unified asset registry, not as a full accounting fixed-asset
subsystem.
**Contracts**:
- The default `/assets` view answers where the asset is, who uses it, who is
responsible for it, what state it is in and whether it needs inventory or
handover. Do not lead with depreciation, accounting subjects or ERP sync.
- Register physical items that must be returned, transferred, inventoried or
protected, such as computers, monitors, disks, equipment and security media.
Do not create `FA` cards for ordinary consumables.
- Every `FA` card needs an asset number. Physical assets that can carry labels
should expose QR-label status for scan, inventory, assignment and return
workflows. Assets that cannot be labeled must still expose serial number,
custodian and location as the lookup fallback.
- Inventory cadence is lightweight: quarterly routine checks by default, event
checks for departure, transfer, repair and retirement, and monthly custodian
plus location confirmation for high-risk physical assets such as backup disks,
security media and critical equipment.
- Assignment, return and transfer are daily flow actions that admins may record
with audit evidence. Disposal actions such as retirement, loss, sale and gift
require owner confirmation, a reason and consequence summary. If compensation,
money or responsibility is disputed, the asset UI records pending/confirmed
outcomes only and must not complete the dispute in one click.
- Keep acquisition source, business number, owner/custodian, location, status,
assignment, return, transfer, repair, retirement, inventory result and
handover evidence visible in the business flow.
- Procurement or reimbursement records may expose an asset-candidate signal, but
they must not create an `FA` asset card automatically after approval,
submission or payment. The asset registry UI may guide admins from candidates
to `新建资产卡片`, but the card is created only after manual verification of
delivery, quantity, owner/custodian, consumable status, returns and gifts.
- Move depreciation, residual value, accounting subject and monthly
depreciation voucher concepts out of the OA primary UI unless a later Trellis
task explicitly scopes accounting-ledger work.
- Keep classification maintenance, ERP sync, raw metadata and advanced filters
behind management, collapsed or advanced surfaces so they do not dominate the
asset list/detail first screen.
- Mobile asset lookup should prefer QR scan and fall back to asset number or
serial number input. Do not require heavy photo inventory unless a later task
explicitly scopes it.
- Asset list/detail UI may show last inventory, next inventory and overdue
hints. Do not turn cadence into a complex scheduling/configuration console in
the default asset registry view.
- Disposal commands must be visually separated from assignment/return/transfer
commands and use confirmation that shows asset number, name, owner, current
custodian, location, reason and effect on asset status.
- Electronic assets (`EA-DOC`, `EA-SYS`, `EA-REPO`, `EA-BKP`) are metadata and
responsibility indexes. Show owner, custodian/admin, permission-recovery
requirement, backup or restore-verification date, sensitivity level and
archive-location summary. Do not display or store source packages, secrets,
tokens, full configs, real full paths or backup contents.
- `EA-DOC` list/detail views show document name, type, hash or verification
summary, sensitivity level, owner, related project/contract/payment and
archive-location summary. Contract text, bank statements, certificate
originals, customer materials, sensitive quotes, payroll/social-security data
and personal identity materials must not appear as ordinary asset-page
content; route business originals through their module attachment permissions
or offline controlled archive.
**Tests Required**:
- Asset page screenshots or E2E assertions should verify the first screen is
asset-list/detail/task oriented, with classification and integration tooling
demoted.
- Mobile asset scan tests should cover lookup, summary and one allowed action;
mobile must not expose classification maintenance or full metadata editing.
Include QR scan or manual asset-number/serial-number fallback when this
surface changes.
- Electronic asset UI changes should assert that sensitive source/config/backup
content and full paths are not visible in ordinary list/detail/mobile views.
- `EA-DOC` UI changes should assert that high-sensitive originals are not
rendered in ordinary asset list/detail/mobile views.
## Convention: Forms, Drafts And Validation
**What**: Long business forms support interruption and recovery. Save draft and
submit are distinct actions with different consequences.
**Contracts**:
- Long forms should support drafts by default when the business object requires
multiple fields, line items or materials, including reimbursements,
procurement, contract drafting, asset intake and payment supplement flows.
- `保存草稿` stores progress only. It must not trigger approval, payment,
publishing or external synchronization. `提交` enters the business workflow.
- Draft save may allow incomplete data, but it must preserve entered fields,
line items, attachment references and the recoverable object state.
- Before submit, run business validation and show a summary confirmation with
the object summary, amount or quantity, important contract/asset/payment
facts, attachment or invoice completeness, and next node or consequence.
- Material upload is type-first. Let the user choose or enter the material type
before upload, then apply type-specific copy, validation, permissions, audit
and display placement. Do not use one generic attachment uploader for PDF
invoices, ordinary attachments, contract files, payment receipts, acceptance
materials, asset materials and electronic-document indexes.
- Upload labels must describe the result, such as `上传 PDF 发票`,
`补充付款回单`, `上传合同文件`, `补充验收材料` or `登记资产材料`.
- Validation errors must point to the field, line item, invoice, attachment,
contract material or asset section that needs work. A top-level `提交失败`
message alone is insufficient.
- Separate blocking errors from warnings. Blocking errors prevent submit;
warnings may allow users to confirm and continue when the business rule
permits it.
- Server-side validation failures must preserve user input and show repair
guidance in natural Chinese.
- Warn before navigation when the form has unsaved changes, including leaving
the route, closing a modal, switching record or returning to the list.
- Autosave can be used as an enhancement, but the visible state must still make
clear whether the object is draft, submitted or failed to save.
- Mobile forms keep only necessary fields, material upload, status explanation
and a bottom safe-area primary action. Do not move admin configuration,
complex configuration matrices, bulk import or workflow design into mobile
forms.
- Mobile validation messages should appear near the field or material card, and
bottom actions must not cover the final input.
**Why**: Small-team users often switch tasks mid-form. Drafts and precise
validation prevent repeated re-entry and reduce support/debugging cost.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright coverage for draft save, submit validation, unsaved-change
protection and server-validation failure paths when changing form behavior.
## Convention: Detail Evidence Layout
**What**: Detail pages use one evidence-first structure so users can understand
state, facts and consequences before acting.
**Contracts**:
- Use this order for reimbursement, workflow task, procurement, contract, asset,
project and payment details: status/next step, business summary, evidence
materials, risk or validation signals, approval/processing history, actions.
- The top overview shows business number or name, current state, critical amount
or object facts, current handler or next node, and a clear return path.
- The first content block is `当前状态与下一步`: explain where the object is,
who needs to act, what happens next and whether there are blockers or
warnings.
- The business summary block shows the fields needed before approval or review:
requester, amount, project, purchase object, contract counterparty, asset
owner, payment batch and similar module facts.
- Evidence materials sit in the main content, grouped by business meaning:
line items, PDF invoices, attachments, contract files, asset photos/numbers,
receipts and acceptance materials.
- Risk or validation sections appear only when there is a real signal such as
budget issue, duplicate invoice, missing attachment, contract expiry, asset
anomaly or payment failure.
- Approval and processing history is for traceability. Keep a useful summary
visible, but do not let full history crowd out current status and evidence.
- PC high-risk actions live in the right command panel or separated action
stack. Mobile high-risk actions live in the bottom action surface or a
confirmation panel.
- Approve, reject, return, pay, publish, delete and void actions must show the
object summary and consequence before execution.
- When evidence is incomplete, change the primary action to supplement material,
view issues or an explained disabled state. Do not leave users guessing from a
disabled button alone.
- List and ledger rows show only evidence completeness summaries, missing
evidence hints and a detail entry. Invoice preview, attachment download,
contract file viewing, receipt download, evidence deletion and bulk packaging
belong in detail workspaces, detail command panels, `台账工具` or authorized
audit paths.
- Sensitive evidence such as invoices, contracts, receipts and attachments must
be permissioned; download and export belong in `更多` or audit paths when
appropriate.
- Detail evidence sections group materials by type. Do not mix invoices,
ordinary attachments, contract files, receipts, asset materials and
electronic-document indexes in one undifferentiated list.
- Mobile details use a top focus card, sectioned cards and bottom safe-area
actions. Do not copy PC two-column detail or wide tables into mobile.
**Why**: Detail pages are the place where users decide whether to approve,
reject, pay or supplement materials. Consistent evidence order reduces
misreads and accidental actions.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright or screenshot checks when changing detail overview,
evidence sections, history placement, right command panels or mobile detail
bottom actions.
## Convention: Mobile Lightweight Surfaces
**What**: Mobile and Enterprise WeChat WebView routes are lightweight action
surfaces. They are not compressed PC management consoles.
**Contracts**:
- Mobile may support lightweight submit, supplement-material, status lookup,
task handling, scanning, upload and message-deeplink flows.
- Keep mobile pages to top status or focus card, card list or sectioned detail,
and bottom safe-area primary action.
- Mobile home should show compact status and today's actionable items. Do not
add a full module directory or dashboard.
- Mobile lists use search/status filtering, cards and one primary action. Do not
use wide tables, column configuration, complex multi-column filters,
full-scope management, admin configuration, batch export, bulk approval or
bulk payment.
- Mobile details use a focus card, sectioned evidence and bottom actions. Do not
copy PC two-column layouts.
- Mobile forms keep necessary fields, material upload, field-local validation
and a bottom action. Do not put admin configuration, workflow configuration,
feature flags, statistics dashboards or bulk import into mobile forms.
- Bottom actions must account for safe area and keyboard overlap. Button text
must remain readable on narrow screens.
- Dangerous mobile actions must open a confirmation panel that shows object
summary and consequence.
- Ordinary mobile paths must not show internal IDs, permission codes,
configuration matrices or audit troubleshooting panels.
- Enterprise WeChat remains the primary owner for daily HR/attendance actions
such as leave, missed punch, outing, overtime and check-in. OA mobile shows
mirror/history/exception/emergency takeover according to the business
boundary.
**Why**: Most mobile use happens from notifications or quick context switches.
Reducing mobile scope keeps the phone path fast and prevents PC admin
complexity from leaking into WeChat.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Playwright or screenshot coverage for representative narrow viewports when
changing mobile home, mobile lists, mobile details, bottom actions, upload
surfaces or Enterprise WeChat WebView flows.
- If true Enterprise WeChat device validation is unavailable, record it as
paused manual validation; do not claim full WebView acceptance.
## Convention: Notifications Versus Tasks
**What**: Task queues and notifications have separate jobs. A task queue is for
action; a notification center is for event awareness and navigation.
**Contracts**:
- `待我处理` is an action list. Include only items that require the current user
to process, supplement material, review, pay, approve, confirm or resolve an
exception.
- Task rows must have a clear next step, object summary, business state and
processing entry.
- Completed items, read-only progress, announcements, successful sync notices
and ordinary system messages do not belong in the pending task list.
- `通知中心` is an event inbox for status changes, reminders, failures, sync
results, workflow transitions, invoice/attachment recognition results and
Enterprise WeChat delivery results.
- Notifications should support read/unread, view, jump target and failure
explanation. Do not rebuild the full workflow task list inside the
notification center.
- Notification clicks must deep-link to the business detail, workflow task,
mobile target page or failure explanation. Do not send users back to a
generic notification list as the final destination.
- Notification copy should explain what happened, who or what is affected, and
the next useful step. Do not expose raw payloads, internal state codes or
debug fields.
- Workbench `今日待处理` aggregates only actionable items. Ordinary
notifications, read-only progress, completed activity and announcements are
not counted as pending work.
- If a notification represents real work, the backend or aggregation layer
should expose it as an explicit task item; the frontend should not infer every
notification is a task.
- The topbar bell is the notification entry. Do not add notification center as a
default sidebar row.
- Enterprise WeChat messages are an external delivery channel. Keep message
content desensitized and deep-link into the OA business or task detail.
**Why**: Separating event awareness from action prevents Portal, task queue and
notification center from showing the same thing in three different ways.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright coverage when changing task aggregation, notification
center rows, topbar bell behavior, notification deep links or workbench
`今日待处理` counts.
## Convention: Sensitive Data And Exports
**What**: Contracts, finance, invoices, receipts, payments, assets and
attachments are sensitive by default. Frontend surfaces show the minimum useful
summary unless a permissioned workflow requires more.
**Contracts**:
- Treat contract text and attachments, quotations, acceptance materials,
invoices, receipts, payment information, bank accounts, supplier details,
asset serial/location/owner data, personnel records, payroll/performance,
audit records, original file names and export files as sensitive.
- Workbench, notifications, ordinary lists, mobile cards and Enterprise WeChat
messages show desensitized summaries only.
- Ordinary surfaces must not show full bank/account numbers, full local paths,
storage paths, raw payloads, full sensitive attachment names, Secrets, tokens
or high-sensitive contract/finance details.
- Previewing contract text, invoices, receipts and attachments requires
server-side permission checks. Frontend visibility is not a security boundary.
- High-sensitive previews should explain context or purpose when useful and
record view evidence when the backend supports it.
- Download, batch download, export, print, attachment packaging, contract text
export and finance ledger export must be controlled by server permissions and
data scope.
- Export is never the primary first-screen action. Put exports in `台账工具`,
`更多` or role-only finance/admin panels.
- Before exporting sensitive ledgers, explain scope and sensitive contents.
Finance, contract, asset and invoice exports should write audit records.
- Export file names use business numbers and dates. Do not concatenate complete
personal accounts, complete supplier secrets or internal filesystem paths.
- Audit sensitive operations with actor, time, object, action, scope and result
where supported.
- Permission-denied and failure messages use natural Chinese without leaking
full paths, permission codes, raw URLs, payloads, Secrets or tokens.
**Why**: The product is for small teams, but the data is still financial,
contractual and operationally sensitive. Small team convenience must not turn
into broad accidental disclosure.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright or screenshot checks when changing attachment preview,
contract/invoice/receipt surfaces, export controls, mobile summaries,
notification copy or permission-denied states.
## Convention: Permission Empty And Error States
**What**: Permission-denied, empty and error states use natural Chinese that
explains cause and next step. Ordinary users should not inspect platform
internals to understand what happened.
**Contracts**:
- Hide unauthorized actions by default. If a route is opened directly or the
user needs context, show a natural Chinese explanation and a real next step
such as returning to workbench, viewing related records or contacting an
admin.
- Empty states are scoped to the current filter, status or section. Explain what
is absent and show one useful next step; if there is no real next step, hide
the section instead of adding instructional copy.
- Error states explain business cause, impact and recovery path such as retry,
supplement material, return to list or contact admin.
- Ordinary user paths must not show raw `403`, API route names, permission
codes, internal state codes, route stacks, full paths, raw payloads or long
technical error dumps.
- Admin, audit and troubleshooting routes may show the minimum technical
details needed to diagnose a problem, but the business reason and next step
remain primary.
- Mobile and notification targets use shorter copy, but must still include
cause and next step.
**Why**: Small-team users do not have time to decode implementation details.
Clear failure states reduce support work and avoid leaking internal platform
structure.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright or screenshot checks when changing empty states,
permission-denied pages, notification failure targets or shared error
components.
## Convention: Dangerous Action Confirmation
**What**: Destructive, financial, approval, configuration, batch and external
sync actions require meaningful confirmation. A generic `确定吗?` dialog is not
enough.
**Contracts**:
- Treat delete, void, revoke, archive, restore, disable, publish, configuration
switching, workflow switching and feature-flag changes as dangerous actions.
- Treat pay, batch pay, sensitive export, batch download, contract text
download and attachment packaging as dangerous or high-sensitive actions.
- Treat approve, reject, return, transfer, batch approve and batch reject as
approval-risk actions that need context before execution.
- Treat external synchronization, retry external write and Enterprise
WeChat/OA emergency-takeover switching as integration-risk actions.
- Confirmation UI must show object summary: business number, name, requester or
counterparty, amount or quantity and current state when relevant.
- Confirmation UI must explain consequences: target state, reversibility,
notifications, payment/approval/configuration impact and external-system
effect.
- Confirmation UI must show impact scope for batch, export, configuration and
integration actions: selected count, data range, external system, Enterprise
WeChat message or audit scope.
- Rejection and return require a reason. Payment, publishing, batch and
configuration actions may require a confirmation word, explicit checkbox or
selected reason when risk is high.
- Dangerous actions must be visually separated from normal view, edit, save and
submit actions.
- Mobile dangerous actions use bottom or full-screen confirmation panels, not
instant execution from an easy-to-mistap control.
- Confirmation failure must preserve user input and show result details plus the
next repair action.
- Audited actions should record actor, time, object, action, scope, reason and
result where backend support exists.
- Delete, withdraw, cancel, void and archive confirmations must use the exact
business verb and explain the target state. Do not label cancel, void or
archive as `删除`.
**Why**: These actions can change finance, contracts, workflow, approvals,
configuration and external integrations. Users need context before execution,
and support needs an audit trail after execution.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright coverage when changing delete, payment, approval,
publish/disable, batch, configuration or external-sync confirmations.
## Convention: Integration Boundary And External Status
**What**: External-system state is conservative. OA shows facts confirmed by its
own backend and explicit external acknowledgements; it does not present a queued
request, frontend click or message attempt as final business completion.
**Contracts**:
- OA owns reimbursement, procurement, contracts, projects, payments, AP,
invoices, assets, sensitive attachments, audit and OA workflow handling.
- Enterprise WeChat owns daily HR/attendance actions: check-in, leave, missed
punch, outing and overtime. OA shows mirror, history, exception, audit and
emergency-takeover records for those domains.
- ERP, agency accounting, bank, OCR and Enterprise WeChat messages are external
capabilities or delivery channels. They do not replace OA server-side
permissions or state machines.
- Show final labels such as `已同步`, `已发送`, `已付款` and `识别完成` only when the
relevant external system has returned a clear success acknowledgement.
- Use in-progress labels such as `同步中`, `等待回执`, `银行处理中`, `识别中` and
`消息发送中` when the request has started but is not confirmed.
- External failures must show source, impact and next step in natural Chinese,
such as `银行回执未返回` or `OCR 识别失败,需重新上传 PDF`.
- Do not expose raw external error codes, payloads, full URLs, secrets, tokens
or debug traces to ordinary users.
- External writes, payment execution, ERP sync, Enterprise WeChat resend and OCR
retry must be controlled by permissions and state-driven actions.
- Retry confirmation should explain which object will be retried, whether it may
send duplicate external messages, external-system impact and audit effect.
- External sync state should not block unrelated primary flows. If it blocks a
flow, show the blocker and manual repair path.
- Ordinary routes show summary, failure reason and next step. Admin, finance or
troubleshooting routes may show deeper diagnostics when authorized.
- HR/attendance routes should default to Enterprise WeChat record, sync mirror
or exception handling copy. Do not expose OA daily leave/missed-punch paths
unless OA emergency takeover is explicitly enabled.
- Enterprise WeChat messages carry desensitized summary and OA deeplink only;
they do not carry sensitive attachment text or final payment/approval actions.
- If bank, ERP, agency accounting or another integration is not connected or not
confirmed, UI copy must not imply the capability already completed.
**Why**: External integrations are asynchronous and failure-prone. Conservative
copy prevents users from trusting a state the system has not actually verified.
**Tests Required**:
- `cd client && npm run typecheck`
- `cd client && npm run build`
- Focused Playwright coverage when changing Enterprise WeChat boundary copy,
OCR status, bank/payment callbacks, ERP/accounting sync status, retry
controls, external failure messages or integration diagnostics.
## Convention: Verification And User-Testable Claims
**What**: Verification claims must describe the actual validation level. Local
checks, screenshots and mock Playwright runs do not mean a user can test the
change online.
**Contracts**:
- Local build passing means only the local code built successfully.
- Playwright passing means the specified automated path passed in the specified
environment and data state.
- Screenshot review passing means only the captured viewport and state were
reviewed.
- Deployment passing must identify the deployed environment, version or commit
and health check result when available.
- Say `可以线上测试` only after deployment, public access check, key-path smoke
testing and necessary screenshot evidence are complete.
- Before deployment, say `本地验证通过,尚未线上可测`.
- After deployment but before public access check, say `已部署,公网检查未完成`.
- If real-device or Enterprise WeChat WebView validation is unavailable, record
it as paused manual validation. Do not substitute automation for full WebView
acceptance.
- A-class page changes should keep build, focused Playwright or screenshot
evidence according to risk.
- Changes touching permissions, state machines, approval, payment, Enterprise
WeChat, external systems, sensitive downloads or production configuration
need rollback or manual repair notes.
- Updating this design/spec documentation does not mean pages were refactored,
deployed or accepted for live trial.
**Why**: This keeps delivery status honest and prevents the user from trying a
change that has not actually reached a public environment.
**Tests Required**:
- Documentation-only changes: Trellis task validation, governance check and
`git diff --check`.
- Frontend implementation changes: `cd client && npm run typecheck`,
`cd client && npm run build`, plus focused Playwright or screenshots based on
affected surface.
## Convention: A-Class PC Task-First Pages
**What**: A-class PC pages such as Portal, approvals, reimbursement list and
@@ -296,6 +1162,10 @@ a later Trellis task adds an explicit backend eligibility contract.
but normal approval remains in Enterprise WeChat.
- Reimbursement, procurement, travel, contract and other amount/evidence-heavy
OA-owned tasks should route through `查看处理` first.
- Business ledgers and ordinary business details must follow the same rule:
show the task entry or progress, but do not place `通过`, `驳回`, `退回` or
`转审` directly in reimbursement, procurement, contract, project or asset
tables/details.
- Future list-level quick approval requires the backend to expose an explicit
eligibility flag such as `quickApproveEligible=true`, plus task-domain and
audit semantics in the current Trellis task. Frontend heuristics based only on
@@ -319,10 +1189,15 @@ training or permission-maintenance surfaces:
`处理待办`, `提交报销` or `请假`; do not use explanatory entries like
`了解流程`, and do not route users to settings or notifications as a
substitute for task guidance.
- `个人设置` default content is account identity, notification preference and
Enterprise WeChat binding. Organization, report line and role summary may be
folded under `账号详情`; permission code lists and full employee dossier fields
stay out of the default view.
- `个人设置` default content is personal profile, password/security,
notification preference and Enterprise WeChat binding. Organization, report
line and role summary may be folded under `账号详情`; permission code lists
and full employee dossier fields stay out of the default view.
- Keep account settings separate from admin configuration. `个人设置` may show
personal profile, password/security, notification preferences and Enterprise
WeChat binding only. Organization maintenance, role assignment, approval
rules, feature flags, master data, audit logs, employee maintenance and
system configuration belong under `管理`, not the ordinary profile route.
**Why**: Small teams need fewer default decisions. Persistent onboarding and
permission-heavy profile pages make ordinary users inspect system internals
@@ -0,0 +1,6 @@
{"file": ".trellis/spec/hyb-oa/project-governance.md", "reason": "检查任务合同、计划、审批和治理门禁是否满足项目规则。"}
{"file": ".trellis/spec/hyb-oa/frontend-react-vite-design.md", "reason": "检查页面规则是否符合前端任务优先和共享布局约定。"}
{"file": ".trellis/spec/hyb-oa/docs-and-evidence.md", "reason": "检查是否误建长期文档、是否符合事实源回写和脱敏规则。"}
{"file": ".trellis/spec/hyb-oa/wecom-boundary.md", "reason": "检查 HR/考勤企微主办和 OA 镜像/历史边界是否清楚。"}
{"file": ".trellis/spec/hyb-oa/approval-workflow.md", "reason": "检查审批动作、状态和自审边界是否被正确表达。"}
{"file": ".trellis/spec/hyb-oa/reimbursement-invoice-ocr.md", "reason": "检查报销、PDF 发票 OCR 和附件规则是否一致。"}
文件差异内容过多而无法显示 加载差异
@@ -0,0 +1,6 @@
{"file": ".trellis/spec/hyb-oa/project-governance.md", "reason": "Trellis task、审批、提交和单人开发低风险原则。"}
{"file": ".trellis/spec/hyb-oa/frontend-react-vite-design.md", "reason": "前端页面设计、任务优先布局、共享组件和验证规则。"}
{"file": ".trellis/spec/hyb-oa/docs-and-evidence.md", "reason": "文档治理、事实源回写和证据脱敏规则。"}
{"file": ".trellis/spec/hyb-oa/wecom-boundary.md", "reason": "企业微信主办 HR/考勤与 OA 主办业务边界。"}
{"file": ".trellis/spec/hyb-oa/approval-workflow.md", "reason": "审批、工作流、自审和状态边界。"}
{"file": ".trellis/spec/hyb-oa/reimbursement-invoice-ocr.md", "reason": "报销、PDF 发票 OCR 和附件边界。"}
@@ -0,0 +1,114 @@
# 全页面设计规则梳理
## Goal
梳理 hyb-oa 当前 PC、移动和企业微信入口下所有页面的职责、默认布局、操作层级和后续优化建议,形成一份可用于后续前端开发、改进和重构的页面规则地图。目标不是本轮直接重构页面,而是先把“每类页面应该长什么样、先展示什么、哪些能力应隐藏到高级入口、哪些页面不应该继续做”的判断固定下来,降低单人开发时的返工和误改概率。
## What I Already Know
- 产品面向国内、小于 10 人的科技初创公司,用户一人多岗,默认需要低决策成本、少入口、任务优先。
- 开发和维护主要由一个人完成,后续页面规则必须减少分叉、减少页面局部特例,优先复用已有共享布局和验证路径。
- 前端视觉、布局和交互裁决以 `frontend-design` skill 为准;`docs/产品设计规则.md` 只保留产品体验事实、业务边界和验收边界。
- OA 主办报销、采购、费用、合同、项目、付款、AP、票据、资产、审计和高敏附件。
- 企业微信主办 HR/考勤日常动作,包括打卡、请假、补卡、外出、加班;OA 只做镜像、历史、审计、异常和应急接管。
- 当前路由覆盖认证、工作台、审批、报销、财务、票据、采购、项目、合同、资产、HR/考勤镜像、协同、通知、管理配置和移动端页面。
- 最近已完成的前端方向包括:侧边栏任务优先、工作台去快速上手常驻化、待我处理任务优先、报销列表任务卡和台账工具降噪、HR/考勤 OA 快批入口移除。
## Scope
- 梳理所有当前已注册路由和页面文件的页面规则。
- 覆盖 PC、移动、企业微信 WebView 入口下的列表页、详情页、工作台、审批页、管理配置页、通知页、异常页和打印页。
- 输出页面分级、页面布局模板、模块级建议、操作显隐规则、文案规则、空态/错误/加载/权限状态规则和验证建议。
- 明确哪些页面应优先整改,哪些页面只保留管理/历史/低频入口,哪些页面未来需要单独 Trellis task。
## Out Of Scope
- 本轮不直接修改业务页面代码。
- 本轮不做公网部署、公网检查、真实数据写入、企业微信写入或生产配置变更。
- 本轮不重做视觉主题、颜色系统、组件库或路由权限模型。
- 本轮不新增业务能力,不恢复已冻结模块,不把企业微信主办的 HR/考勤日常审批搬回 OA。
## Requirements
- 页面规则必须以小团队中文 OA 工作台为中心,不做营销页式布局。
- A 类核心流程必须先回答“我现在要处理什么 / 下一步点哪里 / 当前状态是什么”。
- B 类业务运营页面必须默认显示常用台账和处理动作,导出、批量、统计、模板、复杂筛选进入高级入口或权限入口。
- C 类管理配置页面允许信息密度更高,但必须统一承接在“管理”下,默认不进入普通员工路径。
- 移动端不得出现桌面宽表或 PC 管理配置台,必须使用卡片/列表/底部主操作/安全区规则。
- 详情页必须统一“状态与下一步、业务摘要、证据材料、审批/处理历史、动作面板”的信息顺序。
- 全系统必须统一操作区位置:PC 全局主动作在页头右侧,列表筛选/工具在页头下方命令栏,行级动作在列表最右侧或卡片尾部,详情高风险动作在右侧命令栏,移动主动作在底部吸附区。
- 资产管理、盘点、合同、采购、项目等 B 类业务页必须单独列规则,不能只用“业务运营页面”笼统覆盖。
- 所有普通用户页面不展示 UUID、taskId、entityId、内部状态码、Secret、完整本地路径、原始 payload 或调试字段。
- HR/考勤页面必须明确企微主办边界:OA 页面默认是镜像/历史/异常/应急,不是日常请假/打卡入口。
- 行业惯例相关事项必须提前形成决策清单,逐项确认后写入 `design.md` 或长期规范,不能在后续页面改造时临时各做各的。
## Confirmed Decisions
- `2026-05-30`:一级导航采用“任务优先 + 权限显示 + 更多兜底”,但不把已启用且常用的业务台账强行藏到 `更多`。`合同`、`采购`、`资产`、`项目` 这类真实业务入口,只要用户有权限且模块启用,应直接作为一级入口显示;`更多` 只承载低频、冻结、阶段性或偶尔查看的入口。
- `2026-05-30`:`工作台` 和 `待我处理` 不重复。`工作台` 是所有人的今日总览和分流;`待我处理` 是审批/处理角色的正式处理队列,只对有处理职责的人显示。
- `2026-05-30`:全系统审批动作集中在 `待我处理` / 审批详情执行。报销、采购、合同、项目、资产等业务台账列表和普通业务详情只显示 `查看处理`、`查看进度`、`补材料` 或进入审批任务的入口,不直接放 `通过`、`驳回`、`退回`、`转审`;审批前必须进入统一审批详情核对摘要、证据、后果和确认。
- `2026-05-30`:全系统固定使用六类页面模板:`工作台总览`、`任务处理列表`、`业务台账列表`、`主从工作台`、`详情工作区`、`管理配置页`。后续页面先判定模板,再填业务内容,不允许每个页面临时自创新布局。
- `2026-05-30`:全系统统一操作区坐标。PC 页头右侧放页面主动作,页头下方命令栏放筛选和台账工具,列表最右列或卡片尾部放行级动作,详情右侧命令区或动作栈放高风险动作,移动端底部吸附主动作;危险/不可逆动作必须和普通动作拉开并二次确认。
- `2026-05-30`:全系统采用“状态先于按钮”的动作生命周期规则。每个业务对象必须先定义状态矩阵,再决定按钮显隐、主次关系、禁用原因和确认方式;不允许页面局部临时判断草稿、审批中、已通过、待支付、已支付、已取消、异常等状态下的动作。
- `2026-05-30`:全系统统一删除、撤回、取消、作废和归档语义。草稿或未生效临时对象才可删除;审批中由发起人按规则撤回;业务不再执行用取消;已编号、已签署、已付款或已生效对象失效用作废;完成后锁定留存用归档。已提交后的业务对象原则上不物理删除,必须保留原因、操作者、时间和审计记录。
- `2026-05-30`:全系统采用“服务端权限为准,前端按当前任务角色收敛展示”的角色和数据范围规则。普通员工默认看“我的/与我相关”,审批人看“待我处理”,财务和负责人看授权范围内的台账与处理入口,管理员看配置和审计;即使同一用户一人多岗,也不因为有权限就默认展开所有高级工具、全量数据和内部字段。
- `2026-05-30`:全系统采用业务编号和自然中文作为普通用户主语义。普通用户页面不展示 UUID、taskId、entityId、权限 code、内部状态码、原始 payload、完整本地路径或调试字段;只有审计、排障、打印留痕等授权场景才展示必要内部编号,并且不能替代业务编号成为主标识。
- `2026-05-30`:全系统权限不足、空状态和异常状态统一用自然中文说明原因和下一步。普通用户路径不暴露 `403`、接口名、权限 code、内部状态码、路由栈、完整路径、原始 payload 或大段技术错误;管理员、审计和排障页只展示最小必要技术信息。
- `2026-05-30`:全系统列表和台账默认收敛。列表首屏只保留 3 到 5 个高频筛选,搜索、状态、范围、时间优先;导出、批量、统计、模板、全范围、高级筛选进入 `台账工具` 或 `更多`;批量动作只在选中记录后出现;移动端不承接复杂台账工具,只保留搜索、状态筛选和卡片列表。
- `2026-05-30`:全系统长表单支持草稿和清晰提交。保存草稿与提交是两个明确动作;提交前必须做业务校验和摘要确认;离开未保存页面要提示;错误提示必须定位到字段、明细行、发票、附件或材料区;移动端表单只保留必要字段和底部主动作,不承接复杂配置表单。
- `2026-05-30`:全系统详情页采用统一证据结构。详情页先展示状态与下一步,再展示业务摘要,证据材料居中,审批/处理历史靠后,动作面板固定在 PC 右侧或移动端底部;报销、审批、采购、合同、资产等详情页都按这个顺序组织,不把所有信息平铺到首屏,也不把高风险动作放在用户看完证据之前。
- `2026-05-30`:全系统证据材料统一在详情页集中处理。列表页和台账页只显示发票、附件、合同文件、回单、资产材料等证据的完整性摘要、缺失提示和进入详情入口,不直接承接预览、下载、删除、批量打包或敏感材料处理;这些动作进入详情页、详情命令区、台账工具或授权审计路径。
- `2026-05-30`:全系统上传材料采用“材料类型先行”。上传前必须明确是 PDF 发票、普通附件、合同文件、付款回单、验收材料、资产材料还是电子资料索引,不使用一个万能 `上传附件` 入口混收所有材料;不同类型分别进入对应校验、权限、审计和展示位置。
- `2026-05-30`:全系统付款相关动作集中在 `付款` / 财务处理详情执行。报销、采购、合同、项目等列表和普通详情只显示付款状态、回单状态、`查看付款`、`补回单` 或进入付款记录入口,不直接放 `标记已付款`、`取消付款`、`批量付款`、`执行付款`;付款动作前必须核对金额、对象、线下付款说明、证据和回单。
- `2026-05-30`:全系统跨模块关联采用“摘要 + 跳转”边界。项目、采购、合同、报销、资产、付款等页面可以展示关联对象的业务编号、名称、状态、金额/数量、负责人、证据完整性和下一步摘要,但不能复制对方模块的完整流程、审批动作、付款动作、发票/OCR处理、合同正文下载或高敏附件操作;需要处理时跳转到归属模块详情、审批任务或财务处理页。
- `2026-05-30`:移动端只承接轻动作,不复制 PC 管理台。移动端主要用于提交、补材料、查状态、处理待办、扫码、上传和从企业微信消息直达;不承接复杂台账、全范围管理、批量导出、批量审批、批量付款、流程配置、管理配置、功能开关、复杂筛选和大表格;移动页面统一使用顶部状态/焦点卡、卡片列表或分区详情、底部安全区主动作。
- `2026-05-30`:全系统区分待办和通知。`待我处理` 是行动列表,只放需要当前用户处理的事项;`通知中心` 是事件收件箱,只放状态变化、提醒、失败、同步结果等消息;通知点击直达业务详情、审批任务或失败解释页,不在通知中心复制一套待办处理列表,也不把普通通知算入工作台 `今日待处理`。
- `2026-05-30`:全系统敏感数据默认最小展示。合同正文、发票、回单、付款信息、资产敏感字段、附件和导出文件只展示必要摘要;预览、下载、导出、批量下载必须按服务端权限控制并写审计;普通列表和移动端不展示完整账号、完整路径、原始附件名里的敏感信息或高敏合同/财务细节。
- `2026-05-30`:全系统危险动作必须二次确认且展示对象和后果。删除、付款、发布、停用、作废、驳回、退回、切换配置、批量处理等不可逆或高风险动作,确认面板必须包含对象摘要、后果、影响范围、必要理由输入或确认输入,并写入审计;不允许只弹一句 `确定吗?`。
- `2026-05-30`:全系统明确集成和外部系统边界。OA 主办报销、采购、合同、项目、付款、AP、票据、资产和高敏附件;企业微信主办 HR/考勤日常动作;ERP、银行、代账、OCR、企业微信消息等外部系统只展示真实同步状态、失败原因和下一步,不在界面上承诺系统无法确认的 `已同步`、`已付款` 或 `已审批`。
- `2026-05-30`:全系统统一试运行和验收证据口径。本地构建、Playwright 和截图通过只代表本地验证通过;只有完成部署、公网访问检查、关键路径冒烟和必要截图证据后,才能告知用户 `可以线上测试`;未部署时只能说明 `本地验证通过,尚未线上可测`。
- `2026-05-30`:固定资产在 OA 中按统一资产台账的 `FA` 类型管理,口径是实物责任、盘点和离职交接,不是完整财务固定资产账。电脑、显示器、硬盘、设备、安全介质等需要归还或盘点的实物应登记;普通耗材不登记;折旧、残值、会计科目和月度折旧凭证暂由财务/代账系统主办,OA 只记录采购来源、责任链、流转状态和交接证据。
- `2026-05-30`:采购/报销与固定资产采用“资产候选 + 管理员建卡”的轻量衔接。采购明细或报销材料只标记可能形成资产的线索,不自动生成资产卡片;到货、验收或报销完成后,由管理员核对实物、数量、归属、是否耗材、是否退货/赠品后手动创建 `FA` 资产卡片并关联来源单据。
- `2026-05-30`:固定资产必须有 `FA` 资产编号;电脑、显示器、硬盘、设备、安全介质等实物资产能贴标签就贴二维码标签。确实不适合贴标签的资产不强制贴,但必须记录序列号、保管人和位置;盘点支持扫码优先和手工输入兜底,不强制复杂拍照盘点。
- `2026-05-30`:固定资产盘点采用轻量频率。小团队 V1 默认每季度做一次固定资产轻盘点;离职、调拨、维修、报废等事件发生时做事件盘点;备份硬盘、安全介质和关键设备每月确认一次责任人和位置。
- `2026-05-30`:固定资产处置采用“流转留痕、处置确认”的轻量规则。领用、归还、调拨由管理员直接记录并留痕;报废、丢失、出售、赠送等处置必须负责人确认并填写原因;涉及赔偿、金额或责任争议时另走审批或线下确认,不在资产页一键完成。
- `2026-05-30`:电子资产只做责任和验证索引。代码仓库、系统、备份介质/集合在 OA 中只登记元数据、负责人、权限回收要求、备份/恢复验证日期和归档位置摘要;不保存源码包、密钥、token、完整配置、真实完整路径或备份内容。
- `2026-05-30`:电子资料资产 `EA-DOC` 只登记资料名称、类型、hash/校验摘要、敏感级别、负责人、关联项目/合同/付款和归档位置摘要。合同正文、银行流水、证照原件、客户资料等高敏原文不进普通资产页,必须走对应业务附件权限或线下受控归档。
- `2026-05-30`:资产管理规则组已收口。后续资产页面整改按本任务和 `docs/需求-资产管理规约.md` 执行,不再在本轮继续扩展资产业务细节;下一组转入合同、采购、项目和财务台账的统一页面规则。
- `2026-05-30`:合同、采购、项目和财务台账统一采用“列表查找、详情处理”的页面边界。列表页只负责查找、筛选、看状态和进入详情;合同下载、归档、付款、导出、批量处理、作废、敏感附件查看等高风险动作放到详情页、详情命令区或台账工具中,并二次确认。
- `2026-05-30`:合同、采购、项目和财务台账默认按当前角色收敛视角。普通员工看 `我发起/我相关`,负责人看 `我负责/项目相关`,财务看 `待复核/待付款/异常`,管理员才默认进入或可切换 `全范围`;全范围、导出、批量默认收进台账工具。
- `2026-05-30`:合同台账 V1 只做登记、归档、到期/续签提醒,以及关联项目、采购和付款,不做完整合同生命周期管理。电子签、复杂法务审查、条款库、版本协同和完整 CLM 不进入当前合同台账;如需合同审批,走 OA 统一审批中心或另建后续 Trellis task。
- `2026-05-30`:采购台账 V1 只做申请、审批、附件、轻量验收/归档,以及关联合同、项目和付款/AP,不做完整采购 ERP。采购订单全生命周期、库存、三单匹配、供应商生命周期管理、招采评标和 ERP 入账不进入当前采购页;审批通过也不代表已付款、已入库或已形成固定资产。
- `2026-05-30`:项目模块 V1 只做轻项目台账:项目状态、负责人/成员、里程碑/任务、风险、交付记录,以及关联报销、采购、合同和付款,不做完整项目管理软件。甘特图、复杂任务依赖、工时、资源排期、OKR、项目组合管理和大型协同平台不进入当前项目页。
- `2026-05-30`:财务台账 V1 只做付款准备、付款批次、回单留痕、AP 状态、票据/OCR 状态和代账交接摘要,不做完整财务软件。银行直连真实支付、银行流水自动导入、ERP/总账、凭证生成、自动对账和税务申报不进入当前财务页面;真实付款继续在线下银行或既有财务/代账流程完成,OA 只记录状态、证据和交接摘要。
- `2026-05-30`:个人设置和管理配置彻底分离。`个人设置` 只放个人资料、密码/安全、通知偏好和企业微信绑定;组织、角色、审批规则、功能开关、主数据、审计日志、人员维护和系统配置统一进入 `管理`,不出现在普通员工路径或个人资料页里。
- `2026-05-30`:多角色用户不做全局身份切换器。用户一人多岗时,页面按当前任务自动显示最相关视角;需要跨范围查看时,只在具体台账内提供 `我相关 / 我负责 / 财务处理 / 全范围` 等授权范围切换,不要求用户先选择“员工/财务/管理员”身份再使用系统。
## Acceptance Criteria
- [ ] `design.md` 覆盖当前路由清单中的所有页面或页面族,并给出布局/操作/降噪建议。
- [ ] 规则能直接指导工作台、报销列表、报销详情、审批列表、审批详情、通知、管理配置、移动端等后续页面整改。
- [ ] 明确 A/B/C 页面分级和优先级,能用于拆分后续 Trellis 实施任务。
- [ ] 明确 OA/企业微信边界,避免请假、补卡、外出、加班等日常 HR/考勤流程在 OA 中重复处理。
- [ ] 明确哪些规则应回写到长期事实源,哪些仅保留为本任务审查建议。
- [ ] 验证计划覆盖文档治理校验,不把“规则梳理”误报为页面已整改或已部署。
## Test Plan
- `python3 ./.trellis/scripts/task.py validate 05-29-page-design-rules-audit`
- `node scripts/qa/check-trellis-governance.mjs`
- `git diff --check`
如果后续按规则改页面,再按具体页面追加 `cd client && npm run typecheck && npm run build`,以及对应 Playwright/视觉截图验证。
## Technical Notes
- 已读取 `.trellis/workflow.md`、`.trellis/spec/hyb-oa/index.md`、`.trellis/spec/hyb-oa/frontend-react-vite-design.md`、`.trellis/spec/hyb-oa/project-governance.md`、`.trellis/spec/hyb-oa/docs-and-evidence.md`、`.trellis/spec/hyb-oa/wecom-boundary.md`、`.trellis/spec/hyb-oa/approval-workflow.md`、`.trellis/spec/hyb-oa/reimbursement-invoice-ocr.md`。
- 已读取 `docs/产品设计规则.md`、`docs/报销发票附件规则.md`、`docs/需求-统一审批中心规约.md`、`docs/文档索引.md`、`docs/文档事实源状态矩阵.md`。
- 已检查路由和导航:`client/src/router/index.tsx`、`client/src/features/navigation/schema.ts`。
- 已抽样检查核心页面、B 类业务页和共享组件:`PortalHomePage.tsx`、`WorkflowTasksPage.tsx`、`WorkflowTaskDetailPage.tsx`、`ReimbursementsPage.tsx`、`ReimbursementDetailPage.tsx`、`PurchaseRequestsPage.tsx`、`AssetRegistryPage.tsx`、`InventoryChecksPage.tsx`、`ContractsRegistryPage.tsx`、`ProjectsPage.tsx`、`ProjectDetailPage.tsx`、`ListWorkspace.tsx`、`PageScaffold.tsx`。
- 行业参考采用官方设计体系作辅助判断:[Ant Design Layout](https://2x.ant.design/docs/spec/layout) 将企业应用常见页面抽象为首页、仪表盘、列表、表格、详情、表单等模板;[Ant Design Button](https://ant.design/docs/spec/buttons-cn/) 强调一个按钮区最多一个主按钮、按钮文案应清楚表达结果、危险动作要提示风险;[Ant Design Detail Page](https://ant.design/docs/spec/detail-page) 强调详情页按信息复杂度分组、审批类详情需要承载审批动作。项目最终规则仍以 hyb-oa 小团队业务边界和 `frontend-design` 裁决为准。
## Open Questions
- Grill-me 决策从“信息架构和一级入口”开始,之后逐项确认页面模板、操作区、状态流、权限、列表、表单、详情、移动、通知、敏感数据、审计和异常处理。
@@ -0,0 +1,31 @@
{
"id": "page-design-rules-audit",
"name": "page-design-rules-audit",
"title": "全页面设计规则梳理",
"description": "梳理 hyb-oa 当前 PC、移动和企业微信入口下所有页面的职责、默认布局、操作层级和后续优化建议,先形成规则地图,不直接改页面代码。",
"status": "in_progress",
"dev_type": null,
"scope": "frontend-docs-governance",
"package": null,
"priority": "P2",
"creator": "shunli",
"assignee": "shunli",
"createdAt": "2026-05-29",
"completedAt": null,
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [
".trellis/tasks/05-29-page-design-rules-audit/prd.md",
".trellis/tasks/05-29-page-design-rules-audit/design.md",
".trellis/spec/hyb-oa/frontend-react-vite-design.md",
"docs/产品设计规则.md"
],
"notes": "",
"meta": {}
}