更新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>
</template>
</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>
<!-- 选择专家弹窗 -->
<SelectExpertDialog v-model:visible="expertDialogVisible" @confirm="onExpertSelected" />
@@ -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<typeof createEmptyExpert>) => ({
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) : []
}

View File

@@ -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,

View File

@@ -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',

View File

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