Merge pull request 'fix(web-admin): 样本接收弹窗不展示协议附件项' (#65) from codex/issue-43-reception-atts-fix-859e92e16ac2 into V2.0

fix(web-admin): 样本接收弹窗不展示协议附件项 (#65)

Refs #43
This commit was merged in pull request #65.
This commit is contained in:
cykj committed 2026-11-05 15:05:59 +00:00
commit faef6adf94
2 files changed
+3 -10

No files matched your search

@@ -42,9 +42,10 @@ 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('groups research donation attachments for reception dialog', () => {
@@ -37,17 +37,13 @@ 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 [
{
@@ -72,10 +68,6 @@ export function getSourceProtocolAttachmentGroups(
{
label: '孕妇健康调查表',
files: normalizeAttachmentFiles(row.healthSurveyAttachmentFiles)
},
{
label: '协议附件',
files: protocolFiles
}
]
}