新增提示Toast组件

This commit is contained in:
2025-04-21 09:22:13 +08:00
parent 01d93522b8
commit 5c2c367856
36 changed files with 2609 additions and 478 deletions
+20 -1
View File
@@ -19,6 +19,7 @@ import {
type FileUploadResponse,
DocumentStatus
} from "~/api/files/files-upload";
import { updateDocumentAuditStatus } from "~/api/evaluation_points/rules-files";
export function links() {
return [
@@ -781,6 +782,24 @@ export default function FilesUpload() {
const type = documentTypesState.find(t => t.id === codeId);
return type ? type.name : '未知类型';
};
// 处理查看文件
const handleViewFile = async (record: Document) => {
// 检查audit_status是否为0,如果是则更新为2
if (record.audit_status === 0 || record.audit_status === null) {
try {
const response = await updateDocumentAuditStatus(record.id.toString(), 2);
if (response.error) {
console.error('更新文件审核状态失败:', response.error);
alert('更新文件审核状态失败:' + (response.error || '未知错误'));
}
} catch (error) {
console.error('更新文件审核状态时出错:', error);
alert('更新文件审核状态时出错:' + (error instanceof Error ? error.message : '未知错误'));
}
}
navigate(`/reviews?id=${record.id}&previousRoute=filesUpload`);
};
// 表格列定义
const columns = [
@@ -880,7 +899,7 @@ export default function FilesUpload() {
size="small"
disabled={record.status !== DocumentStatus.PROCESSED}
icon="ri-eye-line"
onClick={() => navigate(`/reviews?id=${record.id}`)}
onClick={() => handleViewFile(record)}
>
</Button>