forgeplus-react/src/pages/Competitions/Entered/Enteredmodel/DownTeacher.tsx

58 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//教师列表
import React, { useEffect,useState,FC } from 'react';
import {Empty,message} from 'antd'
import styles from '../index.less'
import ENV from '@/utils/env';
interface Downteacher{
teachers:any
setTeams:any
Teams:any
HeaderDetail:any
}
function Downteacher({teachers,setTeams,Teams,HeaderDetail}:Downteacher){
const teacher=teachers.map((item:any,index:any)=>{
return(
<div key={index} className={styles.teachname} onMouseDown={() => {
if(!item?.authentication&&HeaderDetail?.is_authentication){
message.info('当前竞赛需要实名认证,该用户未进行实名认证不能参与。')
return
}
if(item.enrolled){
message.info('该用户已经加入战队')
return
}
if(Teams?.filter(team=>item.id===team.id).length>0){
message.info('该用户已在战队列表,请不要重复添加')
return
}
let teachers=Teams;
teachers.push(item);
setTeams(teachers)
}}>
<img style={{marginLeft:'10px',marginRight:'3px'}} className={styles.loaderimg} src={`${item.image_url}`}/>
<span style={{textAlign:'left',width:'20%',padding:'0px 5px'}} >{item.name||'- -'}</span>
<span style={{textAlign:'left',width:'18%',padding:'0px 5px'}} >{item.phone||'- -'}</span>
<span style={{textAlign:'left',width:'18%',padding:'0px 5px'}} className={styles.task_hide}>{item.identity||'- -'}</span>
<span style={{textAlign:'left',width:'20%',padding:'0px 5px'}} >{item.school_name||'- -'}</span>
<span style={{textAlign:'left',width:'24%',color:item.enrolled?'#28be6c':!item.enrolled&&item.enrollable===false?'#F3730C':'',padding:'0px 5px',fontSize:'12px'}}>{item.enrolled?'已加入本战队':!item.enrolled&&item.enrollable===false?'已加入其他战队':''}</span>
</div>
)
})
return(
<div className={styles.teacherdown}>
{teachers.length===0?<Empty description={
<div>
<p></p>
<p></p>
<p>~</p>
</div>
} image={Empty.PRESENTED_IMAGE_SIMPLE} />:
<div>
{teacher}
</div>
}
</div>
)
}export default Downteacher