| | |
| | | import { |
| | | createEmptyNode, |
| | | formatDisplayTime, |
| | | mapNodesFromApi, |
| | | mapSignModeFromApi, |
| | | mapSignModeToApi, |
| | | normalizeFlowNodes, |
| | | nodeSignModeLabel, |
| | | } from "../approve-template/approveTemplateConstants.js"; |
| | | import { createEmptyNode, formatDisplayTime, mapNodesFromApi, mapSignModeFromApi, mapSignModeToApi, normalizeFlowNodes, nodeSignModeLabel } from "../approve-template/approveTemplateConstants.js"; |
| | | import { buildFormPayloadFromFields, parseFormConfigToData } from "../approve-template/formConfigUtils.js"; |
| | | import { isDynamicOptionSource, resolveSelectDisplayLabel } from "../approve-template/selectOptionSource.js"; |
| | | import { appendDotNotationQuery, buildApprovalInstanceSearchDto } from "../approve-shared/approvalInstanceListSearch.js"; |
| | | |
| | | /** 审批类型(与后端字段 approvalType 对齐,后期可同步) */ |
| | | export const APPROVAL_TYPE_OPTIONS = [ |
| | |
| | | { value: "procurement", label: "采购审批", cellBg: "#f4f4f5", cellColor: "#909399" }, |
| | | { value: "quotation", label: "报价审批", cellBg: "#f4ecfc", cellColor: "#9b59b6" }, |
| | | { value: "shipment", label: "发货审批", cellBg: "#e8faf6", cellColor: "#1abc9c" }, |
| | | { value: "enterprise_news", label: "企业新闻", cellBg: "#ecf5ff", cellColor: "#409eff" }, |
| | | ]; |
| | | |
| | | /** 审批状态 approvalStatus */ |
| | | /** 列表查询:审批状态(与后端 status 枚举一致) */ |
| | | export const APPROVAL_STATUS_SEARCH_OPTIONS = [ |
| | | { value: "DRAFT", label: "草稿" }, |
| | | { value: "PENDING", label: "待审批" }, |
| | | { value: "APPROVED", label: "已通过" }, |
| | | { value: "REJECTED", label: "已驳回" }, |
| | | ]; |
| | | |
| | | /** |
| | | * 审批状态展示(与后端 status 枚举一致) |
| | | * DRAFT→草稿 PENDING→待审批/进行中 APPROVED→已通过/已完成 REJECTED→已驳回 |
| | | */ |
| | | export const APPROVAL_STATUS_OPTIONS = [ |
| | | { value: "pending", label: "审核中" }, |
| | | { value: "approved", label: "已通过" }, |
| | | { value: "rejected", label: "已驳回" }, |
| | | { value: "cancelled", label: "已撤销" }, |
| | | { value: "draft", api: "DRAFT", label: "草稿" }, |
| | | { value: "pending", api: "PENDING", label: "待审批" }, |
| | | { value: "approved", api: "APPROVED", label: "已通过" }, |
| | | { value: "rejected", api: "REJECTED", label: "已驳回" }, |
| | | { value: "cancelled", api: "CANCELLED", label: "已撤销" }, |
| | | ]; |
| | | |
| | | export const LEGACY_APPROVE_LIST_STORAGE_KEY = "oa_unified_approve_list_v1"; |
| | | /** 数字状态码(部分后端用 0/1/2) */ |
| | | const STATUS_NUMERIC_MAP = { |
| | | 0: "pending", |
| | | 1: "approved", |
| | | 2: "rejected", |
| | | 3: "cancelled", |
| | | 4: "cancelled", |
| | | }; |
| | | |
| | | export function clearLegacyApproveListStorage() { |
| | | try { |
| | | localStorage.removeItem(LEGACY_APPROVE_LIST_STORAGE_KEY); |
| | | } catch { |
| | | /* ignore */ |
| | | /** 后端 status / 页面 approvalStatus → 统一页面 key(pending | approved | rejected | cancelled) */ |
| | | export function normalizeApprovalStatusKey(v) { |
| | | if (v == null || v === "") return "pending"; |
| | | if (typeof v === "number" || (typeof v === "string" && /^\d+$/.test(v.trim()))) { |
| | | const numKey = STATUS_NUMERIC_MAP[Number(v)]; |
| | | if (numKey) return numKey; |
| | | } |
| | | const s = String(v).trim(); |
| | | if (!s) return "pending"; |
| | | const upper = s.toUpperCase(); |
| | | if (upper === "DRAFT") return "draft"; |
| | | if (upper === "PUBLISHED") return "approved"; |
| | | if (upper === "OFFLINE") return "cancelled"; |
| | | if (upper === "APPROVED" || upper === "APPROVE" || upper === "PASS" || upper === "AGREE") { |
| | | return "approved"; |
| | | } |
| | | if (upper === "REJECTED" || upper === "REJECT" || upper === "REFUSE" || upper === "REFUSED" || upper === "DENIED") { |
| | | return "rejected"; |
| | | } |
| | | if (upper === "CANCELLED" || upper === "CANCEL" || upper === "REVOKED") return "cancelled"; |
| | | if (upper === "PENDING" || upper === "IN_PROGRESS" || upper === "PROCESSING" || upper === "RUNNING" || upper === "WAIT" || upper === "WAITING") { |
| | | return "pending"; |
| | | } |
| | | if (s.includes("草稿")) return "draft"; |
| | | if (s.includes("驳回") || s.includes("拒绝")) return "rejected"; |
| | | if (s.includes("下线")) return "cancelled"; |
| | | if (s.includes("撤销")) return "cancelled"; |
| | | if (s.includes("发布") || s.includes("通过") || s.includes("完成")) return "approved"; |
| | | if (s.includes("待审") || s.includes("进行中") || s.includes("审批中")) return "pending"; |
| | | const lower = s.toLowerCase(); |
| | | if (["draft", "pending", "approved", "rejected", "cancelled"].includes(lower)) return lower; |
| | | return "pending"; |
| | | } |
| | | |
| | | /** 从列表/详情行解析后端原始状态(兼容多字段命名) */ |
| | | export function resolveInstanceStatusRaw(row) { |
| | | if (!row || typeof row !== "object") return ""; |
| | | const candidates = [ |
| | | row.status, |
| | | row.statusRaw, |
| | | row.approvalStatus, |
| | | row.statusName, |
| | | row.statusLabel, |
| | | row.approvalStatusName, |
| | | row.statusDesc, |
| | | row.instanceStatus, |
| | | row.approvalInstanceStatus, |
| | | row.approveStatus, |
| | | row.auditStatus, |
| | | row.approvalInstance?.status, |
| | | row.approvalInstanceVo?.status, |
| | | ]; |
| | | for (const c of candidates) { |
| | | if (c != null && c !== "") return c; |
| | | } |
| | | const tasks = row.tasks; |
| | | if (Array.isArray(tasks) && tasks.length) { |
| | | const rejected = tasks.some(t => normalizeApprovalStatusKey(t?.status ?? t?.taskStatus) === "rejected"); |
| | | if (rejected) return "REJECTED"; |
| | | const allApproved = tasks.every(t => normalizeApprovalStatusKey(t?.status ?? t?.taskStatus) === "approved"); |
| | | if (allApproved) return "APPROVED"; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** 提交弹窗:模板卡片(来自后端列表) */ |
| | |
| | | /** 后端 records → 时间线展示结构 */ |
| | | export function mapRecordsFromApi(records) { |
| | | const list = Array.isArray(records) ? records : []; |
| | | return list.map((r) => ({ |
| | | return list.map(r => ({ |
| | | id: r.id, |
| | | operatorName: r.approverName || r.operatorName || r.createUserName || "", |
| | | result: mapRecordResultFromApi(r.approveAction ?? r.action ?? r.status), |
| | |
| | | } |
| | | |
| | | export function mapTaskStatusLabel(status) { |
| | | const s = String(status || "").toUpperCase(); |
| | | if (s === "APPROVED") return "已通过"; |
| | | if (s === "REJECTED") return "已驳回"; |
| | | if (s === "PENDING") return "待审批"; |
| | | if (s === "CANCELLED") return "已撤销"; |
| | | return status || "—"; |
| | | return approvalStatusLabel(status); |
| | | } |
| | | |
| | | export function mapTaskStatusTagType(status) { |
| | | const s = String(status || "").toUpperCase(); |
| | | if (s === "APPROVED") return "success"; |
| | | if (s === "REJECTED") return "danger"; |
| | | if (s === "CANCELLED") return "info"; |
| | | return "warning"; |
| | | return approvalStatusTagType(status); |
| | | } |
| | | |
| | | /** 后端 tasks → 页面 flowNodes(按 levelNo 分组,供流程编辑/展示) */ |
| | |
| | | const list = Array.isArray(tasks) ? tasks : []; |
| | | if (!list.length) return []; |
| | | const byLevel = new Map(); |
| | | list.forEach((t) => { |
| | | list.forEach(t => { |
| | | const level = Number(t.levelNo ?? t.taskLevel ?? t.nodeOrder ?? 1); |
| | | if (!byLevel.has(level)) { |
| | | byLevel.set(level, { |
| | |
| | | node.signMode = mapSignModeFromApi(t.approveType); |
| | | } |
| | | }); |
| | | return [...byLevel.entries()] |
| | | .sort(([a], [b]) => a - b) |
| | | .map(([, node]) => node); |
| | | return [...byLevel.entries()].sort(([a], [b]) => a - b).map(([, node]) => node); |
| | | } |
| | | |
| | | /** 页面 flowNodes → 后端 tasks */ |
| | | export function mapFlowNodesToTasks(flowNodes, { instanceId, templateId } = {}) { |
| | | const nodes = normalizeFlowNodes(flowNodes); |
| | | const tasks = []; |
| | | nodes.forEach((n) => { |
| | | nodes.forEach(n => { |
| | | const levelNo = n.nodeOrder ?? 1; |
| | | const approveType = mapSignModeToApi(n.signMode); |
| | | n.approvers.forEach((a, idx) => { |
| | |
| | | return "text"; |
| | | } |
| | | |
| | | /** 单字段展示值(详情只读) */ |
| | | export function formatFieldDisplayValue(field, val) { |
| | | /** |
| | | * 单字段展示值(详情只读、列表主表) |
| | | * @param {object} [caches] 人员/部门下拉缓存,用于解析「人员列表」类字段为姓名 |
| | | */ |
| | | export function formatFieldDisplayValue(field, val, caches) { |
| | | if (val == null || val === "" || (Array.isArray(val) && !val.length)) return "—"; |
| | | if (field?.type === "select" && isDynamicOptionSource(field.optionSource)) { |
| | | const label = resolveSelectDisplayLabel(field, val, caches || {}); |
| | | if (label && label !== "—") return label; |
| | | return String(val); |
| | | } |
| | | if (field?.type === "select" && field.options?.length) { |
| | | const hit = field.options.find((o) => String(o.value) === String(val)); |
| | | const hit = field.options.find(o => String(o.value) === String(val)); |
| | | return hit?.label || String(val); |
| | | } |
| | | if (Array.isArray(val)) return val.join(" 至 "); |
| | |
| | | }; |
| | | if (!fields.length && Object.keys(formPayload).length) { |
| | | fields = Object.keys(formPayload) |
| | | .filter((k) => k && k !== "summary") |
| | | .map((k) => ({ |
| | | .filter(k => k && k !== "summary") |
| | | .map(k => ({ |
| | | key: k, |
| | | label: k, |
| | | type: guessFieldTypeFromValue(formPayload[k]), |
| | |
| | | export function buildInstanceDto({ submitForm, activeTemplate, userStore, flowNodes, existingRow }) { |
| | | const payload = submitForm?.formPayload || {}; |
| | | const tpl = activeTemplate || {}; |
| | | const title = |
| | | String(payload.summary || payload.title || "").trim() || |
| | | tpl.label || |
| | | submitForm?.templateName || |
| | | "审批申请"; |
| | | const title = String(payload.summary || payload.title || "").trim() || tpl.label || submitForm?.templateName || "审批申请"; |
| | | const templateId = submitForm?.templateId || tpl.templateId; |
| | | const instanceId = existingRow?.id ?? submitForm?.instanceId; |
| | | const taskList = mapFlowNodesToTasks(flowNodes || submitForm?.flowNodes, { |
| | |
| | | tasks: taskList, |
| | | }; |
| | | |
| | | const attachments = (Array.isArray(submitForm?.storageBlobDTOs) && submitForm.storageBlobDTOs.length ? submitForm.storageBlobDTOs : null) || tpl.storageBlobDTOs; |
| | | if (attachments?.length) dto.storageBlobDTOs = attachments; |
| | | |
| | | if (isUpdate) { |
| | | dto.id = existingRow?.id ?? submitForm?.instanceId; |
| | | dto.instanceNo = existingRow?.instanceNo ?? submitForm?.instanceNo ?? ""; |
| | | dto.status = |
| | | existingRow?.statusRaw || mapInstanceStatusToApi(existingRow?.approvalStatus) || "PENDING"; |
| | | dto.status = submitForm?.saveStatusApi || existingRow?.statusRaw || mapInstanceStatusToApi(existingRow?.approvalStatus) || "PENDING"; |
| | | dto.currentLevel = existingRow?.currentLevel ?? submitForm?.currentLevel ?? 1; |
| | | dto.applicantId = existingRow?.applicantId ?? existingRow?.applicantNo; |
| | | dto.applicantName = existingRow?.applicantName || ""; |
| | | } else { |
| | | dto.status = "PENDING"; |
| | | dto.status = submitForm?.saveStatusApi || "PENDING"; |
| | | dto.currentLevel = 1; |
| | | dto.applicantId = userStore?.id; |
| | | dto.applicantName = userStore?.nickName || userStore?.name || ""; |
| | | } |
| | | return dto; |
| | | } |
| | | |
| | | /** @deprecated 使用 buildInstanceDto */ |
| | | export function buildSaveInstanceDto(params) { |
| | | return buildInstanceDto(params); |
| | | } |
| | | |
| | | /** 校验提交审批流程(与模板页规则一致) */ |
| | |
| | | |
| | | /** 后端 status → 页面 approvalStatus */ |
| | | export function mapInstanceStatusFromApi(status) { |
| | | const s = String(status || "").toUpperCase(); |
| | | if (s === "APPROVED") return "approved"; |
| | | if (s === "REJECTED") return "rejected"; |
| | | if (s === "CANCELLED") return "cancelled"; |
| | | return "pending"; |
| | | return normalizeApprovalStatusKey(status); |
| | | } |
| | | |
| | | /** 列表/详情行 → 页面 approvalStatus key */ |
| | | export function mapInstanceApprovalStatusFromRow(row) { |
| | | const raw = resolveInstanceStatusRaw(row); |
| | | return normalizeApprovalStatusKey(raw); |
| | | } |
| | | |
| | | /** 页面 approvalStatus → 后端 status */ |
| | | export function mapInstanceStatusToApi(approvalStatus) { |
| | | const s = String(approvalStatus || "").toLowerCase(); |
| | | if (s === "approved") return "APPROVED"; |
| | | if (s === "rejected") return "REJECTED"; |
| | | if (s === "cancelled") return "CANCELLED"; |
| | | return "PENDING"; |
| | | const key = normalizeApprovalStatusKey(approvalStatus); |
| | | const hit = APPROVAL_STATUS_OPTIONS.find(x => x.value === key); |
| | | return hit?.api || "PENDING"; |
| | | } |
| | | |
| | | export function unwrapInstancePage(res) { |
| | |
| | | /** 分页列表项 → 表格行 */ |
| | | export function mapInstanceFromApi(row) { |
| | | if (!row) return {}; |
| | | const approvalStatus = mapInstanceStatusFromApi(row.status); |
| | | const statusRaw = resolveInstanceStatusRaw(row); |
| | | const approvalStatus = normalizeApprovalStatusKey(statusRaw); |
| | | const createTime = formatDisplayTime(row.createTime ?? row.applyTime ?? ""); |
| | | const applyTime = formatDisplayTime(row.applyTime ?? ""); |
| | | const finishTime = formatDisplayTime(row.finishTime ?? ""); |
| | | const resolved = resolveInstanceFormFields(row); |
| | | const { fields, formPayload, templateSnapshot } = resolved; |
| | | const tasks = Array.isArray(row.tasks) ? row.tasks : []; |
| | | const flowNodes = tasks.length |
| | | ? mapTasksToFlowNodes(tasks) |
| | | : mapNodesFromApi(row.nodes || row.flowNodes); |
| | | const flowNodes = tasks.length ? mapTasksToFlowNodes(tasks) : mapNodesFromApi(row.nodes || row.flowNodes); |
| | | const approvalRecords = mapRecordsFromApi(row.records); |
| | | return { |
| | | id: row.id, |
| | |
| | | applicantId: row.applicantId, |
| | | applicantNo: row.applicantId != null ? String(row.applicantId) : "", |
| | | applicantName: row.applicantName || "", |
| | | approvalType: row.templateName || "", |
| | | approvalType: row.approvalType || row.templateName || "", |
| | | unread: Boolean(row.isApprove) && approvalStatus === "pending", |
| | | isApprove: Boolean(row.isApprove), |
| | | approvalStatus, |
| | | statusRaw: row.status, |
| | | statusRaw: statusRaw || row.status, |
| | | createTime, |
| | | applyTime: applyTime === "—" ? "" : applyTime, |
| | | finishTime: finishTime === "—" ? "" : finishTime, |
| | |
| | | templateSnapshot, |
| | | tasks, |
| | | records: Array.isArray(row.records) ? row.records : [], |
| | | storageBlobVOList: row.storageBlobVOList || [], |
| | | storageBlobDTOs: row.storageBlobVOList || row.storageBlobDTOs || [], |
| | | flowNodes, |
| | | approvalFlowNodes: [], |
| | | currentNodeIndex: 0, |
| | | approvalRecords, |
| | | rejectReason: |
| | | approvalRecords.find((r) => r.result === "rejected")?.opinion || "", |
| | | rejectReason: approvalRecords.find(r => r.result === "rejected")?.opinion || "", |
| | | purchaseContractNumber: row.purchaseContractNumber || "", |
| | | quotationNo: row.quotationNo || "", |
| | | shippingNo: row.shippingNo || "", |
| | | }; |
| | | } |
| | | |
| | |
| | | }; |
| | | } |
| | | |
| | | export function buildApprovalInstanceListParams({ page, searchForm }) { |
| | | export function buildApprovalInstanceListParams({ page, searchForm, businessType, extraParams }) { |
| | | const dto = buildApprovalInstanceSearchDto(searchForm, extraParams); |
| | | const bizType = businessType ?? searchForm?.businessType; |
| | | if (bizType != null && bizType !== "") { |
| | | dto.businessType = bizType; |
| | | } |
| | | |
| | | const params = { |
| | | current: page.current, |
| | | size: page.size, |
| | | "page.current": page.current, |
| | | "page.size": page.size, |
| | | ...dto, |
| | | }; |
| | | const dto = {}; |
| | | const kw = (searchForm?.applicantKeyword || "").trim(); |
| | | if (kw) dto.applicantName = kw; |
| | | if (searchForm?.approvalType) { |
| | | const opt = APPROVAL_TYPE_OPTIONS.find((x) => x.value === searchForm.approvalType); |
| | | if (opt?.label) dto.templateName = opt.label; |
| | | } |
| | | if (Object.keys(dto).length) params.approvalInstanceDto = dto; |
| | | appendDotNotationQuery(params, "approvalInstanceDto", dto); |
| | | return params; |
| | | } |
| | | |
| | | export function approvalTypeLabel(v) { |
| | | return APPROVAL_TYPE_OPTIONS.find((x) => x.value === v)?.label || v || "—"; |
| | | return APPROVAL_TYPE_OPTIONS.find(x => x.value === v)?.label || v || "—"; |
| | | } |
| | | |
| | | export function approvalTypeStyle(v) { |
| | | const hit = APPROVAL_TYPE_OPTIONS.find((x) => x.value === v); |
| | | const hit = APPROVAL_TYPE_OPTIONS.find(x => x.value === v); |
| | | if (!hit) return {}; |
| | | return { |
| | | backgroundColor: hit.cellBg, |
| | |
| | | } |
| | | |
| | | export function approvalStatusLabel(v) { |
| | | return APPROVAL_STATUS_OPTIONS.find((x) => x.value === v)?.label || "—"; |
| | | const key = normalizeApprovalStatusKey(v); |
| | | return APPROVAL_STATUS_OPTIONS.find(x => x.value === key)?.label || "—"; |
| | | } |
| | | |
| | | /** 业务申请页状态文案:PENDING→进行中 APPROVED→已完成 REJECTED→已驳回 */ |
| | | export function businessApprovalStatusLabel(v) { |
| | | const key = normalizeApprovalStatusKey(v); |
| | | if (key === "draft") return "草稿"; |
| | | if (key === "pending") return "进行中"; |
| | | if (key === "approved") return "已完成"; |
| | | if (key === "rejected") return "已驳回"; |
| | | if (key === "cancelled") return "已撤销"; |
| | | return "—"; |
| | | } |
| | | |
| | | /** |
| | | * 业务申请页是否允许修改(五个申请页) |
| | | * 进行中(PENDING)、已完成(APPROVED) 不可修改;已驳回、已撤销等可修改 |
| | | */ |
| | | export function canEditBusinessInstanceRow(row) { |
| | | const key = normalizeApprovalStatusKey(row?.approvalStatus ?? row?.statusRaw ?? row?.status); |
| | | return key !== "pending" && key !== "approved"; |
| | | } |
| | | |
| | | export function businessApprovalStatusTagType(v) { |
| | | const key = normalizeApprovalStatusKey(v); |
| | | if (key === "draft") return "info"; |
| | | if (key === "approved") return "success"; |
| | | if (key === "rejected") return "danger"; |
| | | if (key === "cancelled") return "info"; |
| | | return "warning"; |
| | | } |
| | | |
| | | export function approvalStatusTagType(v) { |
| | | if (v === "approved") return "success"; |
| | | if (v === "rejected") return "danger"; |
| | | if (v === "cancelled") return "info"; |
| | | return "primary"; |
| | | } |
| | | |
| | | export function unreadLabel(v) { |
| | | return v ? "是" : "否"; |
| | | const key = normalizeApprovalStatusKey(v); |
| | | if (key === "draft") return "info"; |
| | | if (key === "approved") return "success"; |
| | | if (key === "rejected") return "danger"; |
| | | if (key === "cancelled") return "info"; |
| | | return "warning"; |
| | | } |
| | | |
| | | /** 列表行 → 编辑表单(仅用行数据回显) */ |
| | | export function buildEditFormFromInstanceRow(row) { |
| | | const { fields, formPayload, templateSnapshot } = resolveInstanceFormFields(row); |
| | | const normalized = normalizeFlowNodes( |
| | | row?.flowNodes?.length ? row.flowNodes : mapTasksToFlowNodes(row?.tasks) |
| | | ); |
| | | const flowNodes = normalized.length |
| | | ? JSON.parse(JSON.stringify(normalized)) |
| | | : [createEmptyNode(1)]; |
| | | const normalized = normalizeFlowNodes(row?.flowNodes?.length ? row.flowNodes : mapTasksToFlowNodes(row?.tasks)); |
| | | const flowNodes = normalized.length ? JSON.parse(JSON.stringify(normalized)) : [createEmptyNode(1)]; |
| | | |
| | | return { |
| | | templateKey: String(row?.templateId || ""), |
| | |
| | | formFieldDefs: fields, |
| | | formPayload, |
| | | flowNodes, |
| | | templateAttachments: initTemplateAttachmentsFromSnapshot(templateSnapshot), |
| | | storageBlobDTOs: (row?.storageBlobDTOs?.length ? row.storageBlobDTOs : row?.storageBlobVOList || []).map(f => JSON.parse(JSON.stringify(f))), |
| | | }; |
| | | } |
| | | |
| | |
| | | const tpl = templateOverride || null; |
| | | const payload = tpl?.fields?.length ? buildFormPayloadFromFields(tpl.fields) : { summary: "" }; |
| | | const normalized = normalizeFlowNodes(flowNodesOverride); |
| | | const flowNodes = normalized.length |
| | | ? JSON.parse(JSON.stringify(normalized)) |
| | | : [createEmptyNode(1)]; |
| | | const flowNodes = normalized.length ? JSON.parse(JSON.stringify(normalized)) : [createEmptyNode(1)]; |
| | | return { |
| | | templateKey: templateKey || "", |
| | | templateId: tpl?.templateId || "", |
| | |
| | | formFieldDefs: tpl?.fields || [], |
| | | formPayload: payload, |
| | | flowNodes, |
| | | templateAttachments: tpl?.storageBlobDTOs ? JSON.parse(JSON.stringify(tpl.storageBlobDTOs)) : [], |
| | | storageBlobDTOs: [], |
| | | }; |
| | | } |
| | | |
| | | export function initTemplateAttachmentsFromSnapshot(templateSnapshot) { |
| | | const list = templateSnapshot?.storageBlobDTOs; |
| | | return list?.length ? JSON.parse(JSON.stringify(list)) : []; |
| | | } |