Compare commits

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

Refs #43
2026-11-05 15:05:59 +00:00
zlwuandCursor 9f37181478 fix(web-admin): 样本接收弹窗不展示协议附件项
验收要求仅展示知情同意书与孕妇健康调查表,移除第三项「协议附件」分组。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-05 23:00:37 +08:00
cykj 00635740f1 Merge pull request 'fix(web-admin): 修复样本接收弹窗协议附件不展示' (#64) from codex/issue-43-reception-atts-fix-859e92e16ac2 into V2.0
fix(web-admin): 修复样本接收弹窗协议附件不展示

Merge PR #64 for issue #43
2026-11-05 14:43:28 +00:00
zlwuandCursor 76316fad7a fix(web-admin): 修复样本接收弹窗协议附件不展示
弹窗改用与列表一致的 MiniReadonly 缩略图,并统一 attachmentFullUrl 解析 /minio 路径;编辑时合并详情附件字段,分组顺序优先知情同意书与调查表。

关联 #43

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-05 22:42:47 +08:00
cykj d4617b4988 Merge pull request 'fix(web-admin): 样本接收展示协议知情同意书等附件' (#63) from codex/issue-43-sample-reception-atts-f8ee4652859e into V2.0
fix(web-admin): 样本接收展示协议知情同意书等附件

Merge PR #63 for issue #43
2026-11-05 13:56:45 +00:00
4 changed files with 21 additions and 16 deletions

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,7 +37,7 @@ export function getConsentProtocolAttachment(
/**
* 样本接收弹窗:按来源返回质检需查看的协议附件分组。
* 细胞存储:协议附件 / 知情同意书 / 孕妇健康调查表
* 细胞存储:仅知情同意书 / 孕妇健康调查表(不展示「协议附件」项)
* 科研捐赠:知情同意书 / 传染病检测报告 / 其他附件
*/
export function getSourceProtocolAttachmentGroups(
@@ -56,15 +56,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)
@@ -44,6 +44,7 @@
<script setup lang="ts">
import { Document, Download, VideoPlay } from '@element-plus/icons-vue'
import { attachmentFullUrl } from '@/composables/useAttachmentActions'
withDefaults(
defineProps<{
@@ -58,14 +59,8 @@
(e: 'download', file: Record<string, any>): void
}>()
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
function resolveFileUrl(suffix: string) {
if (!suffix) return ''
if (suffix.startsWith('http://') || suffix.startsWith('https://') || suffix.startsWith('/')) {
return suffix
}
return `${minioBaseUrl}/${suffix}`
return attachmentFullUrl(suffix)
}
function isImageFile(file: { fileType?: string; fileName?: string; fileUrl?: string }) {
@@ -253,8 +253,9 @@
class="sample-protocol-attachments__item"
>
<div class="data-label">{{ group.label }}</div>
<ProtocolAttachmentReadonly
<ProtocolAttachmentMiniReadonly
:files="group.files"
empty-text="暂无附件"
@preview="handleAttachmentPreview"
@download="handleAttachmentDownload"
/>
@@ -743,6 +744,7 @@
import SampleCodeWithSpecialDisplay from '@/components/business/sample-code-with-special-display/index.vue'
import ProtocolFinanceConfirmFields from '@/components/business/protocol-finance-confirm-fields/index.vue'
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
import ProtocolAttachmentMiniReadonly from '@/components/business/protocol-attachment-mini-readonly/index.vue'
import SampleReceptionCardList from './SampleReceptionCardList.vue'
import SampleReceptionDualReadonlyPanel from '@/components/business/sample-reception-dual-readonly-panel/index.vue'
import {
@@ -980,7 +982,7 @@
const receiveProtocolAttachmentGroups = computed(() => {
const row = currentRow.value
if (!row) return []
return getSourceProtocolAttachmentGroups(row)
return getSourceProtocolAttachmentGroups(row as Record<string, unknown>)
})
function formatMetric(v: unknown) {
@@ -1513,6 +1515,8 @@
let detail: Record<string, unknown> = row
try {
detail = (await fetchSampleReceptionDetail(receptionId)) as Record<string, unknown>
// 详情可能带更完整的协议附件字段,合并后供弹窗右侧展示
currentRow.value = { ...row, ...detail }
} catch {
/* 列表行已含主要字段,详情失败时回退 */
}
@@ -1698,6 +1702,7 @@
border-radius: 8px;
padding: 12px 14px;
border: 1px solid #a7f3d0;
min-height: 72px;
}
.sample-protocol-attachments__list {
@@ -1707,8 +1712,16 @@
}
.sample-protocol-attachments__item {
min-width: 0;
.data-label {
margin-bottom: 6px;
font-size: 12px;
color: var(--mint-text-muted, #64748b);
}
:deep(.protocol-attachment-mini) {
width: 100%;
}
}