提交
This commit is contained in:
1 parent
d08f03ab03
commit
cc843535f5
154 files changed
+17837
-5153
No files matched your search
@@ -0,0 +1,549 @@
|
||||
# 小程序市场专员 / 地区经理存储业务 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:** 在微信小程序中提供市场专员与地区经理两套独立的存储业务入口,由 `mobile-oa-h5` 承载六个业务模块,并由后端对租户、菜单权限、通用数据权限及现场 scope 做全链路强制校验。
|
||||
|
||||
**Architecture:** `mobile-h5` 只负责授权菜单与受控 `web-view`;`mobile-oa-h5` 使用十二个静态入口路由和共享移动业务组件;后端新增 `/api/mini/market/{specialist|manager}` 专用路由和集中 scope 服务。现有 Web CRUD 作为领域能力来源,但移动端通过白名单 DTO/动作调用,禁止直接暴露财务、审核、生产与质检能力。
|
||||
|
||||
**Tech Stack:** FastAPI、SQLAlchemy、Pydantic v2、Pytest、Vue 3、Vue Router、Vant、uni-app、Node `node:test`、MySQL 5.7。
|
||||
|
||||
---
|
||||
|
||||
## 任务地图
|
||||
|
||||
| 任务 | 交付物 | 主要验证 |
|
||||
|---|---|---|
|
||||
| 1 | 严格移动菜单权限与租户化菜单 | `test_market_mobile_permissions.py`、`test_mini_menu.py` |
|
||||
| 2 | 集中 specialist/manager scope 服务 | `test_market_field_scope.py` |
|
||||
| 3 | 预签移动 API | `test_market_presign_api.py` |
|
||||
| 4 | 协议(细胞/科研)移动 API | `test_market_protocol_api.py` |
|
||||
| 5 | 催缴/缴费移动 API | `test_market_payment_api.py` |
|
||||
| 6 | 样本轻量移动 API | `test_market_sample_api.py` |
|
||||
| 7 | 运费脱敏移动 API | `test_market_freight_scope.py` |
|
||||
| 8 | 菜单 SQL 与小程序受控 web-view | Node 测试、`test_mini_menu.py` |
|
||||
| 9 | H5 路由、公共组件与只读页面 | Node 路由测试、Vite build |
|
||||
| 10 | 六模块写页面与动作 | Node 单测、Vite build、API 回归 |
|
||||
| 11 | 全链路回归、知识图谱与总结文档 | Pytest、Node、build、字段一致性、图谱 |
|
||||
|
||||
### Task 1: 严格移动菜单权限与租户化菜单
|
||||
|
||||
**Files:**
|
||||
- Create: `backend/app/core/mobile_menu_guard.py`
|
||||
- Create: `backend/tests/test_market_mobile_permissions.py`
|
||||
- Create: `backend/tests/test_mini_menu.py`
|
||||
- Modify: `backend/app/api/mini_menu.py`
|
||||
- Modify: `backend/app/services/web_auth_roles.py`
|
||||
|
||||
- [x] **Step 1: 写严格权限与租户隔离失败测试**
|
||||
|
||||
```python
|
||||
def test_specialist_permission_does_not_grant_manager_access():
|
||||
assert require_market_menu_permission(
|
||||
user_id="u1", tenant_no="t1", required="mini:market:manager:presign",
|
||||
granted={"mini:market:specialist:presign"},
|
||||
) is False
|
||||
|
||||
def test_mobile_menu_query_uses_current_tenant():
|
||||
items = list_mobile_menu_items(db, user_id="u1", tenant_no="tenant-b")
|
||||
assert {item["id"] for item in items} == {"tenant-b-specialist-presign"}
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试并确认因实现缺失失败**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_mobile_permissions.py tests/test_mini_menu.py -q`
|
||||
|
||||
Expected: FAIL,提示 `mobile_menu_guard` 或租户化参数不存在。
|
||||
|
||||
- [x] **Step 3: 实现严格权限依赖**
|
||||
|
||||
`mobile_menu_guard.py` 提供:
|
||||
|
||||
```python
|
||||
def require_market_menu_code(menu_code: str):
|
||||
async def dependency(user=Depends(get_current_user), db=Depends(get_db)):
|
||||
tenant_no = str(user.get("tenant_no") or "").strip()
|
||||
user_id = str(user.get("user_id") or "").strip()
|
||||
if not tenant_no or not user_id:
|
||||
raise HTTPException(status_code=403, detail="用户租户或身份信息缺失")
|
||||
if user.get("role") != "super_admin" and not user_has_tenant_menu_perm(
|
||||
db, user_id=user_id, tenant_no=tenant_no, perm_code=menu_code
|
||||
):
|
||||
raise HTTPException(status_code=403, detail="无移动端菜单权限")
|
||||
return user
|
||||
return dependency
|
||||
```
|
||||
|
||||
把 `get_effective_role_ids()`、`iter_user_menu_perm_codes()` 扩展为显式接收 `tenant_no`,兼容原调用方但新移动链路禁止回退 `DEFAULT_TENANT_NO`。`mini_menu.py` 从认证结果读取当前租户,并返回直属目录的 `groupTitle`;目录无 path 时不输出。
|
||||
|
||||
- [x] **Step 4: 验证权限、职位继承角色和跨租户菜单**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_mobile_permissions.py tests/test_mini_menu.py tests/test_effective_roles.py -q`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 2: 集中 specialist/manager 现场 scope 服务
|
||||
|
||||
**Files:**
|
||||
- Create: `backend/app/services/market_field_scope.py`
|
||||
- Create: `backend/tests/test_market_field_scope.py`
|
||||
- Modify: `backend/app/core/data_scope.py`(仅在需要提供可组合 predicate 时修改)
|
||||
|
||||
- [x] **Step 1: 写 scope 失败测试**
|
||||
|
||||
覆盖以下最小事实:
|
||||
|
||||
```python
|
||||
def test_specialist_matches_sales_user_only(): ...
|
||||
def test_manager_matches_leader_region_or_document_manager(): ...
|
||||
def test_manager_ignores_non_leader_staff_rows(): ...
|
||||
def test_soft_deleted_or_cross_tenant_region_never_matches(): ...
|
||||
def test_dual_role_contexts_do_not_union_specialist_and_manager_scope(): ...
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_field_scope.py -q`
|
||||
|
||||
Expected: FAIL,服务尚不存在。
|
||||
|
||||
- [x] **Step 3: 实现不可变上下文和查询组合器**
|
||||
|
||||
```python
|
||||
@dataclass(frozen=True)
|
||||
class MarketFieldContext:
|
||||
tenant_no: str
|
||||
user_id: str
|
||||
scope_kind: Literal["specialist", "manager"]
|
||||
|
||||
def leader_region_ids_query(db: Session, ctx: MarketFieldContext): ...
|
||||
def apply_presign_scope(query, db: Session, ctx: MarketFieldContext): ...
|
||||
def apply_cell_protocol_scope(query, db: Session, ctx: MarketFieldContext): ...
|
||||
def apply_donation_scope(query, db: Session, ctx: MarketFieldContext): ...
|
||||
def assert_presign_access(...): ...
|
||||
def assert_cell_protocol_access(...): ...
|
||||
def assert_donation_access(...): ...
|
||||
```
|
||||
|
||||
所有 predicate 必须包含 `tenant_no` 与 `del_flag=0`;manager 条件必须是 `leader region OR region_manager_user_id=current user`。服务同时提供将通用 `apply_data_scope()` 与现场 scope 组合的入口。
|
||||
|
||||
- [x] **Step 4: 验证 scope 单测**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_field_scope.py tests/test_basic_info_tenant_ownership.py -q`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 3: 预签移动 API
|
||||
|
||||
**Files:**
|
||||
- Create: `backend/app/api/market_mobile.py`
|
||||
- Create: `backend/app/schemas/market_mobile.py`
|
||||
- Create: `backend/app/services/market_presign.py`
|
||||
- Create: `backend/tests/test_market_presign_api.py`
|
||||
- Modify: `backend/app/api/__init__.py`
|
||||
- Modify: `backend/app/main.py`
|
||||
- Reuse: `backend/app/crud/presign_order.py`
|
||||
|
||||
- [x] **Step 1: 写列表、详情和 IDOR 失败测试**
|
||||
|
||||
```python
|
||||
def test_specialist_presign_list_only_returns_own_sales_orders(): ...
|
||||
def test_manager_presign_list_uses_region_or_manager_union(): ...
|
||||
def test_presign_detail_rejects_guessed_out_of_scope_id(): ...
|
||||
def test_specialist_create_forces_current_sales_user(): ...
|
||||
def test_update_rejects_resulting_assignment_outside_scope(): ...
|
||||
def test_convert_rechecks_scope_and_keeps_expected_staff_mapping(): ...
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_presign_api.py -q`
|
||||
|
||||
Expected: FAIL,移动路由不存在。
|
||||
|
||||
- [x] **Step 3: 实现两套固定路由和白名单 DTO**
|
||||
|
||||
路由形态:
|
||||
|
||||
```text
|
||||
GET/POST /api/mini/market/specialist/presign-orders
|
||||
GET/PUT /api/mini/market/specialist/presign-orders/{id}
|
||||
POST /api/mini/market/specialist/presign-orders/{id}/convert
|
||||
GET/POST /api/mini/market/manager/presign-orders
|
||||
GET/PUT /api/mini/market/manager/presign-orders/{id}
|
||||
POST /api/mini/market/manager/presign-orders/{id}/convert
|
||||
```
|
||||
|
||||
共享 handler 只接收由路由闭包注入的 scope。专员创建强制 `sales_user_id=current user`;经理创建/修改后的 `region_id/region_manager_user_id` 必须仍命中 manager scope。状态只读,不开放删除和财务确认动作。
|
||||
|
||||
- [x] **Step 4: 验证预签与既有回归**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_presign_api.py tests/test_presign_order.py -q`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 4: 协议(细胞存储 / 科研捐赠)移动 API
|
||||
|
||||
**Files:**
|
||||
- Create: `backend/app/services/market_protocol.py`
|
||||
- Create: `backend/tests/test_market_protocol_api.py`
|
||||
- Modify: `backend/app/api/market_mobile.py`
|
||||
- Modify: `backend/app/schemas/market_mobile.py`
|
||||
- Reuse: `backend/app/crud/collection_protocol.py`
|
||||
- Reuse: `backend/app/crud/research_donation.py`
|
||||
|
||||
- [x] **Step 1: 写双来源列表、详情、创建更新失败测试**
|
||||
|
||||
```python
|
||||
def test_protocol_list_combines_cell_and_donation_without_scope_leak(): ...
|
||||
def test_cell_protocol_detail_rechecks_specialist_scope(): ...
|
||||
def test_donation_detail_rechecks_manager_scope(): ...
|
||||
def test_specialist_create_forces_sales_user_in_collection_info(): ...
|
||||
def test_manager_update_cannot_move_document_out_of_scope(): ...
|
||||
def test_mobile_protocol_api_does_not_expose_audit_void_refund_or_conversion(): ...
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_protocol_api.py -q`
|
||||
|
||||
Expected: FAIL,协议移动服务不存在。
|
||||
|
||||
- [x] **Step 3: 实现统一移动 DTO 与两来源适配器**
|
||||
|
||||
提供 `source=cell_storage|research_donation`,但 scope 固定由路由决定。列表返回移动卡片字段;详情返回基本、采集、客户、样本、缴费(仅细胞)、附件分区。写入只允许设计内字段;拒绝 `auditStatus/protocolStatus/delFlag/refund/finance*` 等越权字段。专员采集信息强制当前用户,经理写入结果须仍在 manager scope。
|
||||
|
||||
- [x] **Step 4: 验证协议回归**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_protocol_api.py tests/test_collection_protocol_save_bundle.py tests/test_collection_protocol_conventions.py -q`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 5: 催缴与缴费移动 API
|
||||
|
||||
**Files:**
|
||||
- Create: `backend/app/services/market_payment.py`
|
||||
- Create: `backend/tests/test_market_payment_api.py`
|
||||
- Modify: `backend/app/api/market_mobile.py`
|
||||
- Modify: `backend/app/schemas/market_mobile.py`
|
||||
- Reuse: `backend/app/crud/protocol_sample_payment.py`
|
||||
- Reuse: `backend/app/services/payment_chase.py`
|
||||
|
||||
- [x] **Step 1: 写催缴/缴费范围与动作白名单失败测试**
|
||||
|
||||
```python
|
||||
def test_chase_is_overdue_union_next_30_days_with_parent_scope(): ...
|
||||
def test_client_sales_user_filter_cannot_expand_scope(): ...
|
||||
def test_payment_detail_rejects_out_of_scope_sample(): ...
|
||||
def test_market_can_save_submit_and_withdraw_transfer(): ...
|
||||
def test_market_cannot_confirm_reject_invoice_or_refund(): ...
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_payment_api.py -q`
|
||||
|
||||
Expected: FAIL。
|
||||
|
||||
- [x] **Step 3: 实现父协议 scope 下的有限缴费动作**
|
||||
|
||||
催缴只提供查询与跳转标识,不创建“催缴编辑实体”。缴费允许查看、登记转账草稿、提交财务确认、确认中撤回;财务确认/拒绝、退款确认和开票路由不存在。任何 `salesUserId/fieldScope/tenantNo` 客户端参数不得改变授权范围。
|
||||
|
||||
- [x] **Step 4: 验证缴费回归**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_payment_api.py tests/test_payment_chase.py tests/test_protocol_sample_payment.py tests/test_payment_transfer_delete.py -q`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 6: 样本轻量移动 API
|
||||
|
||||
**Files:**
|
||||
- Create: `backend/app/services/market_sample.py`
|
||||
- Create: `backend/tests/test_market_sample_api.py`
|
||||
- Modify: `backend/app/api/market_mobile.py`
|
||||
- Modify: `backend/app/schemas/market_mobile.py`
|
||||
- Reuse: `backend/app/crud/protocol_sample_collection.py`
|
||||
- Reuse: `backend/app/crud/research_donation_sample_collection.py`
|
||||
- Reuse: `backend/app/services/sample_info_list_enrich.py`
|
||||
|
||||
- [x] **Step 1: 写双来源样本与字段白名单失败测试**
|
||||
|
||||
```python
|
||||
def test_sample_list_resolves_parent_and_applies_field_scope(): ...
|
||||
def test_sample_detail_uses_tenant_and_sample_code_for_downstream_match(): ...
|
||||
def test_lightweight_update_accepts_market_fields_only(): ...
|
||||
def test_lightweight_update_rejects_qc_production_lab_code_and_status(): ...
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_sample_api.py -q`
|
||||
|
||||
Expected: FAIL。
|
||||
|
||||
- [x] **Step 3: 实现只读进度与轻量办理白名单**
|
||||
|
||||
列表/详情统一返回细胞与科研来源、样本编码、采集/接收/质检/入库进度。跨表匹配遵循 `tenant_no + sample_code`。写 DTO 只开放市场侧时间、人员、附件和备注等已确认轻量字段;禁止修改质检结论、生产结果、实验室码和样本状态。
|
||||
|
||||
- [x] **Step 4: 验证样本回归**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_sample_api.py tests/test_sample_info_progress.py tests/test_sample_info_handle.py -q`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 7: 运费批次可见性、明细脱敏与写校验
|
||||
|
||||
**Files:**
|
||||
- Create: `backend/app/services/market_freight.py`
|
||||
- Create: `backend/tests/test_market_freight_scope.py`
|
||||
- Modify: `backend/app/api/market_mobile.py`
|
||||
- Modify: `backend/app/schemas/market_mobile.py`
|
||||
- Reuse: `backend/app/crud/sample_freight.py`
|
||||
|
||||
- [x] **Step 1: 写混合批次隐私失败测试**
|
||||
|
||||
```python
|
||||
def test_specialist_sees_batch_when_own_item_exists_but_only_own_items(): ...
|
||||
def test_specialist_response_omits_total_linked_sample_count(): ...
|
||||
def test_keyword_matching_other_specialist_item_does_not_reveal_batch(): ...
|
||||
def test_specialist_cannot_link_or_unlink_other_users_sample(): ...
|
||||
def test_specialist_cannot_update_shared_batch_header(): ...
|
||||
def test_manager_sees_only_manager_scope_items_with_full_fields(): ...
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_freight_scope.py -q`
|
||||
|
||||
Expected: FAIL。
|
||||
|
||||
- [x] **Step 3: 实现 SQL 层过滤和有限写能力**
|
||||
|
||||
专员批次存在性由“至少一个自己可见明细”决定;详情 SQL 只加载本人明细;响应使用 `visibleItemCount`,不返回全批次 `linkedSampleCount`。专员可新建、关联、解绑自己样本,但不可更新共享批次头。经理仅可查看和维护 manager scope 内明细;批次中其他地区明细不可泄露。
|
||||
|
||||
- [x] **Step 4: 验证运费与现有 CRUD 回归**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_freight_scope.py tests/test_sample_freight.py -q`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 8: 菜单 SQL 与小程序受控市场 web-view
|
||||
|
||||
**Files:**
|
||||
- Create: `docs/sql/migrations/2026-10-10-market-mobile-menus.sql`
|
||||
- Create: `mobile-h5/utils/market-h5.js`
|
||||
- Create: `mobile-h5/utils/market-h5.test.js`
|
||||
- Create: `mobile-h5/pages/market/webview/index.vue`
|
||||
- Modify: `mobile-h5/pages.json`
|
||||
- Modify: `mobile-h5/utils/menu.js`
|
||||
- Modify: `mobile-h5/components/MenuGrid.vue`
|
||||
- Modify: `mobile-h5/styles/components/menu-grid.scss`
|
||||
- Modify: `mobile-h5/utils/oa-navigate-back.js`
|
||||
|
||||
- [x] **Step 1: 写十二入口白名单与 icon 失败测试**
|
||||
|
||||
```js
|
||||
assert.equal(resolveMarketEntry('specialist-presign').path, '/market/specialist/presign')
|
||||
assert.equal(resolveMarketEntry('manager-freight').path, '/market/manager/freight')
|
||||
assert.equal(resolveMarketEntry('https://evil.example'), null)
|
||||
assert.equal(resolveMarketEntry('../manager/freight'), null)
|
||||
assert.equal(normalizeMenu({ icon: '' }).icon, '')
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd mobile-h5 && node --test utils/market-h5.test.js`
|
||||
|
||||
Expected: FAIL,模块不存在。
|
||||
|
||||
- [x] **Step 3: 实现固定 entry 映射和 web-view**
|
||||
|
||||
`market-h5.js` 只导出十二个固定 entry,使用 `OA_H5_ORIGIN`、token 与验证后的 `returnPath` 构造 URL。web-view 不接受任意 URL;无 token 走 `silentWechatLogin`;未知 entry 提示后返回首页。菜单保留显式空 icon,宫格不渲染 `VanIcon`,显示 `groupTitle` 角色标签。
|
||||
|
||||
SQL 使用幂等 `INSERT ... SELECT ... WHERE NOT EXISTS`,目录 path 为空,叶子 path 为固定 `entry`,权限码分别为 `mini:market:{role}:{module}`。菜单属于系统种子 DML;本仓库全量业务表基线不包含 `sys_*` 种子,因此只维护迁移脚本,不向 `docs/sql/zkxw.sql` 追加孤立菜单记录。
|
||||
|
||||
- [x] **Step 4: 验证 Node、菜单 API 与 SQL 静态检查**
|
||||
|
||||
Run: `cd mobile-h5 && node --test utils/market-h5.test.js utils/oa-corner-index.test.js`
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_mini_menu.py -q`
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest tests/test_market_mobile_menu_sql.py -q`
|
||||
|
||||
Expected: 测试 PASS,SQL 中十二个叶子权限码全部存在。
|
||||
|
||||
### Task 9: H5 十二路由、公共组件与只读页面
|
||||
|
||||
**Files:**
|
||||
- Create: `mobile-oa-h5/src/market/routes.js`
|
||||
- Create: `mobile-oa-h5/src/market/routes.test.js`
|
||||
- Create: `mobile-oa-h5/src/api/market.js`
|
||||
- Create: `mobile-oa-h5/src/market/components/MarketPageShell.vue`
|
||||
- Create: `mobile-oa-h5/src/market/components/MarketListCard.vue`
|
||||
- Create: `mobile-oa-h5/src/market/components/MarketDetailSection.vue`
|
||||
- Create: `mobile-oa-h5/src/market/components/MarketBottomBar.vue`
|
||||
- Create: `mobile-oa-h5/src/views/market/MarketModuleList.vue`
|
||||
- Create: `mobile-oa-h5/src/views/market/MarketModuleDetail.vue`
|
||||
- Create: `mobile-oa-h5/src/styles/market.css`
|
||||
- Modify: `mobile-oa-h5/src/router.js`
|
||||
- Modify: `mobile-oa-h5/src/main.js`
|
||||
|
||||
- [x] **Step 1: 写十二静态入口与 scope 不串失败测试**
|
||||
|
||||
```js
|
||||
assert.equal(routes.length, 12)
|
||||
assert.equal(find('/market/specialist/presign').meta.marketRole, 'specialist')
|
||||
assert.equal(find('/market/manager/presign').meta.marketRole, 'manager')
|
||||
assert.deepEqual(new Set(routes.map((r) => r.meta.module)),
|
||||
new Set(['presign', 'protocol', 'payment-chase', 'payment', 'sample', 'freight']))
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd mobile-oa-h5 && node --test src/market/routes.test.js`
|
||||
|
||||
Expected: FAIL。
|
||||
|
||||
- [x] **Step 3: 实现公共移动列表与详情骨架**
|
||||
|
||||
路由 meta 固定角色和模块,API 路径从 meta 映射,不读取 query 中的 scope。列表支持搜索、筛选、分页、加载/空/错误态;详情使用分区卡片和状态 Tag;底栏仅呈现后端返回的 `allowedActions`。市场样式局部使用三墙主色 `#0a9f6d`,不修改 OA 全局 token,也不引入 web-admin Fresh Mint 主色。
|
||||
|
||||
- [x] **Step 4: 验证路由和生产构建**
|
||||
|
||||
Run: `cd mobile-oa-h5 && node --test src/market/routes.test.js`
|
||||
|
||||
Run: `cd mobile-oa-h5 && npm run build`
|
||||
|
||||
Expected: PASS,Vite build exit 0。
|
||||
|
||||
### Task 10: 六模块表单与有限业务动作
|
||||
|
||||
**Files:**
|
||||
- Create: `mobile-oa-h5/src/views/market/MarketModuleForm.vue`
|
||||
- Create: `mobile-oa-h5/src/market/modules/presign.js`
|
||||
- Create: `mobile-oa-h5/src/market/modules/protocol.js`
|
||||
- Create: `mobile-oa-h5/src/market/modules/payment-chase.js`
|
||||
- Create: `mobile-oa-h5/src/market/modules/payment.js`
|
||||
- Create: `mobile-oa-h5/src/market/modules/sample.js`
|
||||
- Create: `mobile-oa-h5/src/market/modules/freight.js`
|
||||
- Create: `mobile-oa-h5/src/market/module-actions.test.js`
|
||||
- Modify: `mobile-oa-h5/src/market/routes.js`
|
||||
- Modify: `mobile-oa-h5/src/api/market.js`
|
||||
|
||||
- [x] **Step 1: 写每模块动作白名单失败测试**
|
||||
|
||||
```js
|
||||
assert.deepEqual(actions('payment'), ['view', 'register-transfer', 'submit-finance', 'withdraw'])
|
||||
assert.equal(actions('payment').includes('finance-confirm'), false)
|
||||
assert.equal(actions('protocol').includes('audit'), false)
|
||||
assert.equal(actions('sample').includes('qc-conclusion'), false)
|
||||
assert.equal(actions('freight', 'specialist').includes('edit-shared-header'), false)
|
||||
```
|
||||
|
||||
- [x] **Step 2: 运行测试确认 RED**
|
||||
|
||||
Run: `cd mobile-oa-h5 && node --test src/market/module-actions.test.js`
|
||||
|
||||
Expected: FAIL。
|
||||
|
||||
- [x] **Step 3: 实现模块配置和单列移动表单**
|
||||
|
||||
预签:分区表单、意向金子卡、转正式。协议:细胞/科研 Tab,采集→客户→样本→缴费(仅细胞)→附件/确认。催缴:只读卡片并跳登记缴费。缴费:应缴期与转账登记表单。样本:进度详情与轻量办理白名单。运费:批次卡片、可见样本选择、关联/解绑;经理显示后端允许的批次头编辑。
|
||||
|
||||
所有按钮防重复提交;附件立即上传;提交中禁用;长表单返回前提示未保存;后端 401 提示返回小程序重新登录,403/404 使用不泄露对象存在性的文案。
|
||||
|
||||
- [x] **Step 4: 验证动作和构建**
|
||||
|
||||
Run: `cd mobile-oa-h5 && node --test src/market/module-actions.test.js src/market/routes.test.js`
|
||||
|
||||
Run: `cd mobile-oa-h5 && npm run build`
|
||||
|
||||
Expected: PASS。
|
||||
|
||||
### Task 11: 全链路回归、字段一致性、知识图谱与总结
|
||||
|
||||
**Files:**
|
||||
- Create: `docs/superpowers/specs/2026-10-10-market-miniapp-role-features-implementation-summary.md`
|
||||
- Modify: `docs/superpowers/plans/2026-10-10-market-miniapp-role-features.md`(勾选完成项并记录实测命令)
|
||||
- Generated: `backend/graphify-out/*`
|
||||
|
||||
- [x] **Step 1: 后端定向回归**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
PYTHONPATH=. venv/bin/python -m pytest \
|
||||
tests/test_market_mobile_permissions.py \
|
||||
tests/test_mini_menu.py \
|
||||
tests/test_market_field_scope.py \
|
||||
tests/test_market_presign_api.py \
|
||||
tests/test_market_protocol_api.py \
|
||||
tests/test_market_payment_api.py \
|
||||
tests/test_market_sample_api.py \
|
||||
tests/test_market_freight_scope.py -q
|
||||
```
|
||||
|
||||
Expected: 全部 PASS。
|
||||
|
||||
2026-10-11 实测:计划内 8 个市场测试文件 `215 passed`;另补 3 个 SQL 测试文件 `11 passed`。
|
||||
|
||||
- [x] **Step 2: 后端全量测试与字段一致性**
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python -m pytest -q`
|
||||
|
||||
Run: `cd backend && PYTHONPATH=. venv/bin/python scripts/check_field_consistency.py`
|
||||
|
||||
Expected: exit 0;若存在与本任务无关的基线失败,在总结中逐项记录,不得宣称全量通过。
|
||||
|
||||
2026-10-11 最终实测:全量 `912 passed, 4 failed`,4 项均为已确认既有基线;字段一致性 `0 errors, 5 warnings`,脚本 exit 1,且不覆盖本次 market DTO。详见实现总结。
|
||||
|
||||
- [x] **Step 3: 移动端测试与构建**
|
||||
|
||||
Run: `cd mobile-h5 && node --test utils/*.test.js utils/*.test.mjs`
|
||||
|
||||
Run: `cd mobile-oa-h5 && node --test $(find src -name '*.test.js' -print)`
|
||||
|
||||
Run: `cd mobile-oa-h5 && npm run build`
|
||||
|
||||
Expected: 全部 exit 0。
|
||||
|
||||
2026-10-11 最终实测:`mobile-h5 5/5 passed`;`mobile-oa-h5 62/62 passed`;Vite 构建 exit 0,仅有既有大 chunk 警告。
|
||||
|
||||
- [ ] **Step 4: 手工验收矩阵**
|
||||
|
||||
2026-10-11:未执行真实浏览器多视口、微信开发者工具和真实账号/MinIO 联调;自动路由、入口白名单、测试与构建已通过。该步骤保留待测试环境手工验收,不宣称通过。
|
||||
|
||||
在 375px、390px、430px 视口以及微信开发者工具中验证:
|
||||
|
||||
1. 只授权专员时只出现专员六项;只授权经理时反之;兼岗两组可辨。
|
||||
2. 十二入口均进入 `mobile-oa-h5`,未知 entry 无法打开任意 URL。
|
||||
3. 专员与经理列表、详情、编辑 scope 不串;猜测 ID 返回 404/403。
|
||||
4. 细胞/科研协议表单字段分流正确;催缴不出现虚假“编辑催缴”。
|
||||
5. 缴费无财务确认/开票/退款动作;样本无质检/生产动作。
|
||||
6. 混合运费批次不泄露他人明细或总数量;专员不能改共享批次头。
|
||||
7. 键盘、安全区、固定底栏、返回宿主、token 失效处理正常。
|
||||
|
||||
- [x] **Step 5: 更新代码知识图谱**
|
||||
|
||||
Run: `./scripts/update-graph.sh backend`
|
||||
|
||||
Expected: backend 图谱生成成功;本任务未修改 `web-admin`,无需更新 frontend 图谱。
|
||||
|
||||
2026-10-11 实测:exit 0,最终图谱为 `6122 nodes / 33427 edges / 40 communities`。
|
||||
|
||||
- [x] **Step 6: 写实现总结**
|
||||
|
||||
总结文档必须包含:架构与安全边界、菜单与路由清单、六模块实际开放动作、scope 规则、运费脱敏、SQL 迁移步骤、部署/回滚、自动测试结果、手工验收结果、已知限制与后续 icon 任务。不得使用 TBD/TODO。
|
||||
|
||||
2026-10-11 已生成 `docs/superpowers/specs/2026-10-10-market-miniapp-role-features-implementation-summary.md`。
|
||||
|
||||
## 实施约束
|
||||
|
||||
- 所有生产代码遵循 RED → GREEN → REFACTOR;未观察到目标测试失败前不得写实现。
|
||||
- 子代理每次只负责一个任务域;完成后先做规格符合性审查,再做代码质量审查。
|
||||
- 不修改或提交当前工作区中与本任务无关的未跟踪文件。
|
||||
- 不直接放宽全局 `require_menu_code()`;移动市场权限使用专用严格守卫。
|
||||
- 不信任客户端的 tenant、scope、sales/manager 身份覆盖字段。
|
||||
- 不把桌面 Element Plus 页面复制进移动 H5。
|
||||
- 新增/修改后端文件、函数签名或 import 后必须执行 `./scripts/update-graph.sh backend`。
|
||||
@@ -0,0 +1,273 @@
|
||||
# Market Attachment Parity 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:** Remove the floating round back button from every market detail page and render market attachments with the workflow-standard thumbnail, file-icon, download, and editable-delete experience.
|
||||
|
||||
**Architecture:** Add a pure attachment normalizer and one shared market attachment-card component. Form fields and presign uploads retain their current upload APIs but delegate display, preview, download, and remove interactions to the shared component; detail adapters expose typed attachment fields consumed by `MarketDetailSection.vue`.
|
||||
|
||||
**Tech Stack:** Vue 3 Composition API, Vant 4, native Node test runner, Vite 6.
|
||||
|
||||
---
|
||||
|
||||
## File map
|
||||
|
||||
- Create `mobile-oa-h5/src/market/attachment-presenter.js`: normalize supported attachment shapes, derive safe display names, image classification, and workflow file kinds.
|
||||
- Create `mobile-oa-h5/src/market/attachment-presenter.test.js`: unit coverage for strings, arrays, object metadata, image detection, and file kinds.
|
||||
- Create `mobile-oa-h5/src/market/components/MarketAttachmentCards.vue`: workflow-standard 84×84 rendering, upload trigger, image preview, file download, and editable remove event.
|
||||
- Modify `mobile-oa-h5/src/market/components/MarketFormField.vue`: replace raw URL anchors with the shared component while preserving comma-separated form values.
|
||||
- Modify `mobile-oa-h5/src/market/components/PresignAttachmentUploader.vue`: reuse the shared renderer and preserve existing upload/remove events.
|
||||
- Modify `mobile-oa-h5/src/market/components/MarketDetailSection.vue`: support `type: 'attachments'` in top-level and nested detail fields.
|
||||
- Modify `mobile-oa-h5/src/market/modules/protocol.js`: expose protocol attachment values as typed attachments instead of joined path text.
|
||||
- Modify `mobile-oa-h5/src/market/modules/payment.js`: expose transfer vouchers as typed attachments.
|
||||
- Modify `mobile-oa-h5/src/market/modules/sample.js`: expose handling attachments as typed attachments.
|
||||
- Modify `mobile-oa-h5/src/market/modules/presign.js`: expose presign transfer attachments as typed attachments.
|
||||
- Modify `mobile-oa-h5/src/views/market/MarketModuleDetail.vue`: disable the detail-page back control.
|
||||
- Modify `mobile-oa-h5/src/market/mobile-parity-ui.test.js`: lock the visual and detail attachment contracts.
|
||||
- Modify `mobile-oa-h5/src/market/module-contracts.test.js`: lock typed attachment fields across adapters.
|
||||
|
||||
### Task 1: Pure attachment normalization
|
||||
|
||||
**Files:**
|
||||
- Create: `mobile-oa-h5/src/market/attachment-presenter.js`
|
||||
- Create: `mobile-oa-h5/src/market/attachment-presenter.test.js`
|
||||
|
||||
- [ ] **Step 1: Write failing unit tests**
|
||||
|
||||
Cover these public functions:
|
||||
|
||||
```js
|
||||
normalizeMarketAttachments('https://cdn/a%20b.pdf,https://cdn/photo.png')
|
||||
// => [{ url: '...', name: 'a b.pdf', isImage: false, kind: 'pdf' }, ...]
|
||||
|
||||
normalizeMarketAttachments([
|
||||
{ fileUrl: '/minio/x/report.xlsx', fileName: '费用明细.xlsx' }
|
||||
])
|
||||
// preserves fileName and raw URL
|
||||
|
||||
marketAttachmentKind('archive.zip') // => 'zip'
|
||||
isMarketAttachmentImage({ name: 'photo.webp' }) // => true
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Run the focused test and verify RED**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5
|
||||
node --test src/market/attachment-presenter.test.js
|
||||
```
|
||||
|
||||
Expected: FAIL because `attachment-presenter.js` does not exist.
|
||||
|
||||
- [ ] **Step 3: Implement the minimal pure utility**
|
||||
|
||||
Implement safe URL decoding, comma splitting, array/object normalization, these image extensions:
|
||||
|
||||
```js
|
||||
const IMAGE_RE = /\.(?:jpe?g|png|gif|bmp|webp|svg|jfif|avif|heic|heif)(?:\?|$)/i
|
||||
```
|
||||
|
||||
and these file kinds:
|
||||
|
||||
```js
|
||||
pdf: pdf
|
||||
xls: xls, xlsx, csv
|
||||
doc: doc, docx, ppt, pptx
|
||||
zip: zip, rar, 7z
|
||||
other: every remaining file
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Run the focused test and verify GREEN**
|
||||
|
||||
Run the command from Step 2. Expected: all tests pass.
|
||||
|
||||
### Task 2: Shared workflow-standard attachment cards
|
||||
|
||||
**Files:**
|
||||
- Create: `mobile-oa-h5/src/market/components/MarketAttachmentCards.vue`
|
||||
- Modify: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`
|
||||
|
||||
- [ ] **Step 1: Write failing component-contract assertions**
|
||||
|
||||
Assert the component contains:
|
||||
|
||||
```js
|
||||
assert.match(source, /normalizeMarketAttachments/)
|
||||
assert.match(source, /downloadAttachmentFile/)
|
||||
assert.match(source, /showImagePreview/)
|
||||
assert.match(source, /market-attachment-card__delete/)
|
||||
assert.match(source, /@error=/)
|
||||
assert.match(source, /84px/)
|
||||
```
|
||||
|
||||
Also assert file-icon kinds `ft-pdf`, `ft-xls`, `ft-doc`, `ft-zip`, and `ft-other` exist.
|
||||
|
||||
- [ ] **Step 2: Run the contract test and verify RED**
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5
|
||||
node --test src/market/mobile-parity-ui.test.js
|
||||
```
|
||||
|
||||
Expected: FAIL because the component does not exist.
|
||||
|
||||
- [ ] **Step 3: Implement the shared component**
|
||||
|
||||
Required props and events:
|
||||
|
||||
```js
|
||||
defineProps({
|
||||
modelValue: { type: [Array, String, Object], default: '' },
|
||||
editable: { type: Boolean, default: false },
|
||||
uploading: { type: Boolean, default: false },
|
||||
maxSize: { type: Number, default: MARKET_ATTACHMENT_MAX_BYTES },
|
||||
accept: { type: String, default: MARKET_ATTACHMENT_ACCEPT }
|
||||
})
|
||||
defineEmits(['upload', 'remove'])
|
||||
```
|
||||
|
||||
Use `van-uploader` for the first add card. Match backend validation: 10 MiB by default, 20 MiB for presign, and only JPG/JPEG, PNG, WebP, HEIC/HEIF, PDF, DOC/DOCX, XLS/XLSX. Use image preview through `showImagePreview`, and non-image download through `downloadAttachmentFile`. Image `error` changes that card to the `other` file icon. Copy the approved 84×84 workflow styling and keep a visually small delete button with an unclipped 44×44px interactive hit area. When a name was inferred from a URL, omit `fileName` from the download request so the backend restores the stored original name.
|
||||
|
||||
- [ ] **Step 4: Run the contract test and verify GREEN**
|
||||
|
||||
Run the command from Step 2. Expected: all assertions pass.
|
||||
|
||||
### Task 3: Form integration and editable deletion
|
||||
|
||||
**Files:**
|
||||
- Modify: `mobile-oa-h5/src/market/components/MarketFormField.vue`
|
||||
- Modify: `mobile-oa-h5/src/market/components/PresignAttachmentUploader.vue`
|
||||
- Modify: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`
|
||||
|
||||
- [ ] **Step 1: Add failing integration contracts**
|
||||
|
||||
Assert both form components import and render `MarketAttachmentCards`. Assert `MarketFormField.vue` updates a comma-separated URL list on remove, and `PresignAttachmentUploader.vue` forwards `upload` and `remove` events.
|
||||
|
||||
- [ ] **Step 2: Run the focused test and verify RED**
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5
|
||||
node --test src/market/mobile-parity-ui.test.js
|
||||
```
|
||||
|
||||
Expected: FAIL because both components still use their separate raw-card implementations.
|
||||
|
||||
- [ ] **Step 3: Integrate the shared component**
|
||||
|
||||
For generic fields:
|
||||
|
||||
```vue
|
||||
<MarketAttachmentCards
|
||||
:model-value="modelValue"
|
||||
:editable="!disabled && !field.readOnly"
|
||||
:uploading="uploading"
|
||||
@upload="$emit('upload', $event)"
|
||||
@remove="removeAttachment"
|
||||
/>
|
||||
```
|
||||
|
||||
`removeAttachment(index)` must normalize the current value, remove the selected item, then emit a comma-separated URL string. For presign attachments, preserve the current array value and existing parent-owned `remove(index)` behavior.
|
||||
|
||||
- [ ] **Step 4: Run the focused test and verify GREEN**
|
||||
|
||||
Run the command from Step 2. Expected: all assertions pass.
|
||||
|
||||
### Task 4: Read-only detail attachments and back-button removal
|
||||
|
||||
**Files:**
|
||||
- Modify: `mobile-oa-h5/src/market/components/MarketDetailSection.vue`
|
||||
- Modify: `mobile-oa-h5/src/market/modules/protocol.js`
|
||||
- Modify: `mobile-oa-h5/src/market/modules/payment.js`
|
||||
- Modify: `mobile-oa-h5/src/market/modules/sample.js`
|
||||
- Modify: `mobile-oa-h5/src/market/modules/presign.js`
|
||||
- Modify: `mobile-oa-h5/src/views/market/MarketModuleDetail.vue`
|
||||
- Modify: `mobile-oa-h5/src/market/module-contracts.test.js`
|
||||
- Modify: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`
|
||||
|
||||
- [ ] **Step 1: Write failing detail contracts**
|
||||
|
||||
Assert:
|
||||
|
||||
```js
|
||||
assert.match(detailView, /:backable="false"/)
|
||||
assert.doesNotMatch(detailView, /@back="backToList"/)
|
||||
```
|
||||
|
||||
For each adapter, build representative details and verify every attachment-bearing field uses:
|
||||
|
||||
```js
|
||||
{ label: '...', type: 'attachments', value: originalAttachmentValue }
|
||||
```
|
||||
|
||||
Also assert `MarketDetailSection.vue` renders `MarketAttachmentCards` with `:editable="false"` for top-level, nested, and subcard fields.
|
||||
|
||||
- [ ] **Step 2: Run both focused tests and verify RED**
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5
|
||||
node --test src/market/mobile-parity-ui.test.js src/market/module-contracts.test.js
|
||||
```
|
||||
|
||||
Expected: FAIL because detail fields still display attachment paths and the detail view still enables the floating back button.
|
||||
|
||||
- [ ] **Step 3: Implement typed attachment detail fields**
|
||||
|
||||
Preserve the original attachment value in every adapter and add `type: 'attachments'`. Extend `normalizeCard()` and top-level field normalization in `MarketDetailSection.vue` to retain the type. Render the shared component when the type matches, otherwise keep the existing tag/text behavior.
|
||||
|
||||
Change the detail shell to:
|
||||
|
||||
```vue
|
||||
<MarketPageShell
|
||||
:title="moduleTitle"
|
||||
:eyebrow="`${roleTitle} · 详情`"
|
||||
:show-header="false"
|
||||
:backable="false"
|
||||
:has-bottom-bar="allowedActions.length > 0"
|
||||
>
|
||||
```
|
||||
|
||||
Remove the now-unused `backToList` handler only if no other code path calls it; otherwise retain the handler but remove the template listener.
|
||||
|
||||
- [ ] **Step 4: Run focused tests and verify GREEN**
|
||||
|
||||
Run the command from Step 2. Expected: all assertions pass.
|
||||
|
||||
### Task 5: Full verification and graph impact check
|
||||
|
||||
**Files:**
|
||||
- Verify all modified files above.
|
||||
|
||||
- [ ] **Step 1: Run all mobile Node tests**
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5
|
||||
node --test $(rg --files src | rg '\.test\.js$')
|
||||
```
|
||||
|
||||
Expected: zero failures.
|
||||
|
||||
- [ ] **Step 2: Run the production build**
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5
|
||||
pnpm build
|
||||
```
|
||||
|
||||
Expected: Vite build exits with code 0.
|
||||
|
||||
- [ ] **Step 3: Check formatting and unintended whitespace**
|
||||
|
||||
```bash
|
||||
git diff --check
|
||||
```
|
||||
|
||||
Expected: no output and exit code 0.
|
||||
|
||||
- [ ] **Step 4: Inspect the final diff against the design**
|
||||
|
||||
Verify all acceptance criteria from `docs/superpowers/specs/2026-10-11-market-attachment-parity-design.md`, especially that no raw attachment path is rendered in the four attachment-bearing detail adapters.
|
||||
|
||||
- [ ] **Step 5: Skip knowledge-graph regeneration**
|
||||
|
||||
This change modifies Vue templates, local CSS, and pure presentation helpers without changing function signatures or import relationships outside `mobile-oa-h5`; the repository knowledge-graph rule only has generated graphs for `backend` and `web-admin`, so no graph update command applies.
|
||||
@@ -0,0 +1,117 @@
|
||||
# Market List Card Right Spacing 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:** 修复市场部通用列表卡片右侧溢出遮挡,并确认 12 个市场入口的卡片布局均受到回归保护。
|
||||
|
||||
**Architecture:** 保留现有通用卡片的 `width: 100%` 和间距,通过 `box-sizing: border-box` 将 padding 与 border 纳入宽度计算。预签约页面使用独立卡片,不修改其布局;回归测试同时校验通用卡片盒模型、预签约卡片宽度约束和 12 个路由覆盖。
|
||||
|
||||
**Tech Stack:** Vue 3, Vant 4, CSS, Node.js `node:test`, Vite
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Add a failing card-width regression test
|
||||
|
||||
**Files:**
|
||||
- Modify: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`
|
||||
- Test: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`
|
||||
|
||||
- [x] **Step 1: Write the failing test**
|
||||
|
||||
Add a test that reads `styles/market.css` and `routes.js`, then asserts:
|
||||
|
||||
```js
|
||||
test('all twelve market list entries keep cards inside the horizontal content area', () => {
|
||||
const styles = source('../styles/market.css')
|
||||
const routes = source('./routes.js')
|
||||
|
||||
assert.match(styles, /\.market-list-card\s*\{[\s\S]*?box-sizing:\s*border-box;[\s\S]*?width:\s*100%;/)
|
||||
assert.match(styles, /\.presign-order-card\s*\{[\s\S]*?overflow:\s*hidden;/)
|
||||
assert.match(routes, /export const MARKET_ROLES = \['specialist', 'manager'\]/)
|
||||
assert.match(routes, /export const MARKET_MODULES = \[[\s\S]*?'presign'[\s\S]*?'protocol'[\s\S]*?'payment-chase'[\s\S]*?'payment'[\s\S]*?'sample'[\s\S]*?'freight'/)
|
||||
})
|
||||
```
|
||||
|
||||
- [x] **Step 2: Run the focused test and verify RED**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5 && node --test --test-name-pattern="all twelve market list entries" src/market/mobile-parity-ui.test.js
|
||||
```
|
||||
|
||||
Expected: one failed test because `.market-list-card` does not contain `box-sizing: border-box` before `width: 100%`.
|
||||
|
||||
### Task 2: Apply the minimal CSS fix
|
||||
|
||||
**Files:**
|
||||
- Modify: `mobile-oa-h5/src/styles/market.css`
|
||||
- Test: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`
|
||||
|
||||
- [x] **Step 1: Add the width-safe box model**
|
||||
|
||||
Update the existing rule to begin with:
|
||||
|
||||
```css
|
||||
.market-list-card {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
```
|
||||
|
||||
- [x] **Step 2: Run the focused test and verify GREEN**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5 && node --test --test-name-pattern="all twelve market list entries" src/market/mobile-parity-ui.test.js
|
||||
```
|
||||
|
||||
Expected: the focused test passes.
|
||||
|
||||
### Task 3: Verify the market UI suite, build, and dependency graph
|
||||
|
||||
**Files:**
|
||||
- Verify: `mobile-oa-h5/src/market/*.test.js`
|
||||
- Verify: `mobile-oa-h5/src/styles/market.css`
|
||||
- Update generated graph: `web-admin/graphify-out/*` only if the project graph script maps `mobile-oa-h5` into the frontend graph
|
||||
|
||||
- [x] **Step 1: Run all market UI tests**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5 && node --test src/market/*.test.js
|
||||
```
|
||||
|
||||
Expected: zero failed tests.
|
||||
|
||||
- [x] **Step 2: Run the production build**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
cd mobile-oa-h5 && pnpm build
|
||||
```
|
||||
|
||||
Expected: Vite exits with code 0.
|
||||
|
||||
- [x] **Step 3: Update the frontend knowledge graph**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
./scripts/update-graph.sh frontend
|
||||
```
|
||||
|
||||
Expected: graph generation exits with code 0. Preserve generated changes only when the script includes the modified mobile frontend files.
|
||||
|
||||
- [x] **Step 4: Check the final diff**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
git diff --check -- mobile-oa-h5/src/styles/market.css mobile-oa-h5/src/market/mobile-parity-ui.test.js docs/superpowers/plans/2026-10-11-market-list-card-right-spacing.md
|
||||
git status --short
|
||||
```
|
||||
|
||||
Expected: no whitespace errors; only the intended incremental edits are attributed to this fix.
|
||||
@@ -0,0 +1,145 @@
|
||||
# Market Reference Labels 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:** Ensure every Market mobile list, detail, create, and edit view displays Chinese business labels instead of internal user IDs, foreign-key IDs, or dictionary codes.
|
||||
|
||||
**Architecture:** Keep backend permission-scoped option lists unchanged, but hydrate each edit form with the current record's authoritative `{ value, label }` snapshots so historical values remain readable. Centralize frontend display fallback rules so unresolved references render `未知人员` or `—`, never raw IDs/codes, and enrich sample handling responses with handler names at the backend boundary.
|
||||
|
||||
**Tech Stack:** Vue 3, Vant, JavaScript Node test runner, FastAPI, SQLAlchemy, pytest.
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Add reference-label regression coverage
|
||||
|
||||
**Files:**
|
||||
- Create: `mobile-oa-h5/src/market/reference-options.test.js`
|
||||
- Modify: `mobile-oa-h5/src/market/module-contracts.test.js`
|
||||
- Modify: `mobile-oa-h5/src/market/list-presenter.test.js`
|
||||
- Modify: `backend/tests/test_market_sample_api.py`
|
||||
|
||||
- [ ] **Step 1: Write failing frontend tests**
|
||||
|
||||
Add tests proving selected user, region, hospital, sample type, sample code, and unit values are merged into scoped option sets from detail label fields. Assert protocol/sample/freight detail presenters never fall back to IDs or dictionary codes.
|
||||
|
||||
- [ ] **Step 2: Run the focused frontend tests and verify RED**
|
||||
|
||||
Run: `node --test src/market/reference-options.test.js src/market/module-contracts.test.js src/market/list-presenter.test.js`
|
||||
|
||||
Expected: FAIL because reference-option hydration and safe label fallbacks do not yet exist.
|
||||
|
||||
- [ ] **Step 3: Write failing backend tests**
|
||||
|
||||
Extend sample API tests so `get_sample_detail` returns `handlerUserName` for storage-certificate and insurance summaries and `get_sample_form_options` retains the currently selected handler as a readable option without widening normal region staff choices.
|
||||
|
||||
- [ ] **Step 4: Run the focused backend tests and verify RED**
|
||||
|
||||
Run: `backend/venv/bin/pytest backend/tests/test_market_sample_api.py -q`
|
||||
|
||||
Expected: FAIL on missing handler display names/current selected options.
|
||||
|
||||
### Task 2: Centralize form reference-option hydration
|
||||
|
||||
**Files:**
|
||||
- Create: `mobile-oa-h5/src/market/reference-options.js`
|
||||
- Modify: `mobile-oa-h5/src/views/market/MarketModuleForm.vue`
|
||||
- Modify: `mobile-oa-h5/src/views/market/presign/PresignOrderForm.vue`
|
||||
|
||||
- [ ] **Step 1: Implement minimal hydration helpers**
|
||||
|
||||
Create pure helpers that merge scoped options with current detail snapshots, deduplicate by normalized value, and only add entries with a real human-readable label.
|
||||
|
||||
- [ ] **Step 2: Hydrate generic Market forms after detail/options load**
|
||||
|
||||
For protocol fields, merge current collector, sales specialist, manager, region, hospital, sample type, sample code, and unit labels. For sample handling, merge the current handler name. Reapply hydration after region cascade option refreshes.
|
||||
|
||||
- [ ] **Step 3: Harden the dedicated pre-sign form**
|
||||
|
||||
Reuse the shared person-option merge behavior and render `未知人员` rather than the raw selected ID if the backend cannot resolve a name.
|
||||
|
||||
- [ ] **Step 4: Run focused frontend tests and verify GREEN**
|
||||
|
||||
Run: `node --test src/market/reference-options.test.js src/market/module-contracts.test.js src/market/list-presenter.test.js src/market/presign/presign-form-state.test.js src/market/presign/presign-form-view.test.js`
|
||||
|
||||
Expected: all tests pass.
|
||||
|
||||
### Task 3: Enrich sample handler names without widening permissions
|
||||
|
||||
**Files:**
|
||||
- Modify: `backend/app/services/market_sample.py`
|
||||
- Modify: `backend/tests/test_market_sample_api.py`
|
||||
|
||||
- [ ] **Step 1: Resolve handler names in sample detail summaries**
|
||||
|
||||
Batch-load tenant user display names for storage-certificate and insurance handler IDs and expose them as `handlerUserName`.
|
||||
|
||||
- [ ] **Step 2: Preserve the current handler in edit options**
|
||||
|
||||
Append only the handler already referenced by the accessible sample record when it is outside the active region-staff list; do not expose unrelated tenant users.
|
||||
|
||||
- [ ] **Step 3: Run focused backend tests and verify GREEN**
|
||||
|
||||
Run: `backend/venv/bin/pytest backend/tests/test_market_sample_api.py -q`
|
||||
|
||||
Expected: all tests pass.
|
||||
|
||||
### Task 4: Remove raw ID/code display fallbacks across Market presenters
|
||||
|
||||
**Files:**
|
||||
- Modify: `mobile-oa-h5/src/market/modules/protocol.js`
|
||||
- Modify: `mobile-oa-h5/src/market/modules/sample.js`
|
||||
- Modify: `mobile-oa-h5/src/market/modules/freight.js`
|
||||
- Modify: `mobile-oa-h5/src/market/list-presenter.js`
|
||||
- Modify: `backend/app/services/market_freight.py`
|
||||
|
||||
- [ ] **Step 1: Replace person-ID fallbacks**
|
||||
|
||||
Display authoritative name fields, `未知人员` for a non-empty unresolved person reference, and `—` when no reference exists.
|
||||
|
||||
- [ ] **Step 2: Replace unresolved dictionary-code fallbacks**
|
||||
|
||||
For status, source, payment mode, transport mode, sex, and delivery mode, use known Chinese mappings and render `未知` for an unrecognized non-empty code instead of exposing the code.
|
||||
|
||||
- [ ] **Step 3: Keep identifiers that are business numbers**
|
||||
|
||||
Do not alter protocol numbers, sample codes, freight batch numbers, laboratory storage codes, or other user-facing business identifiers.
|
||||
|
||||
- [ ] **Step 4: Run presenter and contract tests**
|
||||
|
||||
Run: `node --test src/market/list-presenter.test.js src/market/module-contracts.test.js src/market/mobile-parity-ui.test.js`
|
||||
|
||||
Expected: all tests pass.
|
||||
|
||||
### Task 5: Full verification and browser audit
|
||||
|
||||
**Files:**
|
||||
- Modify generated graph files under `backend/graphify-out/` only through the repository script.
|
||||
|
||||
- [ ] **Step 1: Run all mobile Market tests**
|
||||
|
||||
Run: `node --test src/market/*.test.js src/market/presign/*.test.js src/utils/download-attachment.test.js src/utils/http-error.test.js`
|
||||
|
||||
Expected: zero failures.
|
||||
|
||||
- [ ] **Step 2: Build mobile OA H5**
|
||||
|
||||
Run: `npm run build`
|
||||
|
||||
Expected: Vite exits with code 0.
|
||||
|
||||
- [ ] **Step 3: Run affected backend suites**
|
||||
|
||||
Run: `backend/venv/bin/pytest backend/tests/test_market_sample_api.py backend/tests/test_market_protocol_api.py backend/tests/test_market_support_api.py backend/tests/test_market_freight_scope.py -q`
|
||||
|
||||
Expected: zero failures.
|
||||
|
||||
- [ ] **Step 4: Update backend code graph**
|
||||
|
||||
Run: `./scripts/update-graph.sh backend`
|
||||
|
||||
Expected: graph update exits with code 0.
|
||||
|
||||
- [ ] **Step 5: Verify representative pages in the browser**
|
||||
|
||||
Open specialist and manager protocol edit, pre-sign edit, sample handling, payment/chase detail, and freight detail. Confirm reference fields show Chinese labels, no internal UUID/user ID/dictionary code is visible, and valid business identifiers remain unchanged.
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# 市场端剩余五模块移动端复刻实施计划
|
||||
|
||||
> 执行方式:当前会话内直接实施。视觉与交互以 `docs/demos/2026-10-11-market-remaining-mobile-parity-demo.html` 为准。
|
||||
|
||||
## 目标
|
||||
|
||||
将市场专员、地区经理的协议单、催缴信息、缴费信息、样本信息、运费信息共 10 个入口改造成与 Web 端字段、动作一致的移动端卡片界面;复用现有 `mobile-oa-h5` 市场模块路由和表单框架,不复制业务逻辑,不制造仅前端可见的假动作。
|
||||
|
||||
## 实施步骤
|
||||
|
||||
1. **锁定展示契约**
|
||||
- 新增列表展示适配器及单元测试,覆盖五模块标题、状态、完整字段、金额格式、角色差异和动作标签。
|
||||
- 所有卡片动作与后端返回的 `allowedActions` 取交集,避免越权按钮。
|
||||
|
||||
2. **补齐后端移动端协议能力**
|
||||
- 为协议列表返回卡片所需字段。
|
||||
- 新增带业务来源参数的协议审核、软删除接口;访问控制继续经过租户、角色、数据范围校验。
|
||||
- 扩展协议 `allowedActions`,并以测试覆盖状态限制和路由契约。
|
||||
|
||||
3. **补齐其余列表摘要**
|
||||
- 缴费列表增加已缴、待缴、期次进度摘要。
|
||||
- 催缴列表补充协议状态。
|
||||
- 运费列表携带当前角色可见样本,并对市场专员只展示隐私提示,不泄露隐藏数量。
|
||||
|
||||
4. **重做移动端列表壳层**
|
||||
- 去除绿色大头部和状态下拉,只保留白色导航标题与搜索框。
|
||||
- 新增动作改为右下角 56px 圆形悬浮按钮。
|
||||
- 使用 Vant `List` 滚动触底分页加载,保留首屏失败、追加失败和空状态处理。
|
||||
- 卡片展示 Web 端同等信息,并提供详情、编辑、审核、删除及各模块专属动作。
|
||||
|
||||
5. **表单组件移动化**
|
||||
- 下拉字段统一改为 Vant Picker;日期时间统一改为 Vant DatePicker/TimePicker。
|
||||
- 采集地区变化后清空并重新加载采集医院,实现数据库选项级联。
|
||||
- 上传字段改为“上传卡片 + 已上传附件卡片”同排布局,选择后立即上传,支持预览和删除。
|
||||
|
||||
6. **验证与图谱**
|
||||
- 运行 `mobile-oa-h5` 市场单测及生产构建。
|
||||
- 运行后端市场模块定向测试。
|
||||
- 更新后端代码知识图谱(移动端 H5 暂无独立图谱任务)。
|
||||
|
||||
## 完成标准
|
||||
|
||||
- 两类角色的五模块列表均采用模板卡片布局,无状态筛选下拉。
|
||||
- 有新增权限的页面只显示右下角圆形 `+` 按钮。
|
||||
- 列表滚动自动分页,查询会重置分页并重新请求。
|
||||
- 列表和详情动作由后端授权,协议审核/删除真实可用。
|
||||
- 地区/医院联动、数据库下拉、附件卡片、缴费/样本/运费专属动作均可用。
|
||||
- 测试与构建通过,无跨应用主色混用。
|
||||
@@ -28,7 +28,7 @@
|
||||
- Modify: `mobile-h5/utils/config.js`
|
||||
- Create: `mobile-h5/utils/env-banner.test.js`
|
||||
|
||||
- [ ] **Step 1: 先写失败单测**
|
||||
- [x] **Step 1: 先写失败单测**
|
||||
|
||||
创建 `mobile-h5/utils/env-banner.test.js`:
|
||||
|
||||
@@ -60,7 +60,7 @@ assert.deepEqual(buildEnvBanner('unknown'), {
|
||||
console.log('env-banner.test.js: ok')
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 跑测试确认失败**
|
||||
- [x] **Step 2: 跑测试确认失败**
|
||||
|
||||
Run:
|
||||
|
||||
@@ -70,7 +70,7 @@ cd mobile-h5 && node utils/env-banner.test.js
|
||||
|
||||
Expected: FAIL(`buildEnvBanner` 未导出 / 未定义)
|
||||
|
||||
- [ ] **Step 3: 实现 `buildEnvBanner` 与 `ENV_BANNER`**
|
||||
- [x] **Step 3: 实现 `buildEnvBanner` 与 `ENV_BANNER`**
|
||||
|
||||
在 `mobile-h5/utils/config.js` 末尾(现有导出之后)增加:
|
||||
|
||||
@@ -91,7 +91,7 @@ export const ENV_BANNER = buildEnvBanner(APP_ENV)
|
||||
|
||||
不要改动 `ENV_PRESETS` 与现有 URL 导出逻辑。若当前 `APP_ENV` 为本地联调值可保持不动(本任务不强制改回 `prod`)。
|
||||
|
||||
- [ ] **Step 4: 跑测试确认通过**
|
||||
- [x] **Step 4: 跑测试确认通过**
|
||||
|
||||
Run:
|
||||
|
||||
@@ -101,7 +101,7 @@ cd mobile-h5 && node utils/env-banner.test.js
|
||||
|
||||
Expected: 打印 `env-banner.test.js: ok`,exit code 0
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
- [x] **Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add mobile-h5/utils/config.js mobile-h5/utils/env-banner.test.js
|
||||
@@ -121,7 +121,7 @@ EOF
|
||||
**Files:**
|
||||
- Modify: `mobile-h5/pages/index/index.vue`
|
||||
|
||||
- [ ] **Step 1: 模板插入色条**
|
||||
- [x] **Step 1: 模板插入色条**
|
||||
|
||||
在 `<view class="page-shell">` 内、`<view class="home-header">` **之前**插入:
|
||||
|
||||
@@ -135,7 +135,7 @@ EOF
|
||||
</view>
|
||||
```
|
||||
|
||||
- [ ] **Step 2: script 引入并挂到 data/computed**
|
||||
- [x] **Step 2: script 引入并挂到 data/computed**
|
||||
|
||||
在 script 顶部增加:
|
||||
|
||||
@@ -149,7 +149,7 @@ EOF
|
||||
envBanner: ENV_BANNER,
|
||||
```
|
||||
|
||||
- [ ] **Step 3: scoped 样式**
|
||||
- [x] **Step 3: scoped 样式**
|
||||
|
||||
在现有 `<style lang="scss" scoped>` 中追加:
|
||||
|
||||
@@ -183,14 +183,14 @@ EOF
|
||||
|
||||
色条不加 status-bar 额外占位;安全区仍由现有 `.home-header` padding 处理。
|
||||
|
||||
- [ ] **Step 4: 手工验收清单**
|
||||
- [x] **Step 4: 手工验收清单**
|
||||
|
||||
1. `APP_ENV='local'` → 首页顶栏橙色「本地环境」
|
||||
2. `APP_ENV='test'` → 首页顶栏蓝色「测试环境」
|
||||
3. `APP_ENV='prod'` → 无色条
|
||||
4. 登录页 / OA 列表无色条
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
- [x] **Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add mobile-h5/pages/index/index.vue
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# Remove Market Floating Back Buttons 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:** Remove every top-left circular back button from pages under the Market menu while preserving bottom cancel actions and normal list navigation.
|
||||
|
||||
**Architecture:** Generic Market pages continue to use `MarketPageShell`, with forms explicitly disabling its optional back control. The dedicated presign form removes its standalone back control. A source-contract test prevents either control from returning.
|
||||
|
||||
**Tech Stack:** Vue 3, Vant, Node.js test runner, Vite.
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Remove Market form floating back controls
|
||||
|
||||
**Files:**
|
||||
- Modify: `mobile-oa-h5/src/market/mobile-parity-ui.test.js`
|
||||
- Modify: `mobile-oa-h5/src/views/market/MarketModuleForm.vue`
|
||||
- Modify: `mobile-oa-h5/src/views/market/presign/PresignOrderForm.vue`
|
||||
|
||||
- [x] **Step 1: Write the failing test**
|
||||
|
||||
Extend the Market UI contract test so the generic form must pass `:backable="false"` and the dedicated presign form must not contain `presign-form-page__back`.
|
||||
|
||||
- [x] **Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `node --test src/market/mobile-parity-ui.test.js`
|
||||
|
||||
Expected: FAIL because both form implementations currently render a back control.
|
||||
|
||||
- [x] **Step 3: Write minimal implementation**
|
||||
|
||||
Pass `:backable="false"` to `MarketPageShell` in the generic form and delete the standalone back button from the presign form. Keep the bottom cancel actions unchanged.
|
||||
|
||||
- [x] **Step 4: Run verification**
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
node --test
|
||||
pnpm build
|
||||
```
|
||||
|
||||
Expected: all tests pass and the production build succeeds.
|
||||
|
||||
- [x] **Step 5: Verify the original page**
|
||||
|
||||
Reload the protocol edit page and confirm its iframe accessibility tree contains no button named `返回`, while the bottom `取消` and `保存` buttons remain.
|
||||
@@ -20,7 +20,7 @@
|
||||
- Modify: `backend/tests/test_sample_payment_period_summary.py`
|
||||
- Modify: `backend/tests/test_payment_chase.py`
|
||||
|
||||
- [ ] **Step 1: 改写失败用例期望(TDD)**
|
||||
- [x] **Step 1: 改写失败用例期望(TDD)**
|
||||
|
||||
在 `test_sample_payment_period_summary.py`:
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# 预签约协议编号自动发号 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:** 预签约新增保存自动发号、编辑空号补发且不可改号、表单不展示、租户内与正式/捐赠全局唯一;转正式沿用该号;同步 Web 与小程序移动端。
|
||||
|
||||
**Architecture:** 发号集中在 `presign_order` CRUD;唯一性扩展 `assert_biz_no_available`;前端仅去掉表单输入,列表仍展示接口返回的 `protocolNo`。
|
||||
|
||||
**Tech Stack:** FastAPI/SQLAlchemy、pytest、Vue 3(web-admin / mobile-oa-h5)
|
||||
|
||||
**Spec:** `docs/superpowers/specs/2026-10-12-presign-protocol-no-auto-allocate-design.md`
|
||||
|
||||
---
|
||||
|
||||
### Task 1: 唯一性校验纳入预签约
|
||||
|
||||
**Files:**
|
||||
- Modify: `backend/app/crud/protocol_donation_convert.py`(`assert_biz_no_available`)
|
||||
- Test: `backend/tests/test_presign_order.py`(或新建聚焦测试)
|
||||
|
||||
- [x] 扩展 `assert_biz_no_available`:校验 `BizPresignOrder.protocol_no`,支持 `exclude_presign_order_id`
|
||||
- [x] 测试:预签已占号 → 正式创建同号失败;排除自身可通过
|
||||
|
||||
### Task 2: 创建/更新自动发号
|
||||
|
||||
**Files:**
|
||||
- Modify: `backend/app/crud/presign_order.py`
|
||||
- Test: `backend/tests/test_presign_order.py`
|
||||
|
||||
- [x] `create_presign_order`:忽略客户端号,调用 `allocate_next_biz_no(kind="collection")`
|
||||
- [x] `update_presign_order`:去掉 mapping 中的 protocol_no;空号补发
|
||||
- [x] 测试:创建必有号;客户端自定义号被忽略;更新不能改号;空号编辑补发
|
||||
|
||||
### Task 3: Web 表单隐藏协议编号
|
||||
|
||||
**Files:**
|
||||
- Modify: `web-admin/src/views/cell-storage/presign-order/PresignOrderFormDialog.vue`
|
||||
|
||||
- [x] 移除表单项与提交中的 `protocolNo`(可保留内部只读状态字段若详情加载需要,但勿展示、勿提交改号)
|
||||
|
||||
### Task 4: 移动端 / 小程序表单同步
|
||||
|
||||
**Files:**
|
||||
- Modify: `mobile-oa-h5/src/views/market/presign/PresignOrderForm.vue`
|
||||
- Modify: `mobile-oa-h5/src/market/presign/presign-form-state.js`(及 payload 若有)
|
||||
- Modify: `mobile-oa-h5/src/market/presign/presign-form-*.test.js`
|
||||
|
||||
- [x] 移除协议编号输入
|
||||
- [x] 更新契约测试字段列表
|
||||
|
||||
### Task 5: 验证
|
||||
|
||||
- [x] 跑相关 pytest 与移动端相关 vitest/node 测试
|
||||
- [x] 更新 graphify(backend)若签名变更
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
# 存储业务移动端功能实施总结
|
||||
|
||||
## 1. 实施结果
|
||||
|
||||
本次已完成市场专员、地区经理在小程序中的存储业务入口,以及由 `mobile-oa-h5` 承载的六类业务功能:预签约订单、协议单、催缴、缴费、样本和运费。小程序只负责受控入口和 WebView 宿主,业务列表、详情、表单与有限动作均在 H5 中实现。
|
||||
|
||||
业务链路为:
|
||||
|
||||
```text
|
||||
mobile-h5 首页菜单
|
||||
-> /pages/market/webview/index?entry=<固定入口>
|
||||
-> mobile-oa-h5 固定角色路由
|
||||
-> /api/mini/market/{specialist|manager}/...
|
||||
```
|
||||
|
||||
客户端不能传入任意 H5 URL、租户、现场 scope 或销售/经理身份来扩大权限。
|
||||
|
||||
## 2. 菜单与入口
|
||||
|
||||
菜单迁移为每个移动端虚拟根创建两个目录和十二个叶子,不自动写入角色菜单关系:
|
||||
|
||||
| 角色组 | 六个固定入口 |
|
||||
|---|---|
|
||||
| 市场专员 | `specialist-presign`、`specialist-protocol`、`specialist-payment-chase`、`specialist-payment`、`specialist-sample`、`specialist-freight` |
|
||||
| 地区经理 | `manager-presign`、`manager-protocol`、`manager-payment-chase`、`manager-payment`、`manager-sample`、`manager-freight` |
|
||||
|
||||
首页接口返回 `groupTitle` 区分角色组。目录本身没有可进入 path;入口 icon 按设计保持空置。未知 entry、原型链键和任意 URL 均被白名单拒绝。
|
||||
|
||||
## 3. 权限与数据范围
|
||||
|
||||
所有移动市场接口同时应用:
|
||||
|
||||
1. 当前租户与软删除过滤;
|
||||
2. 当前租户有效直接角色与启用职位继承角色的 data scope 并集;
|
||||
3. 当前固定路由的现场范围。
|
||||
|
||||
现场范围为:
|
||||
|
||||
- 市场专员:单据采集信息 `sales_user_id = 当前用户`;
|
||||
- 地区经理:当前用户负责地区(`is_leader=1`)或单据 `region_manager_user_id = 当前用户`;
|
||||
- 兼岗用户进入哪套固定路由,就使用哪套现场范围,不做页面内并集。
|
||||
|
||||
详情和所有写操作均重新校验范围。涉及并发写入的样本办理、运费关联和批次头修改使用 MySQL current read、稳定锁顺序与锁后权限复核,避免 `REPEATABLE READ` 旧快照授权。
|
||||
|
||||
## 4. 六模块开放能力
|
||||
|
||||
| 模块 | 实际开放动作 | 明确不开放 |
|
||||
|---|---|---|
|
||||
| 预签约订单 | 列表、详情、新建、编辑、原子转正式 | 删除、财务确认;终态继续编辑/转换 |
|
||||
| 协议单 | 细胞/科研双来源列表、详情、新建、编辑 | 审核、作废、退款、财务动作、转换 |
|
||||
| 催缴 | 逾期未清与未来 30 天未清查询,跳转登记缴费 | 催缴编辑实体、发送/标记催缴 |
|
||||
| 缴费 | v2 样本缴费查看、登记/编辑草稿、提交财务确认、确认中撤回 | 财务确认/拒绝、删除、退款、开票、修改应缴计划 |
|
||||
| 样本 | 双来源进度查看;细胞储存证/保险轻量办理 | 科研样本写入、接收/质检/生产/入库状态、实验室码 |
|
||||
| 运费 | scope 内批次查看、新建、样本关联/解绑;own-only 批次头编辑 | 修改含范围外明细的共享批次头、查看隐藏明细/数量 |
|
||||
|
||||
后端返回 `allowedActions`,H5 再与模块静态白名单取交集。按钮隐藏不是授权手段,直达写接口重复执行状态和范围校验。
|
||||
|
||||
## 5. 运费脱敏
|
||||
|
||||
- 批次只要存在至少一条当前 scope 可见明细即可见;
|
||||
- 列表、关键词、来源筛选、total 和详情明细只基于可见行;
|
||||
- 响应只返回 `visibleItemCount`,不返回总关联数、隐藏数、共享标志或他人明细;
|
||||
- 创建、关联、解绑先完整校验全部样本,任一越权则整单回滚;
|
||||
- 样本已属于其他批次时返回冲突,不静默迁移;
|
||||
- 只有全部有效明细都在当前 scope 时才允许修改批次头;
|
||||
- 生成列与唯一索引保证同一样本最多存在一条有效运费关联。
|
||||
|
||||
## 6. 表单支撑与附件安全
|
||||
|
||||
移动表单 options 使用固定资源接口,不提供任意字典或全租户用户搜索。地区、医院和人员均按当前角色与业务单范围收敛;样本办理人员限定为该样本当前父单地区内的启用人员。
|
||||
|
||||
附件上传规则:
|
||||
|
||||
- 固定服务端目录,不接受客户端 folder;
|
||||
- 单文件非空且不超过 10 MiB;
|
||||
- 仅允许约定的图片、PDF 和 Office 类型,并校验扩展名、MIME 与文件结构;
|
||||
- HEIC/HEIF 严格校验 ISO-BMFF `ftyp` box 和品牌;
|
||||
- 暂存附件必须匹配当前租户、上传人、角色入口和模块;
|
||||
- 业务保存时批量锁定并在同一事务内绑定到唯一业务 ID;
|
||||
- 单字段最多 20 个引用、总长度不超过 4000;
|
||||
- 历史业务中已保存的 URL 可原样保留,但不能借此引入新外链;
|
||||
- 数据库提交前失败会回滚并清理对象存储文件。
|
||||
|
||||
本期未增加不安全的移动端附件下载接口。
|
||||
|
||||
## 7. 数据库迁移与部署顺序
|
||||
|
||||
建议按以下顺序执行:
|
||||
|
||||
1. `docs/sql/migrations/2026-10-10-market-field-scope-indexes.sql`
|
||||
2. `docs/sql/migrations/2026-10-10-presign-convert-unique.sql`
|
||||
3. `docs/sql/migrations/2026-10-11-market-payment-indexes.sql`
|
||||
4. `docs/sql/migrations/2026-10-11-market-sample-indexes.sql`
|
||||
5. `docs/sql/migrations/2026-10-11-market-freight-indexes.sql`
|
||||
6. `docs/sql/migrations/2026-10-10-market-mobile-menus.sql`
|
||||
|
||||
迁移前应先备份相关表,并处理脚本报告的历史重复预签转换、重复运费批次号或重复有效样本关联。菜单迁移后由管理员将十二个叶子权限分配给对应角色。
|
||||
|
||||
回滚采用数据库备份恢复或经审核的反向 DDL;不建议在未核对线上索引依赖时直接删除索引/生成列。菜单回滚应按迁移自然键删除新增叶子与空目录,不处理既有角色授权以外的数据。
|
||||
|
||||
## 8. 自动验证结果
|
||||
|
||||
2026-10-11 最终验证:
|
||||
|
||||
- 后端市场定向:`215 passed`;
|
||||
- 市场 SQL 静态测试:`11 passed`;
|
||||
- 后端全量:最初为 `912 passed, 4 failed`;后续已修复 CBC 测试契约和 3 项协议排序问题,复验为 `916 passed, 0 failed`;
|
||||
- Python `compileall`:通过;
|
||||
- 字段一致性:`0 errors, 5 warnings`,5 项为脚本既有实体告警;该脚本未注册本次 market DTO,本次字段白名单由 `test_market_*` 覆盖;
|
||||
- `mobile-h5`:`5/5 passed`;
|
||||
- `mobile-oa-h5`:`62/62 passed`;
|
||||
- `mobile-oa-h5` Vite 构建:通过,保留既有大 chunk 警告;
|
||||
- `git diff --check`:通过;
|
||||
- 后端知识图谱:`6122 nodes / 33427 edges / 40 communities`。
|
||||
|
||||
MySQL 验证使用隔离启动的 MySQL 5.7.24 临时实例,六份迁移连续执行两轮均成功。两个测试租户各得到 2 个目录和 12 个叶子,`sys_role_menu` 未增加;索引、生成列和重复数据预检符合预期。临时数据库验证后已删除。
|
||||
|
||||
## 9. 手工验收状态
|
||||
|
||||
自动化测试和构建已完成。以下环境相关项目尚未在本任务中执行,因此不声明通过:
|
||||
|
||||
- 375px、390px、430px 真实浏览器视口的逐页视觉检查;
|
||||
- 微信开发者工具中的 WebView、返回宿主、安全区和键盘体验;
|
||||
- 使用真实专员、经理、兼岗账号进行端到端菜单授权与操作验收;
|
||||
- 真实 MinIO、生产同构域名和登录 token 失效联调。
|
||||
|
||||
部署到测试环境后应按实施计划 Task 11 Step 4 的七项矩阵完成并留存截图/录屏。
|
||||
|
||||
## 10. 已知限制与后续事项
|
||||
|
||||
- 市场菜单正式 icon 尚未提供,当前按设计空置;
|
||||
- 缴费移动端明确支持 v2 样本缴费模型,v1 历史记录返回兼容提示;
|
||||
- 科研样本本期只读,因为现有模型没有不影响质检/入库状态的市场轻量办理实体;
|
||||
- 移动端附件下载未开放,避免复用旧后台的模糊 URL 查询;
|
||||
- Vite 主 chunk 仍有超过 500 kB 的既有警告,可后续单独做代码分包;
|
||||
- `mobile-h5` Node 测试有未声明 `type: module` 的重解析警告,不影响当前运行结果;
|
||||
- 字段一致性 5 个既有 warning 应另立任务处理;后端 4 个既有基线测试失败已于 2026-10-11 修复。
|
||||
@@ -0,0 +1,122 @@
|
||||
# 市场移动端附件展示与详情返回按钮调整设计
|
||||
|
||||
## 背景与目标
|
||||
|
||||
市场专员、地区经理的预签约订单、协议单、催缴信息、缴费信息、样本信息、运费信息已经采用移动端卡片布局。本次在不改变业务权限和接口语义的前提下,完成两项统一调整:
|
||||
|
||||
1. 所有市场业务详情页不再显示内容区左上角的圆形悬浮返回按钮。
|
||||
2. 市场业务的附件上传、编辑回显和详情展示采用工作流 `OaUploadField.vue` 的 84×84px 标准卡片视觉与交互。
|
||||
|
||||
经 HTML Demo 确认,采用方案 A「工作流标准卡片」。
|
||||
|
||||
## 范围
|
||||
|
||||
### 包含
|
||||
|
||||
- 市场专员和地区经理共 12 个市场入口涉及的详情页。
|
||||
- 协议附件、知情同意书、健康调查表、传染病报告、其他附件。
|
||||
- 预签约和缴费中的转账附件/转账凭证。
|
||||
- 样本储存证、保险等办理附件。
|
||||
- 后续通过同一市场表单字段类型 `upload` 接入的附件。
|
||||
|
||||
### 不包含
|
||||
|
||||
- 不修改工作流附件组件自身。
|
||||
- 不修改附件上传、下载接口协议。
|
||||
- 不执行对象存储物理删除;编辑态删除只移除当前表单中的附件引用,保存后由现有业务接口更新字段。
|
||||
- 不移除新增、编辑页为避免误退出而保留的返回能力。
|
||||
- 不改变列表页、权限判断和业务状态流转。
|
||||
|
||||
## 交互设计
|
||||
|
||||
### 详情页返回按钮
|
||||
|
||||
- `MarketModuleDetail.vue` 关闭 `MarketPageShell` 的返回入口。
|
||||
- 页面继续保持无顶部标题栏,不再渲染左上角圆形返回按钮,也不为该按钮预留顶部空白。
|
||||
- 用户返回由小程序/WebView 宿主导航承担。
|
||||
|
||||
### 附件卡片
|
||||
|
||||
- 单个附件卡片尺寸为 84×84px,圆角 14px,与工作流一致。
|
||||
- 图片附件使用 `object-fit: cover` 展示真实缩略图,底部渐变层显示截断后的文件名。
|
||||
- PDF、Excel、Word、压缩包和其他文件使用统一文档轮廓图标,通过红、绿、蓝、金、品牌绿区分类型。
|
||||
- 非图片卡片底部显示“点击下载”,不展示完整 URL 或对象存储路径。
|
||||
- 文件名从接口返回的 `fileName`/`name` 优先取得,缺失时从 URL 最后一段安全解码;界面只展示文件名。
|
||||
- 添加卡片作为附件行第一项,保持工作流的绿色渐变加号和虚线边框。
|
||||
|
||||
### 编辑态
|
||||
|
||||
- 选择文件后沿用现有 `uploadMarketAttachment` 立即上传。
|
||||
- 上传选择范围与后端一致:协议、缴费、样本单个文件不超过 10 MiB,预签约不超过 20 MiB;仅允许 JPG/JPEG、PNG、WebP、HEIC/HEIF、PDF、DOC/DOCX、XLS/XLSX。
|
||||
- 上传期间显示加载状态并禁止重复提交。
|
||||
- 已上传附件右上角显示删除按钮;删除更新当前字段值,附件立即从界面消失。
|
||||
- 图片点击打开图片预览;非图片点击调用现有 `downloadAttachmentFile` 下载。
|
||||
- 删除按钮视觉尺寸为 20px 左右,但实际点击热区不小于 44×44px。
|
||||
|
||||
### 详情只读态
|
||||
|
||||
- 隐藏添加卡片和删除按钮。
|
||||
- 图片仍支持预览,非图片仍支持下载。
|
||||
- 协议、缴费、样本、预签约等详情定义不再把逗号分隔 URL 拼成普通文本,而是输出结构化附件字段交给附件卡片组件渲染。
|
||||
|
||||
## 组件与数据设计
|
||||
|
||||
### 附件标准化工具
|
||||
|
||||
新增市场附件展示工具,统一处理以下输入:
|
||||
|
||||
- 逗号分隔 URL 字符串;
|
||||
- URL 字符串数组;
|
||||
- 包含 `url`、`fileUrl`、`name`、`fileName` 的对象数组。
|
||||
|
||||
标准输出包含 `url`、`name`、`explicitName`、`isImage` 和 `kind`,其中 `kind` 为 `pdf`、`xls`、`doc`、`zip` 或 `other`。仅当接口确实返回原始文件名时才把名称传给下载接口;URL 推导名只用于卡片显示,下载时由后端附件记录恢复原始文件名。
|
||||
|
||||
### 共享展示组件
|
||||
|
||||
新增一个市场附件卡片组件,职责仅包括:
|
||||
|
||||
- 渲染添加卡片、图片缩略图和文件图标;
|
||||
- 图片预览、文件下载;
|
||||
- 编辑态删除事件;
|
||||
- 只读态隐藏上传和删除。
|
||||
|
||||
`MarketFormField.vue` 与 `PresignAttachmentUploader.vue` 复用该展示规则,但保留各自现有上传请求和表单数据更新逻辑,避免扩大接口改造范围。
|
||||
|
||||
### 详情字段协议
|
||||
|
||||
`MarketDetailSection.vue` 支持附件字段类型:
|
||||
|
||||
```js
|
||||
{
|
||||
label: '协议附件',
|
||||
type: 'attachments',
|
||||
value: 'url-a,url-b'
|
||||
}
|
||||
```
|
||||
|
||||
嵌套卡片字段同样支持该类型,用于缴费转账、预签转账和样本办理附件。
|
||||
|
||||
## 错误处理
|
||||
|
||||
- 附件 URL 为空时不渲染无效卡片。
|
||||
- 图片加载失败时降级为普通文件图标,避免出现破损图片。
|
||||
- 下载失败沿用统一 Toast 提示,不直接跳转或暴露路径。
|
||||
- 上传失败保持现有错误提示,不向表单写入无效 URL。
|
||||
- 删除只更新本地表单状态,不发起未经授权的物理删除请求。
|
||||
|
||||
## 测试策略
|
||||
|
||||
1. 组件契约测试:市场详情页不再渲染悬浮返回按钮。
|
||||
2. 工具单元测试:字符串、数组、对象附件输入均能正确标准化;图片和文件类型识别正确。
|
||||
3. 组件契约测试:图片使用缩略图,非图片使用标准图标,并具备下载和编辑态删除能力。
|
||||
4. 模块契约测试:协议、缴费、样本、预签约详情把附件声明为 `attachments` 类型,不再展示原始路径。
|
||||
5. 回归测试:市场移动端全部 Node 测试通过。
|
||||
6. 构建验证:`pnpm build` 通过。
|
||||
|
||||
## 验收标准
|
||||
|
||||
- 12 个市场入口的详情页均无左上角圆形返回按钮。
|
||||
- 任意附件字段都不显示完整 URL 或对象存储路径。
|
||||
- 图片显示缩略图,非图片显示与工作流一致的文件类型图标。
|
||||
- 编辑态支持立即上传和删除;详情态支持图片预览和文件下载。
|
||||
- 附件卡片在窄屏下自动换行,无横向溢出。
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
## 非目标
|
||||
|
||||
- 不在登录页或其他业务页显示标识。
|
||||
- 不做 sticky 吸顶。
|
||||
- 不在除首页、登录页以外的业务页显示标识。
|
||||
- 首页色条不做 sticky 吸顶。
|
||||
- 不改造微信上传/发布流程,不增加 CI 门禁。
|
||||
- 不自动改回 `APP_ENV`(仍由开发者手动切换)。
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
| 项 | 约定 |
|
||||
| --- | --- |
|
||||
| 出现页面 | 仅首页 `pages/index/index.vue` |
|
||||
| 位置 | 绿头 Header **之上**,随页面滚动(非 sticky) |
|
||||
| 出现页面 | 首页 `pages/index/index.vue`;登录页 `pages/login/index.vue` |
|
||||
| 位置 | 首页:绿头 Header **之上**(非 sticky);登录页:**底部贴底**(含安全区) |
|
||||
| local 文案 | `本地环境` |
|
||||
| test 文案 | `测试环境` |
|
||||
| local 配色 | 背景 `#f59e0b`,文字深琥珀(如 `#451a03`) |
|
||||
@@ -67,7 +67,7 @@ export const ENV_BANNER = {
|
||||
1. `APP_ENV='local'`:打开首页可见橙色条,文案为「本地环境」。
|
||||
2. `APP_ENV='test'`:打开首页可见蓝色条,文案为「测试环境」。
|
||||
3. `APP_ENV='prod'`:首页 DOM/视觉中无环境色条。
|
||||
4. 进入其他页面(登录、OA 列表等)无此色条。
|
||||
4. 登录页底部可见同文案色条;进入其他业务页(如 OA 列表)无此色条。
|
||||
5. 切换 `APP_ENV` 后重新编译/刷新,首页展示与配置一致。
|
||||
|
||||
## 测试建议
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
# 预签约订单协议编号自动发号 — 设计说明
|
||||
|
||||
**日期:** 2026-10-12
|
||||
**状态:** 已确认
|
||||
**范围:** Web 管理端预签约、市场移动端(微信小程序 WebView / `mobile-oa-h5`)、后端发号与唯一性
|
||||
|
||||
## 1. 背景与目标
|
||||
|
||||
预签约订单「协议编号」当前为可选手填;未填时列表显示 `-`,仅在转正式协议时才可能自动生成。业务需要:
|
||||
|
||||
1. **新增保存时**自动生成协议编号(与正式采集协议同一发号规则)。
|
||||
2. **编辑不可改号**;历史空号在**编辑保存时补发**。
|
||||
3. **新增/编辑弹窗不再展示**该字段;列表仍展示并可搜索。
|
||||
4. **租户内全局唯一**:采集协议号、科研捐赠号、预签约协议号互斥占用。
|
||||
5. **转正式**直接使用预签订单上已有编号。
|
||||
|
||||
## 2. 决策摘要
|
||||
|
||||
| 项 | 决策 |
|
||||
|----|------|
|
||||
| 发号时机 | 新增保存必发;编辑保存仅空号补发 |
|
||||
| 客户端改号 | 忽略请求体中的 `protocolNo` / `protocol_no` |
|
||||
| 发号实现 | 复用 `allocate_next_biz_no(kind="collection")`(`XBCC` + `YYYYMMDD` + 6 位序号) |
|
||||
| 唯一性 | 扩展 `assert_biz_no_available`,纳入未删除预签约 `protocol_no` |
|
||||
| UI | Web / 移动端表单隐藏字段;列表保留 |
|
||||
| 转正式 | 继续 `protocol_no=order.protocol_no or ""`;空号兜底发号不变 |
|
||||
|
||||
## 3. 后端行为
|
||||
|
||||
### 3.1 创建 `create_presign_order`
|
||||
|
||||
- 不读取客户端协议编号。
|
||||
- 在写入前:`protocol_no = allocate_next_biz_no(..., kind="collection")`(已含唯一性断言)。
|
||||
- 保证创建成功后订单必有非空 `protocol_no`。
|
||||
|
||||
### 3.2 更新 `update_presign_order`
|
||||
|
||||
- 从可写 mapping 中移除 `protocol_no` / `protocolNo`。
|
||||
- 若当前 `obj.protocol_no` 为空(或仅空白):补发号并写回。
|
||||
- 若已有非空号:保持不变。
|
||||
|
||||
### 3.3 唯一性 `assert_biz_no_available`
|
||||
|
||||
在现有「采集协议 + 科研捐赠」校验之外:
|
||||
|
||||
- 查询同租户、`del_flag=0` 且 `protocol_no` 相等的预签约订单。
|
||||
- 新增参数 `exclude_presign_order_id`:更新/转正式时排除自身。
|
||||
- 冲突时抛出与现有一致风格的 `ValueError`(如「协议编号已存在」)。
|
||||
|
||||
发号路径(`allocate_next_biz_no`)与转正式创建协议路径共用该函数,从而预占号不会被正式单或其它预签单占用。
|
||||
|
||||
### 3.4 转正式 `convert_to_protocol`
|
||||
|
||||
保持现逻辑:优先用订单号;空号时由 `create_collection_protocol` 发号并回写预签订单。新建单不应再走空号分支。
|
||||
|
||||
## 4. 前端
|
||||
|
||||
### 4.1 Web(`web-admin`)
|
||||
|
||||
- `PresignOrderFormDialog.vue`:移除「协议编号」表单项;提交 payload 不再传 `protocolNo`。
|
||||
- 列表页:保留「协议编号」列与搜索关键字。
|
||||
|
||||
### 4.2 移动端 / 小程序 WebView(`mobile-oa-h5`)
|
||||
|
||||
- `PresignOrderForm.vue`:移除协议编号输入。
|
||||
- `presign-form-state.js` 及契约测试:表单字段列表去掉可编辑的 `protocolNo`(详情/列表展示仍可用接口返回值)。
|
||||
- 列表卡片继续展示协议编号。
|
||||
|
||||
## 5. 测试要点
|
||||
|
||||
- 创建预签:返回非空 `protocolNo`;客户端传入自定义号被忽略。
|
||||
- 更新:已有号不被客户端篡改;空号更新后补齐。
|
||||
- `assert_biz_no_available`:预签已占号时,正式协议/捐赠/另一预签均不可再用同一号。
|
||||
- 转正式:使用预签上已有号,正式协议 `protocolNo` 一致。
|
||||
- 前端契约:表单视图字段不含协议编号输入。
|
||||
|
||||
## 6. 非目标
|
||||
|
||||
- 不为历史未编辑空号单做离线批量补号脚本(依赖编辑保存或转正式兜底)。
|
||||
- 不改发号格式前缀/位数。
|
||||
- 不在 DB 层新增唯一索引(软删除下多 NULL 与历史空号使强制唯一索引复杂;以应用层校验为准,与正式协议现状一致)。
|
||||
Reference in new issue
Block a user