修正企微主办边界与工作台摘要(portal-task-first-redesign)

这个提交包含在:
2026-05-29 23:30:30 +08:00
父节点 86f887afa5
当前提交 8bd184f0b3
共修改 9 个文件,包含 296 行新增和 264 行删除
@@ -278,8 +278,8 @@ and admin tools available without dominating the default path.
### Convention: Approval Task List Defaults
**What**: PC approval task lists such as `/workflow/tasks` should make
`查看处理` the default row action. List-level `通过` is only a secondary shortcut
for low-risk items where the row itself carries enough decision context.
`查看处理` the default row action. List-level `通过` is disabled by default unless
a later Trellis task adds an explicit backend eligibility contract.
**Contracts**:
@@ -289,17 +289,23 @@ for low-risk items where the row itself carries enough decision context.
`高级 / 历史` on the default task surface.
- Time labels should prefer `已等待多久` and `接收于` over database-shaped labels
such as `更新时间` when the source field is task creation/arrival time.
- A quick `通过` button may appear only when the task is pending, the server
allows `approve`, the item is a low-risk leave/attendance task, required row
summary fields are present, and the task has not exceeded the pending window
available to the frontend. Reimbursement, procurement, travel, contract and
other amount/evidence-heavy tasks should route through `查看处理` first.
- The confirm dialog for list quick approval must still explain action
consequences and include the specific task summary.
- HR/attendance items owned by Enterprise WeChat, including leave, missed
punch, outing, overtime and check-in related approvals, must not show OA
list-level quick approval. OA may show mirror/history/status/exception
context and emergency-takeover records according to the business boundary,
but normal approval remains in Enterprise WeChat.
- Reimbursement, procurement, travel, contract and other amount/evidence-heavy
OA-owned tasks should route through `查看处理` first.
- 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
entity type, duration or row text are not enough.
- If list quick approval is reintroduced later, its confirm dialog must still
explain action consequences and include the specific task summary.
**Why**: Small-team approvers need to clear work quickly without training
themselves to approve financial or evidence-heavy items from an under-specified
row.
**Why**: Small-team approvers should build the habit of opening the task detail
before approval, and the OA/Enterprise WeChat ownership boundary must stay clear
for HR/attendance workflows.
## Convention: Workbench Onboarding And Profile Scope
@@ -4,7 +4,7 @@
- `/workflow/tasks` 默认标题改为 `待我处理`,历史入口文案改为 `已处理记录`。
- PC 主体保留表格密度,但改为任务列表式表格,突出事项、申请人、金额/天数、找我原因、等待时间和业务编号。
- 默认主按钮改为 `查看处理`;`通过` 仅作为低风险次级快捷动作。
- 低风险快捷通过范围保守限定为请假/考勤:请假不超过 1 天、信息完整、任务未超过默认待办时限且服务端允许 approve。
- 默认主按钮改为 `查看处理`;列表页不再提供 `通过` 快捷动作。
- 请假、补卡、外出、加班和打卡属于企业微信主办,OA 待处理列表不按前端实体类型或天数自行开放快捷审批。
- 时间表达从 `更新时间` 改为 `已等待多久` 和 `接收于`。
- 未改后端接口、审批详情页、权限模型、状态机、企业微信、生产部署或真实数据写入。
@@ -140,13 +140,26 @@
- `git diff --check`:通过。
- 截图证据已保存到 `output/playwright/portal-task-first-redesign/portal-employee.png`、`portal-admin.png`、`portal-finance.png`;员工截图已复核并清除了欢迎弹窗遮罩污染。
2026-05-29 企微主办边界复核后完成补充验证:
- `cd client && npm run typecheck`:通过。
- `cd client && npm run build`:通过。
- `cd client && npx playwright test tests/e2e/workflow-action-confirm-ui.spec.ts tests/e2e/workflow-quick-approve.spec.ts --workers=1 --reporter=list`:3 passed。
- `cd client && npx playwright test tests/e2e/login-portal-ux.spec.ts tests/e2e/visual-portal.spec.ts tests/e2e/visual-shell.spec.ts tests/e2e/r102-reimbursement-main-flow.spec.ts --workers=1 --reporter=list`:23 passed。
- `cd client && npx playwright test tests/e2e/pc-core-workflow-visual-wave2.spec.ts --workers=1 --reporter=list`:1 passed。
- 补充自审后重跑 `cd client && npx playwright test tests/e2e/login-portal-ux.spec.ts tests/e2e/visual-portal.spec.ts --workers=1 --reporter=list`:15 passed。
- `python3 ./.trellis/scripts/task.py validate 05-29-portal-task-first-redesign`:通过。
- `node scripts/qa/check-trellis-governance.mjs`:通过。
- `git diff --check`:通过。
## Approved Addendum: 待处理页面任务优先整改
2026-05-29 用户确认对 `/workflow/tasks` 做小范围页面整改,目标是让审批人逐单看详情后谨慎处理,只有低风险事项保留列表页快捷通过。
2026-05-29 用户确认对 `/workflow/tasks` 做小范围页面整改,目标是让审批人逐单看详情后谨慎处理。后续业务边界复核确认:请假、补卡、外出、加班和打卡属于企业微信主办,OA 不提供列表页快捷审批。
- 默认目标:逐单看详情后处理;低风险事项才允许快捷通过。
- 按钮层级:`查看处理` 为主按钮;`通过` 作为次级快捷动作。
- 快捷通过范围:仅 `请假 / 考勤` 小事项;请假不超过 1 天、信息完整、未超时且当前用户有 approve 权限。
- 默认目标:逐单看详情后处理;列表页默认不提供 `通过` 快捷动作。
- 按钮层级:`查看处理` 为主按钮;审批动作进入详情页后执行。
- 企微主办边界:请假、补卡、外出、加班、打卡相关事项只做镜像、历史、审计、异常或应急接管展示,正常审批不在 OA 列表页处理。
- 未来若恢复列表快捷通过,必须由后端显式提供 eligibility 字段和审计语义,不能由前端按实体类型、天数或行文案自行判断。
- 主体形态:保留 PC 表格密度,但改为任务列表式表格,第一列集中展示什么事、为什么找我、等待多久和编号。
- 历史入口:`高级 / 历史` 改为 `已处理记录`;点击后默认进入 `已处理`,历史筛选不混入 `待处理`。
- 时间表达:首屏优先显示 `已等待多久`,绝对接收时间作为次级信息;不再把任务创建时间叫 `更新时间`。