@@ -3,6 +3,7 @@ import { OperatorI } from "@/pages/OperatorMarket/operator.model";
33import { Button , Card , Descriptions , Progress , Tag } from "antd" ;
44import { Activity , AlertCircle , CheckCircle , Clock } from "lucide-react" ;
55import { useNavigate } from "react-router" ;
6+ import { formatExecutionDuration } from "@/utils/unit.ts" ;
67
78export default function BasicInfo ( { task } : { task : CleansingTask } ) {
89 const navigate = useNavigate ( ) ;
@@ -11,14 +12,15 @@ export default function BasicInfo({ task }: { task: CleansingTask }) {
1112 {
1213 key : "id" ,
1314 label : "任务ID" ,
14- children : < span className = "font-mono" > # { task ?. id } </ span > ,
15+ children : < span className = "font-mono" > { task ?. id } </ span > ,
1516 } ,
1617 { key : "name" , label : "任务名称" , children : task ?. name } ,
1718 {
1819 key : "dataset" ,
1920 label : "源数据集" ,
2021 children : (
2122 < Button
23+ style = { { paddingLeft : 0 , marginLeft : 0 } }
2224 type = "link"
2325 size = "small"
2426 onClick = { ( ) =>
@@ -34,6 +36,7 @@ export default function BasicInfo({ task }: { task: CleansingTask }) {
3436 label : "目标数据集" ,
3537 children : (
3638 < Button
39+ style = { { paddingLeft : 0 , marginLeft : 0 } }
3740 type = "link"
3841 size = "small"
3942 onClick = { ( ) =>
@@ -44,26 +47,13 @@ export default function BasicInfo({ task }: { task: CleansingTask }) {
4447 </ Button >
4548 ) ,
4649 } ,
47- { key : "template" , label : "使用模板" , children : task ?. template } ,
50+ { key : "template" , label : "使用模板" , children : ( task ?. description || "--" ) } ,
4851 { key : "startTime" , label : "开始时间" , children : task ?. startedAt } ,
49- { key : "estimatedTime" , label : "预计用时" , children : task ?. estimatedTime } ,
5052 {
5153 key : "description" ,
5254 label : "任务描述" ,
5355 children : (
54- < span className = "text-gray-600" > { task ?. description || "暂无描述" } </ span >
55- ) ,
56- span : 2 ,
57- } ,
58- {
59- key : "rules" ,
60- label : "处理算子" ,
61- children : (
62- < div className = "flex flex-wrap gap-1" >
63- { task ?. instance ?. map ?.( ( op : OperatorI ) => (
64- < Tag key = { op . id } > { op . name } </ Tag >
65- ) ) }
66- </ div >
56+ < span className = "text-gray-600" > { task ?. description || "--" } </ span >
6757 ) ,
6858 span : 2 ,
6959 } ,
@@ -77,28 +67,28 @@ export default function BasicInfo({ task }: { task: CleansingTask }) {
7767 < div className = "text-center p-4 bg-gradient-to-br from-blue-50 to-blue-100 rounded-lg" >
7868 < Clock className = "w-8 h-8 text-blue-500 mb-2 mx-auto" />
7969 < div className = "text-xl font-bold text-blue-500" >
80- { task ?. duration || "--" }
70+ { formatExecutionDuration ( task ?. startedAt , task ?. finishedAt ) || "--" }
8171 </ div >
8272 < div className = "text-sm text-gray-600" > 总耗时</ div >
8373 </ div >
8474 < div className = "text-center p-4 bg-gradient-to-br from-green-50 to-green-100 rounded-lg" >
8575 < CheckCircle className = "w-8 h-8 text-green-500 mb-2 mx-auto" />
8676 < div className = "text-xl font-bold text-green-500" >
87- { task ?. successFiles || "-- " }
77+ { task ?. progress ?. finishedFileNum || "0 " }
8878 </ div >
8979 < div className = "text-sm text-gray-600" > 成功文件</ div >
9080 </ div >
9181 < div className = "text-center p-4 bg-gradient-to-br from-red-50 to-red-100 rounded-lg" >
9282 < AlertCircle className = "w-8 h-8 text-red-500 mb-2 mx-auto" />
9383 < div className = "text-xl font-bold text-red-500" >
94- { task ?. failedFiles || "-- " }
84+ { task ?. progress ?. totalFileNum - task ?. progress ?. finishedFileNum || "0 " }
9585 </ div >
9686 < div className = "text-sm text-gray-600" > 失败文件</ div >
9787 </ div >
9888 < div className = "text-center p-4 bg-gradient-to-br from-purple-50 to-purple-100 rounded-lg" >
9989 < Activity className = "w-8 h-8 text-purple-500 mb-2 mx-auto" />
10090 < div className = "text-xl font-bold text-purple-500" >
101- { task ?. progress || "--" }
91+ { task ?. progress ?. process || "--" }
10292 </ div >
10393 < div className = "text-sm text-gray-600" > 成功率</ div >
10494 </ div >
@@ -120,21 +110,15 @@ export default function BasicInfo({ task }: { task: CleansingTask }) {
120110 { /* 处理进度 */ }
121111 < div >
122112 < h3 className = "text-lg font-semibold text-gray-900 mb-4" > 处理进度</ h3 >
123- < Progress percent = { task ?. progress } showInfo />
113+ < Progress percent = { task ?. progress ?. process } showInfo />
124114 < div className = "grid grid-cols-2 gap-4 text-sm mt-4" >
125115 < div className = "flex items-center gap-2" >
126116 < span className = "w-3 h-3 bg-green-500 rounded-full inline-block" />
127- < span > 已完成: { task ?. processedFiles || "-- " } </ span >
117+ < span > 已完成: { task ?. progress ?. finishedFileNum || "0 " } </ span >
128118 </ div >
129119 < div className = "flex items-center gap-2" >
130120 < span className = "w-3 h-3 bg-blue-500 rounded-full inline-block" />
131- < span > 处理中: { task ?. processingFiles || "--" } </ span >
132- </ div >
133- < div className = "flex items-center gap-2" >
134- < span className = "w-3 h-3 bg-gray-300 rounded-full inline-block" />
135- < span >
136- 待处理: { task ?. totalFiles - task ?. processedFiles || "--" }
137- </ span >
121+ < span > 处理中: { task ?. progress ?. totalFileNum - task ?. progress ?. finishedFileNum || "0" } </ span >
138122 </ div >
139123 < div className = "flex items-center gap-2" >
140124 < span className = "w-3 h-3 bg-red-500 rounded-full inline-block" />
0 commit comments