diff --git a/src/pages/Competitions/Detail/SubmitResult.tsx b/src/pages/Competitions/Detail/SubmitResult.tsx index 01678a7f3..a43ca3e07 100644 --- a/src/pages/Competitions/Detail/SubmitResult.tsx +++ b/src/pages/Competitions/Detail/SubmitResult.tsx @@ -18,8 +18,9 @@ interface Ranking{ userinfo:any Editable:any dispatch:any - HeaderDetail:any, + HeaderDetail:any StaffDetail:any + } function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartRules,userinfo,Editable,dispatch,StaffDetail}:Ranking){ @@ -27,13 +28,17 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR const [defaultValue,setDefaultValue]=useState(''); const [ClickButton,setClickButton]=useState(true); const [item,setItem]=useState(); + const [items,setItems]=useState(); const { identifier } = useParams(); + useEffect(()=>{ //进入初始化状态为第一个 if(ClickButton){ let data=ChartRules?.stages?.[0]; setItem(data); + let datas=ChartRules?.stages?.[0]?.children?.[0]; + setItems(datas); if(data?.id){ getCharts(data?.id) setDefaultValue(ChartRules.rule_contents?.filter(item => parseInt(item.competition_stage_id) === parseInt(data?.id))?.[0]?.['content'] || '') @@ -99,7 +104,7 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR align:'center', key: 'name', render:(a,b,c)=>{ - return {a} + return {a} } }, { @@ -170,6 +175,15 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR return {text||'--'} } }, + item?.display_one_indicators&&{ + title: 'mIoU', + dataIndex: 'data_other', + key: 'data_ranking', + align:'left', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='mIoU')?.value||'--'} + } + }, item?.display_four_indicators&&{ title: '美学评分', dataIndex: 'data_other', @@ -188,6 +202,15 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR return {text?.find((item:any)=>item?.name==='fid')?.value||'--'} } }, + item?.display_four_indicators&&{ + title: '风格相似度', + dataIndex: 'data_other', + key: 'data_other', + align:'left', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='style_similarity')?.value||'--'} + } + }, item?.display_four_indicators&&{ title: '总分', dataIndex: 'data_other', @@ -255,47 +278,48 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR { title: '操作', dataIndex: 'result_url', - key: 'result_url', width:50, + key: 'result_url', render:(text:any)=>{ return 下载 } }, - ].filter(item => !!item); + ].filter(item => !!item);; + return(
{ChartRules?.stages?.length>0?null:} - {ChartRules?.stages?.length>0&& - { - setIsupdate(true) + + {ChartRules?.stages?.length>0&&{ + setIsupdate(true) + }}> 编辑 - - : - (StaffDetail.enrolled&&item?.start_time&&item?.end_time)&& - - 提交时间:{moment(item?.start_time).format("YYYY-MM-DD HH:mm:ss")}至{moment(item?.end_time).format("YYYY-MM-DD HH:mm:ss")} - - } onChange={(e)=>{ + }}>提交结果} onChange={(e)=>{ setIsupdate(false) let data=ChartRules?.stages?.filter(item=>parseInt(e)===parseInt(item?.id))[0]; + let datas=data?.children?.[0]; + setItems(datas); setItem(data); setDefaultValue(ChartRules.rule_contents?.filter(item => parseInt(item.competition_stage_id) === parseInt(data?.id))?.[0]?.['content'] || '') - getCharts(e); + getCharts(datas?.id||e); }}> + + {ChartRules&&ChartRules.stages.map((item:any,index:any)=>{ return( @@ -320,6 +344,20 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR })} } + + {item?.children?.length>0&&{ + let data=item?.children?.filter(item=>parseInt(e)===parseInt(item?.id))[0]; + setItems(data); + getCharts(e); + + //获取参数 + }}> + {item?.children?.map((item:any,index:any)=>{ + return + + + })} + } {isUpdate&&
{ setDefaultValue(e); @@ -329,10 +367,10 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR

} - item.id===Selectkey)?.[0]?.show_leaderboard&&
+ />} {/* {ItemData?.teams?.length>0?:null} */}