测通完成评查,投票,意见列表,任务列表,任务关联文档列表的内容。剩余创建任务,提出意见的完善
This commit is contained in:
@@ -65,6 +65,31 @@ export function DocumentListModal({
|
||||
onViewFile(fileId);
|
||||
}
|
||||
};
|
||||
|
||||
// 审核状态选项及样式 - 与documents._index.tsx保持一致
|
||||
const auditStatusMapping: Record<string, { label: string; color: string; icon: string }> = {
|
||||
"-1": { label: "不通过", color: "red", icon: "ri-close-line" },
|
||||
"-2": { label: "警告", color: "yellow", icon: "ri-alert-line" },
|
||||
"0": { label: "待审核", color: "blue", icon: "ri-time-line" },
|
||||
"1": { label: "通过", color: "green", icon: "ri-check-line" },
|
||||
"2": { label: "审核中", color: "purple", icon: "ri-search-line" },
|
||||
};
|
||||
|
||||
// 渲染审核状态
|
||||
const renderAuditStatus = (file: TaskDocument) => {
|
||||
// 处理audit_status为null或undefined的情况,默认为0(待审核)
|
||||
const auditStatus = file.audit_status != null ? file.audit_status : 0;
|
||||
const statusKey = auditStatus.toString();
|
||||
const statusInfo = auditStatusMapping[statusKey] || auditStatusMapping["0"];
|
||||
|
||||
return (
|
||||
<div className={`inline-flex items-center px-2 py-1 rounded-full text-xs bg-${statusInfo.color}-100 text-${statusInfo.color}-800`}>
|
||||
<i className={`${statusInfo.icon} mr-1`}></i>
|
||||
<span>{statusInfo.label}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// 渲染问题摘要
|
||||
const renderIssues = (file: TaskDocument) => {
|
||||
@@ -143,7 +168,7 @@ export function DocumentListModal({
|
||||
{
|
||||
title: "文件类型",
|
||||
key: "fileType",
|
||||
width: "10%",
|
||||
width: "8%",
|
||||
render: (_: unknown, file: TaskDocument) => (
|
||||
<FileTypeTag
|
||||
type="other"
|
||||
@@ -158,7 +183,7 @@ export function DocumentListModal({
|
||||
{
|
||||
title: "上传时间",
|
||||
key: "uploadTime",
|
||||
width: "12%",
|
||||
width: "8%",
|
||||
render: (_: unknown, file: TaskDocument) => {
|
||||
const uploadTime = formatDate(file.upload_time).split(' ');
|
||||
const date = uploadTime[0];
|
||||
@@ -175,7 +200,7 @@ export function DocumentListModal({
|
||||
{
|
||||
title: "评查统计",
|
||||
key: "reviewStatus",
|
||||
width: "12%",
|
||||
width: "10%",
|
||||
render: (_: unknown, file: TaskDocument) =>
|
||||
// 要文件切分处理完之后,再显示评查统计
|
||||
file.status === 'Processed' ? (
|
||||
@@ -225,7 +250,7 @@ export function DocumentListModal({
|
||||
key: "score",
|
||||
width: "8%",
|
||||
render: (_: unknown, file: TaskDocument) => (
|
||||
<div className="text-center">
|
||||
<div className="text-left">
|
||||
{file.final_score ? (
|
||||
<span className={`font-medium ${
|
||||
file.final_score >= 90 ? 'text-green-600' :
|
||||
@@ -240,6 +265,12 @@ export function DocumentListModal({
|
||||
</div>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
key: 'auditStatus',
|
||||
width: '8%',
|
||||
render: (_: unknown, file: TaskDocument) => renderAuditStatus(file)
|
||||
},
|
||||
{
|
||||
title: "问题摘要",
|
||||
key: "issues",
|
||||
@@ -322,4 +353,4 @@ export function DocumentListModal({
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user