wuzhen update

This commit is contained in:
wuzhen committed 2025-08-12 20:12:25 +08:00
1 parent 715673dce9
commit b8da4c17bf
7 files changed
+41 -1737

No files matched your search

@@ -131,12 +131,12 @@ watch(dialogVisible, (newVal) => {
// 获取详情
const getDetail = async () => {
if (!props.applicationId) return;
loading.value = true;
try {
const response = await getCollegeApplication(props.applicationId);
console.log('详情API响应:', response);
// 处理不同的响应格式
if (response.data) {
if (response.data.data) {
@@ -186,13 +186,13 @@ const getStatusType = (status: string) => {
font-weight: bold;
color: #303133;
}
.content-text {
line-height: 1.6;
white-space: pre-wrap;
word-break: break-all;
}
.mb-20 {
margin-bottom: 20px;
}
@@ -170,41 +170,52 @@ const reviewFormRef = ref();
const getList = async () => {
loading.value = true;
try {
console.log('🔍 [调试] 开始获取待审核申请列表');
console.log('🔍 [调试] 查询参数:', queryParams);
const response = await listPendingApplications(queryParams);
console.log('API响应:', response);
// 处理不同的响应格式
if (response.data) {
// 如果是标准的TableDataInfo格式
if (response.data.rows !== undefined) {
applicationList.value = response.data.rows || [];
total.value = response.data.total || 0;
}
// 如果是包装在R<TableDataInfo>格式中
else if (response.data.data && response.data.data.rows !== undefined) {
applicationList.value = response.data.data.rows || [];
total.value = response.data.data.total || 0;
}
// 如果直接是数组数据
else if (Array.isArray(response.data)) {
applicationList.value = response.data;
total.value = response.data.length;
}
// 其他情况
else {
console.warn('未识别的响应格式:', response.data);
console.log('🔍 [调试] API原始响应:', response);
// 根据实际响应格式处理数据
// 从调试输出看,response直接包含{total: 1, rows: Array(1), code: 200, msg: '查询成功'}
if (response && typeof response === 'object') {
console.log('🔍 [调试] 响应对象键名:', Object.keys(response));
if (response.rows !== undefined && response.total !== undefined) {
console.log('🔍 [调试] ✅ 识别为TableDataInfo格式');
console.log('🔍 [调试] rows数据:', response.rows);
console.log('🔍 [调试] total数量:', response.total);
applicationList.value = response.rows || [];
total.value = response.total || 0;
} else {
console.warn('🔍 [调试] ❌ 响应格式不匹配,缺少rows或total字段');
applicationList.value = [];
total.value = 0;
}
} else {
console.warn('🔍 [调试] ❌ 响应不是对象类型');
applicationList.value = [];
total.value = 0;
}
} catch (error) {
console.error('获取待审核申请列表失败:', error);
if (error.message.includes('404')) {
console.log('🔍 [调试] 最终设置的applicationList长度:', applicationList.value.length);
console.log('🔍 [调试] 最终设置的total:', total.value);
if (applicationList.value.length > 0) {
console.log('🔍 [调试] 第一条数据示例:', applicationList.value[0]);
} else {
console.log('🔍 [调试] ⚠️ 列表为空!');
}
} catch (error: any) {
console.error('🔍 [调试] 获取待审核申请列表失败:', error);
if (error?.response?.data) {
console.error('🔍 [调试] 错误详情:', error.response.data);
}
if (error?.message?.includes('404')) {
ElMessage.error('无法获取待审核申请列表,请检查您是否有学院审核权限');
} else if (error.message.includes('403')) {
} else if (error?.message?.includes('403')) {
ElMessage.error('权限不足,无法访问学院审核功能');
} else {
ElMessage.error('获取待审核申请列表失败,请稍后重试');