fix(web-admin): 修复样本接收弹窗协议附件不展示
弹窗改用与列表一致的 MiniReadonly 缩略图,并统一 attachmentFullUrl 解析 /minio 路径;编辑时合并详情附件字段,分组顺序优先知情同意书与调查表。 关联 #43 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d4617b4988
commit
76316fad7a
4 files changed
+28
-16
No files matched your search
@@ -37,13 +37,17 @@ export function getConsentProtocolAttachment(
|
||||
|
||||
/**
|
||||
* 样本接收弹窗:按来源返回质检需查看的协议附件分组。
|
||||
* 细胞存储:协议附件 / 知情同意书 / 孕妇健康调查表
|
||||
* 细胞存储:知情同意书 / 孕妇健康调查表 / 协议附件(评论优先前两项)
|
||||
* 科研捐赠:知情同意书 / 传染病检测报告 / 其他附件
|
||||
* 兼容 attachments 别名(协议详情字段名)。
|
||||
*/
|
||||
export function getSourceProtocolAttachmentGroups(
|
||||
row: Record<string, unknown>
|
||||
): 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
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user