From 67a209298c7fafa01c278b6ed075d59bedbe3920 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Mon, 9 Nov 2026 13:57:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(web-admin):=20=E6=A0=B7=E6=9C=AC=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E5=BC=B9=E7=AA=97=E6=81=A2=E5=A4=8D=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 验收反馈要求协议附件可见;细胞存储分组恢复为知情同意书、孕妇健康调查表、协议附件三项。 Co-authored-by: Cursor --- .../src/utils/protocol-source-attachment.test.ts | 13 +++++++++++-- web-admin/src/utils/protocol-source-attachment.ts | 10 +++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/web-admin/src/utils/protocol-source-attachment.test.ts b/web-admin/src/utils/protocol-source-attachment.test.ts index 8bffcb85..60e82a6d 100644 --- a/web-admin/src/utils/protocol-source-attachment.test.ts +++ b/web-admin/src/utils/protocol-source-attachment.test.ts @@ -42,10 +42,19 @@ describe('protocol-source-attachment', () => { }) assert.deepEqual( groups.map((g) => g.label), - ['知情同意书', '孕妇健康调查表'] + ['知情同意书', '孕妇健康调查表', '协议附件'] ) assert.ok(groups.every((g) => g.files.length === 1)) - assert.equal(groups.length, 2) + }) + + it('accepts attachments alias for cell storage protocol files', () => { + const groups = getSourceProtocolAttachmentGroups({ + sourceType: 'cell_storage', + attachments: [{ id: 'alias' }] + }) + const protocol = groups.find((g) => g.label === '协议附件') + assert.ok(protocol) + assert.equal(protocol.files.length, 1) }) it('groups research donation attachments for reception dialog', () => { diff --git a/web-admin/src/utils/protocol-source-attachment.ts b/web-admin/src/utils/protocol-source-attachment.ts index 84a8b635..cfcd2eba 100644 --- a/web-admin/src/utils/protocol-source-attachment.ts +++ b/web-admin/src/utils/protocol-source-attachment.ts @@ -37,13 +37,17 @@ export function getConsentProtocolAttachment( /** * 样本接收弹窗:按来源返回质检需查看的协议附件分组。 - * 细胞存储:仅知情同意书 / 孕妇健康调查表(不展示「协议附件」项) + * 细胞存储:知情同意书 / 孕妇健康调查表 / 协议附件 * 科研捐赠:知情同意书 / 传染病检测报告 / 其他附件 + * 兼容 attachments 别名(协议详情字段名)。 */ export function getSourceProtocolAttachmentGroups( row: Record ): ProtocolSourceAttachmentMeta[] { const source = String(row.sourceType || 'cell_storage').trim() + const protocolFiles = normalizeAttachmentFiles( + row.protocolAttachmentFiles ?? row.attachments + ) if (source === 'research_donation') { return [ { @@ -68,6 +72,10 @@ export function getSourceProtocolAttachmentGroups( { label: '孕妇健康调查表', files: normalizeAttachmentFiles(row.healthSurveyAttachmentFiles) + }, + { + label: '协议附件', + files: protocolFiles } ] } -- 2.54.0