更新23号bug

This commit is contained in:
2025-12-27 12:29:33 +08:00
parent b29d128e41
commit c0f2dc43c0
4 changed files with 64 additions and 10 deletions

View File

@@ -149,6 +149,16 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="isUpdate" prop="expertStatus" min-width="120" :label="t('expertApply.table.expertStatus')">
<template #default="scope">
<el-select v-model="scope.row.expertStatus" :placeholder="t('expertApply.table.selectPlaceholder')"
style="width: 100%;">
<el-option :label="t('expertApply.expertStatusOptions.normal')" value="normal" />
<el-option :label="t('expertApply.expertStatusOptions.invalid')" value="invalid" />
</el-select>
</template>
</el-table-column>
</el-table> </el-table>
<!-- 选择专家弹窗 --> <!-- 选择专家弹窗 -->
<SelectExpertDialog v-model:visible="expertDialogVisible" @confirm="onExpertSelected" /> <SelectExpertDialog v-model:visible="expertDialogVisible" @confirm="onExpertSelected" />
@@ -220,6 +230,7 @@ const createEmptyExpert = () => ({
attachments: '', attachments: '',
evidences: '', evidences: '',
level: '', level: '',
expertStatus: 'normal',
externalStatus: '', externalStatus: '',
attachmentUrl: '', attachmentUrl: '',
testimonyMaterials: '', testimonyMaterials: '',
@@ -256,6 +267,7 @@ const onExpertSelected = (row: any) => {
target.professionalTitle = row?.professionalTitle ?? target.professionalTitle; target.professionalTitle = row?.professionalTitle ?? target.professionalTitle;
target.workUnit = row?.workUnit ?? target.workUnit; target.workUnit = row?.workUnit ?? target.workUnit;
target.level = row?.level ?? target.level; target.level = row?.level ?? target.level;
target.expertStatus = row?.expertStatus ?? target.expertStatus;
target.attachments = row?.attachmentUrl ? JSON.parse(row.attachmentUrl) : [] target.attachments = row?.attachmentUrl ? JSON.parse(row.attachmentUrl) : []
target.evidences = row?.testimonyMaterials ? JSON.parse(row.testimonyMaterials) : [] target.evidences = row?.testimonyMaterials ? JSON.parse(row.testimonyMaterials) : []
}; };
@@ -300,6 +312,7 @@ const toSubmitExpert = (expert: ReturnType<typeof createEmptyExpert>) => ({
attachmentUrl: JSON.stringify(expert.attachments), attachmentUrl: JSON.stringify(expert.attachments),
testimonyMaterials: JSON.stringify(expert.evidences), testimonyMaterials: JSON.stringify(expert.evidences),
level: expert.level || '', level: expert.level || '',
expertStatus: expert.expertStatus || 'normal',
externalStatus: expert.externalStatus || '', externalStatus: expert.externalStatus || '',
createBy: expert.createBy || '', createBy: expert.createBy || '',
createTime: expert.createTime || '', createTime: expert.createTime || '',
@@ -447,6 +460,7 @@ watch(()=>tempId.value,()=>{
professionalTitle: item.professionalTitle, professionalTitle: item.professionalTitle,
workUnit: item.workUnit, workUnit: item.workUnit,
level: item.level, level: item.level,
expertStatus: item.expertStatus || 'normal',
attachments: item.attachmentUrl ? JSON.parse(item.attachmentUrl) : [], attachments: item.attachmentUrl ? JSON.parse(item.attachmentUrl) : [],
evidences: item.testimonyMaterials ? JSON.parse(item.testimonyMaterials) : [] evidences: item.testimonyMaterials ? JSON.parse(item.testimonyMaterials) : []
} }

View File

@@ -179,16 +179,46 @@ const detailMeta = reactive({
date: new Date().toISOString().slice(0, 10), date: new Date().toISOString().slice(0, 10),
}); });
const handleView = (row: any) => { const handleView = (row: any) => {
// 转换为详情组件需要的格式 // 解析附件,支持对象数组和字符串数组两种格式
const attachmentUrl = row.attachmentUrl ? JSON.parse(row.attachmentUrl) : [] let attachmentUrl: any[] = [];
const attachments = attachmentUrl.map((url: string) => { try {
return { url, name: url.split('fileName=')[1] } attachmentUrl = row.attachmentUrl ? JSON.parse(row.attachmentUrl) : [];
}) } catch {
// 转换为详情组件需要的格式 attachmentUrl = [];
const testimonyMaterials = row.testimonyMaterials ? JSON.parse(row.testimonyMaterials) : [] }
const evidences = testimonyMaterials.map((url: string) => { const attachments = attachmentUrl.map((item: any) => {
return { url, name: url.split('fileName=')[1] } // 如果已经是对象格式 { 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, currentDetail.value = { ...row,
attachments, attachments,
evidences, evidences,

View File

@@ -109,9 +109,14 @@ export default {
attachments: 'Attachments', attachments: 'Attachments',
evidences: 'Supporting Materials', evidences: 'Supporting Materials',
level: 'Level', level: 'Level',
expertStatus: 'Expert Status',
inputPlaceholder: 'Please enter', inputPlaceholder: 'Please enter',
selectPlaceholder: 'Please select', selectPlaceholder: 'Please select',
}, },
expertStatusOptions: {
normal: 'Normal',
invalid: 'Invalid',
},
}, },
expertLibrary: { expertLibrary: {
title: 'Expert Repository', title: 'Expert Repository',

View File

@@ -109,9 +109,14 @@ export default {
attachments: '附件', attachments: '附件',
evidences: '佐证材料', evidences: '佐证材料',
level: '级别', level: '级别',
expertStatus: '专家状态',
inputPlaceholder: '请输入', inputPlaceholder: '请输入',
selectPlaceholder: '请选择', selectPlaceholder: '请选择',
}, },
expertStatusOptions: {
normal: '正常',
invalid: '作废',
},
}, },
expertLibrary: { expertLibrary: {
title: '专家智库', title: '专家智库',