| | |
| | | <span class="section-title">附件信息</span> |
| | | </div> |
| | | <div class="detail-attachments"> |
| | | <div |
| | | v-for="group in attachmentGroups" |
| | | :key="group.label" |
| | | class="attachment-group" |
| | | > |
| | | <div class="attachment-group-title">{{ group.label }}</div> |
| | | <div class="attachment-grid"> |
| | | <div |
| | | v-for="file in caseData.annexfilesList" |
| | | v-for="file in group.files" |
| | | :key="file.id || file.fileName" |
| | | class="attachment-card" |
| | | > |
| | |
| | | </div> |
| | | </el-card> |
| | | </template> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | .filter(file => this.isImageFile(file.fileName || file.path)) |
| | | .map(file => this.getFileUrl(file)) |
| | | .filter(url => url); |
| | | }, |
| | | // 按分类分组附件(捐献者登记阶段:登记表附件/证件照/疾病诊断治疗) |
| | | attachmentGroups() { |
| | | const list = this.caseData.annexfilesList; |
| | | if (!Array.isArray(list) || list.length === 0) return []; |
| | | const categories = [ |
| | | { value: "登记表附件", label: "人体器官潜在捐献者登记表附件" }, |
| | | { value: "证件照", label: "证件照" }, |
| | | { value: "疾病诊断治疗", label: "疾病诊断治疗" } |
| | | ]; |
| | | const groups = categories |
| | | .map(cat => ({ |
| | | label: cat.label, |
| | | files: list.filter(f => (f.fileType || "").trim() === cat.value) |
| | | })) |
| | | .filter(group => group.files.length > 0); |
| | | // 未分类附件兜底,避免丢失旧数据 |
| | | const classifiedValues = categories.map(c => c.value); |
| | | const unclassified = list.filter(f => { |
| | | const t = (f.fileType || "").trim(); |
| | | return !t || !classifiedValues.includes(t); |
| | | }); |
| | | if (unclassified.length > 0) { |
| | | groups.push({ label: "未分类", files: unclassified }); |
| | | } |
| | | return groups; |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | padding: 10px 0; |
| | | } |
| | | |
| | | .attachment-group { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .attachment-group-title { |
| | | font-size: 14px; |
| | | font-weight: bold; |
| | | color: #409eff; |
| | | margin-bottom: 12px; |
| | | padding-left: 10px; |
| | | border-left: 3px solid #409eff; |
| | | } |
| | | |
| | | .attachment-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); |