starfdetail.enrolled

This commit is contained in:
caishi 2022-04-18 10:29:39 +08:00
parent 7eee378218
commit 7ed5aa376c
2 changed files with 16 additions and 10 deletions

View File

@ -18,10 +18,11 @@ 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}:Ranking){
function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartRules,userinfo,Editable,dispatch,StaffDetail}:Ranking){
const [isUpdate,setIsupdate]=useState(false);
const [defaultValue,setDefaultValue]=useState('');
const [ClickButton,setClickButton]=useState(true);
@ -172,13 +173,17 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR
return(
<div>
{ChartRules?.stages?.length>0?null:<RankingNull/>}
{ChartRules?.stages?.length>0&&<Tabs animated={true} tabBarExtraContent={(userinfo?.admin||userinfo?.business||Editable)?<Button onClick={()=>{
{ChartRules?.stages?.length>0&&
<Tabs animated={true} tabBarExtraContent={(userinfo?.admin||userinfo?.business||Editable)?<Button onClick={()=>{
setIsupdate(true)
}}>
</Button>:<span>{moment(item?.start_time).format("YYYY-MM-DD HH:mm:ss")}{moment(item?.end_time).format("YYYY-MM-DD HH:mm:ss")}<Button style={{marginLeft:'20px'}} disabled={moment(item?.start_time).unix()>moment(moment().format('YYYY-MM-DD HH:mm:s')).unix()||moment(moment().format('YYYY-MM-DD HH:mm:s')).unix()>moment(item?.end_time).unix()} onClick={()=>{
</Button>
:
StaffDetail?.enrolled &&
<span>
{moment(item?.start_time).format("YYYY-MM-DD HH:mm:ss")}{moment(item?.end_time).format("YYYY-MM-DD HH:mm:ss")}
<Button style={{marginLeft:'20px'}} disabled={moment(item?.start_time).unix()>moment(moment().format('YYYY-MM-DD HH:mm:s')).unix()||moment(moment().format('YYYY-MM-DD HH:mm:s')).unix()>moment(item?.end_time).unix()} onClick={()=>{
// <moment(item?.end_time).unix()
dispatch({
type: 'shixunsDetail/setActionTabs',
@ -190,7 +195,8 @@ function Ranking({ChartRules,ItemData,getCharts,Selectkey,HeaderDetail,getChartR
}
},
})
}}></Button></span>} onChange={(e)=>{
}}></Button>
</span>} onChange={(e)=>{
setIsupdate(false)
let data=ChartRules?.stages?.filter(item=>parseInt(e)===parseInt(item?.id))[0];
setItem(data);

View File

@ -403,7 +403,7 @@ const competitionDetails: FC<PageProps> = ({
{isRanKing ? <RanKing HeaderDetail={HeaderDetail} userinfo={user.userInfo} Editable={HeaderDetail?.permission?.editable} getCharts={getCharts} getChartRules={getChartRules} Selectkey={Selectkey} ChartRules={ChartRules} ItemData={ItemData} /> : null}
{ISsee ? <SeeItem ref={see} StaffDetail={StaffDetail} HeaderDetail={HeaderDetail} userinfo={user.userInfo} Editable={HeaderDetail?.permission?.editable} ItemData={ItemData} setIssee={setIssee} ModelType={ModelType} dispatch={dispatch} /> : null}
{!ISsee && !isRanKing && !isAward && !MdTab ? <UpItem userinfo={user.userInfo} ModelType={ModelType} getrightdatas={getrightdatas} dispatch={dispatch} MenuItem={MenuItem} setIssee={setIssee} identifier={identifier} ItemData={ItemData} /> : null}
{MdTab && <SubmitResult dispatch={dispatch} userinfo={user.userInfo} HeaderDetail={HeaderDetail} Editable={HeaderDetail?.permission?.editable} getCharts={getResults} getChartRules={getTabResults} Selectkey={Selectkey} ChartRules={TabResults} ItemData={ItemData} />}
{MdTab && <SubmitResult dispatch={dispatch} StaffDetail={StaffDetail} userinfo={user.userInfo} HeaderDetail={HeaderDetail} Editable={HeaderDetail?.permission?.editable} getCharts={getResults} getChartRules={getTabResults} Selectkey={Selectkey} ChartRules={TabResults} ItemData={ItemData} />}
</div>
</div>
<AuthModel />