Files
zkxw/docs/superpowers/plans/2026-07-30-oa-owner-fields.md
T

51 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 归属人 / 归属部门 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 表单设计器新增「归属人」「归属部门」,发起时默认当前登录人/主部门,属性「允许修改」默认关闭。
**Architecture:** 新控件类型 `ownerPerson` / `ownerDept` 包装现有人员/部门选择器;发起页注入默认值;后端发布白名单 + 只读强制回填。
**Tech Stack:** Vue 3、FormCreate Designer、FastAPI
**Spec:** `docs/superpowers/specs/2026-07-30-oa-owner-fields-design.md`
---
### Task 1: 前端控件与注册
**Files:**
- Create: `web-admin/src/utils/oa-owner-person-select-rule.ts`
- Create: `web-admin/src/utils/oa-owner-dept-select-rule.ts`
- Create: `web-admin/src/utils/oa-form-create-owner-person.ts`
- Create: `web-admin/src/utils/oa-form-create-owner-dept.ts`
- Create: `web-admin/src/components/oa-approval/OaOwnerPersonSelect.vue`
- Create: `web-admin/src/components/oa-approval/OaOwnerDeptSelect.vue`
- Create: `web-admin/src/utils/oa-owner-field-defaults.ts`
- Modify: `web-admin/src/main.ts`, `web-admin/src/oa-fc-host/main.ts`
- Modify: `web-admin/src/views/oa-approval/start/index.vue`
- Modify: print / condition / related display as needed
- [x] 拖拽规则:label 归属人/归属部门;props.allowModify 默认 false;单选
- [x] 组件:`disabled || !allowModify`;包装 OaPersonSelect / OaDeptSelect
- [x] `applyOwnerFieldDefaults` + 发起页调用
- [x] 注册 setup;打印识别新 type;条件候选含 ownerPerson
### Task 2: 后端白名单与强制回填
**Files:**
- Modify: `backend/app/services/oa_publish.py`
- Modify: `backend/app/services/oa_person_select.py` / `oa_dept_select.py` 或新增 apply
- Modify: `backend/app/services/oa_engine.py` start_instance
- Modify: `backend/app/services/oa_related_approval.py`
- Test: `backend/tests/test_oa_owner_fields.py`
- [x] FILLABLE + CONDITION(ownerPerson)
- [x] 校验 owner* 同单选 person/dept
- [x] allowModify 为假时强制当前用户/部门
- [x] 单测覆盖
### Task 3: 图谱更新
- [x] `./scripts/update-graph.sh frontend`(backend 因节点过多 HTML 失败,服务代码已落地)