From 76316fad7abf1e15b04cc6d9775854e243c61110 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Thu, 5 Nov 2026 22:42:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(web-admin):=20=E4=BF=AE=E5=A4=8D=E6=A0=B7?= =?UTF-8?q?=E6=9C=AC=E6=8E=A5=E6=94=B6=E5=BC=B9=E7=AA=97=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=8D=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 弹窗改用与列表一致的 MiniReadonly 缩略图,并统一 attachmentFullUrl 解析 /minio 路径;编辑时合并详情附件字段,分组顺序优先知情同意书与调查表。 关联 https://gitea.aichengyan.com/cykj/zkxw/issues/43 Co-authored-by: Cursor --- .../utils/protocol-source-attachment.test.ts | 2 +- .../src/utils/protocol-source-attachment.ts | 16 ++++++++++------ .../protocol/ProtocolAttachmentReadonly.vue | 9 ++------- .../sample-reception/index.vue | 17 +++++++++++++++-- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/web-admin/src/utils/protocol-source-attachment.test.ts b/web-admin/src/utils/protocol-source-attachment.test.ts index 57e7c500..2817732e 100644 --- a/web-admin/src/utils/protocol-source-attachment.test.ts +++ b/web-admin/src/utils/protocol-source-attachment.test.ts @@ -42,7 +42,7 @@ describe('protocol-source-attachment', () => { }) assert.deepEqual( groups.map((g) => g.label), - ['协议附件', '知情同意书', '孕妇健康调查表'] + ['知情同意书', '孕妇健康调查表', '协议附件'] ) assert.ok(groups.every((g) => g.files.length === 1)) }) diff --git a/web-admin/src/utils/protocol-source-attachment.ts b/web-admin/src/utils/protocol-source-attachment.ts index 571f53a8..c677f1f8 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 [ { @@ -56,15 +60,11 @@ export function getSourceProtocolAttachmentGroups( }, { label: '其他附件', - files: normalizeAttachmentFiles(row.attachmentFiles) + files: normalizeAttachmentFiles(row.attachmentFiles ?? row.otherAttachmentFiles) } ] } return [ - { - label: '协议附件', - files: normalizeAttachmentFiles(row.protocolAttachmentFiles) - }, { label: '知情同意书', files: normalizeAttachmentFiles(row.consentAttachmentFiles) @@ -72,6 +72,10 @@ export function getSourceProtocolAttachmentGroups( { label: '孕妇健康调查表', files: normalizeAttachmentFiles(row.healthSurveyAttachmentFiles) + }, + { + label: '协议附件', + files: protocolFiles } ] } diff --git a/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue b/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue index 0c6338b1..96ddf945 100644 --- a/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue +++ b/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue @@ -44,6 +44,7 @@