Merge pull request 'fix(web-admin): 样本接收弹窗恢复展示协议附件' (#73) into V2.0
fix(web-admin): 样本接收弹窗恢复展示协议附件 (#73) Refs #43
This commit was merged in pull request #73.
This commit is contained in:
commit
c7905b5da0
2 files changed
+20
-3
No files matched your search
@@ -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', () => {
|
||||
|
||||
@@ -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 [
|
||||
{
|
||||
@@ -68,6 +72,10 @@ export function getSourceProtocolAttachmentGroups(
|
||||
{
|
||||
label: '孕妇健康调查表',
|
||||
files: normalizeAttachmentFiles(row.healthSurveyAttachmentFiles)
|
||||
},
|
||||
{
|
||||
label: '协议附件',
|
||||
files: protocolFiles
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user