fix: 1. 继续对齐交叉评查的接口,完善创建交叉评查的逻辑 和 相关组件的渲染布局。
2. 文档的基本信息修改改用接口。 3. 重新完善角色权限管理的页面逻辑。 4.将评查点列表中的返回逻辑改用浏览器的记忆返回。
This commit is contained in:
@@ -107,9 +107,9 @@ export function mapUIToReviewStatus(status: string): number {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TODO: 是否需要出一个公共的接口,文件上传/文档列表 都需要用到:点击查看/开始审核 更新这个文件的审核状态(只有待审核的状态才会进行更新调用)
|
||||
/**
|
||||
* 更新文件的审核状态
|
||||
* 更新文件的审核状态
|
||||
* @param id 文件ID
|
||||
* @param auditStatus 审核状态
|
||||
* @param userId 用户ID
|
||||
@@ -144,7 +144,7 @@ export async function updateDocumentAuditStatus(id: string, auditStatus: number,
|
||||
}
|
||||
);
|
||||
|
||||
console.log('📝 [updateDocumentAuditStatus] postgrestPut响应:', response);
|
||||
// console.log('📝 [updateDocumentAuditStatus] postgrestPut响应:', response);
|
||||
|
||||
if (response.error) {
|
||||
console.warn('⚠️ [updateDocumentAuditStatus] postgrestPut返回错误,但操作可能已成功:', response.error);
|
||||
|
||||
@@ -239,11 +239,11 @@ export async function getRulesList(params: RulesQueryParams): Promise<{data: Rul
|
||||
}
|
||||
|
||||
// 🔑 添加地区过滤
|
||||
if (user_role === 'provincial_admin') {
|
||||
queryParams.append('area', '省级');
|
||||
} else if (area) {
|
||||
queryParams.append('area', area);
|
||||
}
|
||||
// if (user_role === 'provincial_admin') {
|
||||
// queryParams.append('area', '省级');
|
||||
// } else if (area) {
|
||||
// queryParams.append('area', area);
|
||||
// }
|
||||
|
||||
// 添加关键词搜索(后端会同时搜索 name 和 code)
|
||||
if (keyword) {
|
||||
@@ -251,6 +251,8 @@ export async function getRulesList(params: RulesQueryParams): Promise<{data: Rul
|
||||
queryParams.append('code', keyword);
|
||||
}
|
||||
|
||||
// console.log('🔍 [getRulesList] 查询参数:', queryParams.toString());
|
||||
|
||||
// 调用 FastAPI 接口
|
||||
const response = await apiRequest<{
|
||||
data: EvaluationPointData[];
|
||||
@@ -275,7 +277,7 @@ export async function getRulesList(params: RulesQueryParams): Promise<{data: Rul
|
||||
return { error: '接口返回数据格式不正确', status: 500 };
|
||||
}
|
||||
|
||||
console.log('✅ [getRulesList] 成功获取评查点列表,共', response.data.total, '条');
|
||||
// console.log('✅ [getRulesList] 成功获取评查点列表,共', response.data.total, '条');
|
||||
|
||||
// 🆕 直接映射后端返回的数据到前端 Rule 模型
|
||||
// 后端已包含 ruleType、groupName、groupId 字段,无需额外处理
|
||||
@@ -308,9 +310,11 @@ export async function getRulesList(params: RulesQueryParams): Promise<{data: Rul
|
||||
description: point.description || '',
|
||||
isActive: point.is_enabled,
|
||||
createdAt: formatDate(point.created_at || ''),
|
||||
updatedAt: formatDate(point.updated_at || '')
|
||||
updatedAt: formatDate(point.updated_at || ''),
|
||||
area: point.area || ''
|
||||
};
|
||||
});
|
||||
console.log('✅ [getRulesList] 成功映射评查点列表数据', response.data.data[0]);
|
||||
|
||||
return {
|
||||
data: {
|
||||
@@ -950,9 +954,8 @@ export async function batchUpdateRuleStatus(
|
||||
// 逐个验证并更新
|
||||
for (const id of ids) {
|
||||
try {
|
||||
|
||||
// 执行更新
|
||||
const updateResult = await updateRule(id, { isActive: is_enabled }, token);
|
||||
// 执行更新 - 使用 updateEvaluationPoint,只传入 is_enabled 字段
|
||||
const updateResult = await updateEvaluationPoint(id, { is_enabled }, token);
|
||||
if (updateResult.error) {
|
||||
failedIds.push(id);
|
||||
errors.push({ id, error: updateResult.error });
|
||||
|
||||
Reference in New Issue
Block a user