Files
zkxw/docs/superpowers/plans/2026-07-13-sample-card-protocol-attachment.md
T
2026-07-14 13:55:11 +08:00

52 lines
2.1 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:** 列表 API 补齐 `healthSurveyAttachmentFiles` / `infectiousDiseaseReportAttachmentFiles`;前端新建 `ProtocolAttachmentMiniReadonly` + `getSourceProtocolAttachment` + `useAttachmentActions`,三处卡片复用。
**Tech Stack:** Python FastAPI CRUD、`urls_to_attachment_list`;Vue 3 + Element Plus + SCSS
**Spec:** `docs/superpowers/specs/2026-07-13-sample-card-protocol-attachment-design.md`
---
### Task 1: 后端预产列表补细胞存储附件
**Files:**
- Modify: `backend/app/crud/pre_transit_sample.py`
- [ ] 在细胞存储行 `d = _protocol_to_dict(r)` 后增加 `healthSurveyAttachmentFiles`
### Task 2: 后端样本接收列表补协议附件
**Files:**
- Modify: `backend/app/crud/sample_reception.py`
- [ ] `_rows_to_sample_list_items` 增加 `healthSurveyAttachmentFiles`
- [ ] `_donation_rows_to_sample_list_items` 增加 `infectiousDiseaseReportAttachmentFiles`
### Task 3: 前端共享 util / composable / 迷你组件
**Files:**
- Create: `web-admin/src/utils/protocol-source-attachment.ts`
- Create: `web-admin/src/composables/useAttachmentActions.ts`
- Create: `web-admin/src/components/business/protocol-attachment-mini-readonly/index.vue`
### Task 4: 预产及在途卡片接入
**Files:**
- Modify: `web-admin/src/views/quality-inspection/pre-transit-sample/PreTransitProtocolCardList.vue`
- Modify: `web-admin/src/views/quality-inspection/pre-transit-sample/index.vue`
### Task 5: 样本接收卡片接入
**Files:**
- Modify: `web-admin/src/views/quality-inspection/sample-reception/SampleReceptionCardList.vue`
### Task 6: 验证
- [ ] `pnpm lint` 相关前端文件
- [ ] `./scripts/update-graph.sh frontend`(如有新建文件)