diff --git a/src/pages/Competitions/Detail/AddSubmitModel.tsx b/src/pages/Competitions/Detail/AddSubmitModel.tsx index f0e593863..e5350942b 100644 --- a/src/pages/Competitions/Detail/AddSubmitModel.tsx +++ b/src/pages/Competitions/Detail/AddSubmitModel.tsx @@ -44,8 +44,8 @@ const ShixunsListPage: FC = ({ }, beforeUpload: (file: any) => { console.log(file); - if(file?.size>1024*1024*50){ - message.info('文件超过50M,不符合上传要求') + if(file?.size>1024*1024*500){ + message.info('文件超过500M,不符合上传要求') return false } let filelist=[]; diff --git a/src/pages/Competitions/Detail/Ranking.tsx b/src/pages/Competitions/Detail/Ranking.tsx index 662797700..51adc48e5 100644 --- a/src/pages/Competitions/Detail/Ranking.tsx +++ b/src/pages/Competitions/Detail/Ranking.tsx @@ -24,6 +24,7 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,getChartRules,userinfo const [defaultValue,setDefaultValue]=useState(''); const [ClickButton,setClickButton]=useState(true); const [item,setItem]=useState(); + const [items,setItems]=useState(); const { identifier } = useParams(); useEffect(()=>{ //进入初始化状态为第一个 @@ -129,7 +130,7 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,getChartRules,userinfo } }, { - title: HeaderDetail?.task==='mAP'?'mAP指标':'top1指标', + title: HeaderDetail?.task==='mAP'?'mAP指标':HeaderDetail?.task==='Jittor-3'?'总分':'top1指标', dataIndex: 'score', key: 'score', render:(text:any)=>{ @@ -151,8 +152,10 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,getChartRules,userinfo setIsupdate(false) let data=ChartRules?.stages?.filter(item=>parseInt(e)===parseInt(item?.id))[0]; setItem(data); + let datas=data?.children?.[0]; + setItems(datas); 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( @@ -178,6 +181,19 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,getChartRules,userinfo })} } + {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); @@ -188,7 +204,7 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,getChartRules,userinfo

} - {ItemData?.teams?.length>0&&(HeaderDetail?.task==='mAP'||HeaderDetail?.task==='dog')?0&&(HeaderDetail?.task==='mAP'||HeaderDetail?.task==='dog'||HeaderDetail?.task==='Jittor-3')?
{ - return {c+1} + return {a} } }, { @@ -116,7 +116,7 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR title: '提交人', dataIndex: 'user_name', key: 'user_name', - width:120, + width:100, render:(text:any)=>{ return {text&&text?.length>=6?text?.substr(0,6)+'...':text||'--'} } @@ -132,11 +132,12 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR title: '状态', dataIndex: 'status', key: 'status', + width:50, render:(text:any)=>{ return {text===1?'计算中':text===2?'完成':text===0?'待计算':text===3&&'错误'} } }, - { + (!item?.display_four_indicators&&item?.name==='计图挑战热身赛')&&{ title: '数据指标1', dataIndex: 'data_ranking', key: 'data_ranking', @@ -145,7 +146,7 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR return {text||'--'} } }, - { + (!item?.display_four_indicators&&item?.name==='计图挑战热身赛')&&{ title: '数据指标2', dataIndex: 'data_other', key: 'data_other', @@ -153,22 +154,114 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR render:(text:any)=>{ if(text?.length>0){ return text?.map((item,index)=>{ - return {item.name}:{item.value}
+ return {item?.name}:{item?.value}
}) }else{ return -- } } }, + item?.display_four_indicators&&{ + title: 'mask accuary', + dataIndex: 'data_ranking', + key: 'data_ranking', + align:'left', + render:(text:any)=>{ + return {text||'--'} + } + }, + item?.display_four_indicators&&{ + title: '美学评分', + dataIndex: 'data_other', + key: 'data_other', + align:'left', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='score')?.value||'--'} + } + }, + item?.display_four_indicators&&{ + title: 'FID', + dataIndex: 'data_other', + key: 'data_other', + align:'left', + render:(text:any)=>{ + 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==='total_score')?.value||'--'} + } + }, + (!item?.display_four_indicators&&item?.name.includes('可微渲染新视角生成赛题'))&&{ + title: 'Car', + dataIndex: 'data_ranking', + key: 'data_ranking', + align:'center', + render:(text:any)=>{ + return {text||'--'} + } + }, + (!item?.display_four_indicators&&item?.name.includes('可微渲染新视角生成赛题'))&&{ + title: 'Coffee', + dataIndex: 'data_other', + key: 'data_other', + align:'center', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='Coffee')?.value||'--'} + + } + }, + (!item?.display_four_indicators&&item?.name.includes('可微渲染新视角生成赛题'))&&{ + title: 'Easyship', + dataIndex: 'data_other', + key: 'data_other', + align:'center', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='Easyship')?.value||'--'} + } + }, + (!item?.display_four_indicators&&item?.name.includes('可微渲染新视角生成赛题'))&&{ + title: 'Scar', + dataIndex: 'data_other', + key: 'data_other', + align:'center', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='Scar')?.value||'--'} + } + }, + (!item?.display_four_indicators&&item?.name.includes('可微渲染新视角生成赛题'))&&{ + title: 'Scarf', + dataIndex: 'data_other', + key: 'data_other', + align:'center', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='Scarf')?.value||'--'} + } + }, + (!item?.display_four_indicators&&item?.name.includes('可微渲染新视角生成赛题'))&&{ + title: '总分', + dataIndex: 'data_other', + key: 'data_other', + align:'center', + render:(text:any)=>{ + return {text?.find((item:any)=>item?.name==='Total')?.value||'--'} + } + }, { title: '操作', dataIndex: 'result_url', key: 'result_url', + width:50, render:(text:any)=>{ return 下载 } }, - ]; + ].filter(item => !!item); return(
@@ -180,7 +273,7 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR 编辑 : - StaffDetail?.enrolled && + (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")} : null} + }>{StaffDetail.enrolled ? HeaderDetail.need_attachment ? '上传作品' : '已报名' : HeaderDetail?.enroll_url ? '前往大赛官网报名' : '立即报名'} : null} {user.userInfo.real_name != "游客" && gotocourse(e, HeaderDetail, `/competitions/index/${HeaderDetail.identifier}/enroll`)} className={styles.myteam}>{isSuperAdmin() ? '参赛战队>>' : '我的战队>>'}}
diff --git a/src/pages/Competitions/Index/index.tsx b/src/pages/Competitions/Index/index.tsx index ff4f57e2e..d25e5c829 100755 --- a/src/pages/Competitions/Index/index.tsx +++ b/src/pages/Competitions/Index/index.tsx @@ -267,7 +267,10 @@ const competitionsPage: FC = ({

¥{parseInt(item.bonus).toLocaleString()}

-

已报名:{item.competition_status === "nearly_published" ? "0" : item.member_count}

+ {item.member_count? +

已报名:{item.competition_status === "nearly_published" ? "0" : item.member_count}

+ :"" + }
{item && item.competition_status === 'ended' ? noclick(e)}>已结束 : null} {item && item.competition_status === 'nearly_published' ? noclick(e)}>未发布 : null} diff --git a/src/pages/Competitions/Update/index.tsx b/src/pages/Competitions/Update/index.tsx index 48ace9827..5b7388d84 100644 --- a/src/pages/Competitions/Update/index.tsx +++ b/src/pages/Competitions/Update/index.tsx @@ -34,6 +34,8 @@ interface PageProps extends ConnectProps { const Croppers=useRef(null); const[updateimg,setupdateimg]=useState('') const{ identifier,Teannameid }=useParams(); + const[letimg,setletimg]=useState(''); + const history=useHistory(); useEffect(()=>{ async function init(){ @@ -54,8 +56,12 @@ interface PageProps extends ConnectProps { } }) if(data){ - setpersonname(data.data.name); - setupdateimg(`${env.IMG_SERVER}/${data.data.team_log}`) + // setpersonname(data.data.name); + // setupdateimg(`${env.IMG_SERVER}/${data.data.team_log}`) + setpersonname(data?.data?.name); + + setupdateimg(`${env?.IMG_SERVER}/${data?.data?.team_log}`) + setletimg(data?.data?.team_log) } } @@ -82,7 +88,7 @@ interface PageProps extends ConnectProps { identifier:identifier, Teannameid:Teannameid, name:personname, - image:updateimg?Croppers.current.getCroppedCanvas().toDataURL("image/jpeg"):undefined + image:letimg?Croppers.current.getCroppedCanvas().toDataURL("image/jpeg"):undefined } }) if(data?.status===0){