diff --git a/src/pages/Competitions/Detail/components/InitGitLink/index.less b/src/pages/Competitions/Detail/components/InitGitLink/index.less new file mode 100644 index 00000000..dd31f6ed --- /dev/null +++ b/src/pages/Competitions/Detail/components/InitGitLink/index.less @@ -0,0 +1,12 @@ +.formWrap { + width: 430px; + margin: 0px auto; + text-align: center; + div[class~='ant-form-item-label'] { + width: 70px; + text-align: right; + } + div[class~='ant-form-item-control-input-content'] { + text-align: left; + } +} diff --git a/src/pages/Competitions/Detail/components/InitGitLink/index.tsx b/src/pages/Competitions/Detail/components/InitGitLink/index.tsx new file mode 100644 index 00000000..41f0e99b --- /dev/null +++ b/src/pages/Competitions/Detail/components/InitGitLink/index.tsx @@ -0,0 +1,139 @@ +import React, { FC , useEffect , useState } from 'react'; +import { + GlobalSettingModelState, + UserModelState, + ConnectProps, + Loading, + connect, + Dispatch, +} from 'umi'; +import { Modal, Button , Form , Input, Checkbox } from 'antd'; +import styles from './index.less'; + + +interface PageProps extends Partial { + loading: { [key: string]: boolean; }; + dispatch: Dispatch; + visible:boolean, + onClose: () => void; + user:UserModelState +} +const InitGitlink:FC=({ + visible, + user, + onClose = () => { }, +})=>{ + const [form] = Form.useForm(); + const [ updateEmail , setUpdateEmail ] = useState(false); + + useEffect(()=>{ + if(user?.userInfo?.email){ + setUpdateEmail(true); + form.setFieldsValue({ email: user?.userInfo?.email }); + }else{ + setUpdateEmail(false); + } + },[user?.userInfo]) + + function handleFinish(values:any){ + + } + + return( + +
+ + {user?.userInfo?.real_name} + + + + + { + !updateEmail && + + + + } + + + + + + + +
+
+ ) +} +export default connect( + ({ + loading, + globalSetting, + user, + }: { + loading: Loading; + globalSetting: GlobalSettingModelState; + user:UserModelState + }) => ({ + globalSetting, + loading: loading.effects, + user + }), +)(InitGitlink); diff --git a/src/pages/Competitions/Detail/index.tsx b/src/pages/Competitions/Detail/index.tsx index 0d9f06d9..603ae4fd 100644 --- a/src/pages/Competitions/Detail/index.tsx +++ b/src/pages/Competitions/Detail/index.tsx @@ -28,6 +28,7 @@ import { isSuperAdmin } from '@/utils/authority'; import SubmitResult from './SubmitResult'; import SubCompetition from './components/SubCompetition'; import QR from './mCode.png'; +import InitGitLink from './components/InitGitLink'; interface PageProps extends ConnectProps { globalSetting: GlobalSettingModelState; @@ -75,9 +76,15 @@ const competitionDetails: FC = ({ const [isshowType, setisshowType] = useState(); const [ subComShow , setSubComShow ] = useState(false); + const [ subGitlinkShow , setSubGitlinkShow ] = useState(false); const [ subComList , setSubComList] = useState([]); const loction = useLocation(); - const see = useRef(null) + const see = useRef(null); + + useEffect(()=>{ + setSubGitlinkShow(true); + },[]) + useEffect(() => { async function init() { setStaffDetail(await dispatch({ @@ -315,6 +322,7 @@ const competitionDetails: FC = ({ return (
setSubComShow(false)} filterlist={subComList}/> + setSubGitlinkShow(false)}/> 在线竞赛 {HeaderDetail.name}{HeaderDetail.sub_title ? '-' + HeaderDetail.sub_title : null}