diff --git a/src/views/investment/expertApply/index.vue b/src/views/investment/expertApply/index.vue index b85bb59..e163f65 100644 --- a/src/views/investment/expertApply/index.vue +++ b/src/views/investment/expertApply/index.vue @@ -149,6 +149,16 @@ + + + + @@ -220,6 +230,7 @@ const createEmptyExpert = () => ({ attachments: '', evidences: '', level: '', + expertStatus: 'normal', externalStatus: '', attachmentUrl: '', testimonyMaterials: '', @@ -256,6 +267,7 @@ const onExpertSelected = (row: any) => { target.professionalTitle = row?.professionalTitle ?? target.professionalTitle; target.workUnit = row?.workUnit ?? target.workUnit; target.level = row?.level ?? target.level; + target.expertStatus = row?.expertStatus ?? target.expertStatus; target.attachments = row?.attachmentUrl ? JSON.parse(row.attachmentUrl) : [] target.evidences = row?.testimonyMaterials ? JSON.parse(row.testimonyMaterials) : [] }; @@ -300,6 +312,7 @@ const toSubmitExpert = (expert: ReturnType) => ({ attachmentUrl: JSON.stringify(expert.attachments), testimonyMaterials: JSON.stringify(expert.evidences), level: expert.level || '', + expertStatus: expert.expertStatus || 'normal', externalStatus: expert.externalStatus || '', createBy: expert.createBy || '', createTime: expert.createTime || '', @@ -447,6 +460,7 @@ watch(()=>tempId.value,()=>{ professionalTitle: item.professionalTitle, workUnit: item.workUnit, level: item.level, + expertStatus: item.expertStatus || 'normal', attachments: item.attachmentUrl ? JSON.parse(item.attachmentUrl) : [], evidences: item.testimonyMaterials ? JSON.parse(item.testimonyMaterials) : [] } diff --git a/src/views/investment/expertLibrary/index.vue b/src/views/investment/expertLibrary/index.vue index f25fa56..7633960 100644 --- a/src/views/investment/expertLibrary/index.vue +++ b/src/views/investment/expertLibrary/index.vue @@ -179,16 +179,46 @@ const detailMeta = reactive({ date: new Date().toISOString().slice(0, 10), }); const handleView = (row: any) => { - // 转换为详情组件需要的格式 - const attachmentUrl = row.attachmentUrl ? JSON.parse(row.attachmentUrl) : [] - const attachments = attachmentUrl.map((url: string) => { - return { url, name: url.split('fileName=')[1] } - }) - // 转换为详情组件需要的格式 - const testimonyMaterials = row.testimonyMaterials ? JSON.parse(row.testimonyMaterials) : [] - const evidences = testimonyMaterials.map((url: string) => { - return { url, name: url.split('fileName=')[1] } - }) + // 解析附件,支持对象数组和字符串数组两种格式 + let attachmentUrl: any[] = []; + try { + attachmentUrl = row.attachmentUrl ? JSON.parse(row.attachmentUrl) : []; + } catch { + attachmentUrl = []; + } + const attachments = attachmentUrl.map((item: any) => { + // 如果已经是对象格式 { name, url },直接使用 + if (typeof item === 'object' && item !== null) { + return { url: item.url || '', name: item.name || '' }; + } + // 如果是字符串格式,尝试从 URL 中提取文件名 + if (typeof item === 'string') { + const fileName = item.split('fileName=')[1] || item.split('/').pop() || '附件'; + return { url: item, name: fileName }; + } + return { url: '', name: '' }; + }); + + // 解析佐证材料,支持对象数组和字符串数组两种格式 + let testimonyMaterials: any[] = []; + try { + testimonyMaterials = row.testimonyMaterials ? JSON.parse(row.testimonyMaterials) : []; + } catch { + testimonyMaterials = []; + } + const evidences = testimonyMaterials.map((item: any) => { + // 如果已经是对象格式 { name, url },直接使用 + if (typeof item === 'object' && item !== null) { + return { url: item.url || '', name: item.name || '' }; + } + // 如果是字符串格式,尝试从 URL 中提取文件名 + if (typeof item === 'string') { + const fileName = item.split('fileName=')[1] || item.split('/').pop() || '佐证材料'; + return { url: item, name: fileName }; + } + return { url: '', name: '' }; + }); + currentDetail.value = { ...row, attachments, evidences, diff --git a/src/views/investment/i18n/en.ts b/src/views/investment/i18n/en.ts index 212246e..2a2221b 100644 --- a/src/views/investment/i18n/en.ts +++ b/src/views/investment/i18n/en.ts @@ -109,9 +109,14 @@ export default { attachments: 'Attachments', evidences: 'Supporting Materials', level: 'Level', + expertStatus: 'Expert Status', inputPlaceholder: 'Please enter', selectPlaceholder: 'Please select', }, + expertStatusOptions: { + normal: 'Normal', + invalid: 'Invalid', + }, }, expertLibrary: { title: 'Expert Repository', diff --git a/src/views/investment/i18n/zh-cn.ts b/src/views/investment/i18n/zh-cn.ts index b8c1668..50956d0 100644 --- a/src/views/investment/i18n/zh-cn.ts +++ b/src/views/investment/i18n/zh-cn.ts @@ -109,9 +109,14 @@ export default { attachments: '附件', evidences: '佐证材料', level: '级别', + expertStatus: '专家状态', inputPlaceholder: '请输入', selectPlaceholder: '请选择', }, + expertStatusOptions: { + normal: '正常', + invalid: '作废', + }, }, expertLibrary: { title: '专家智库',