forked from Gitlink/forgeplus-react
update-new competition
This commit is contained in:
parent
79ee54fbe6
commit
772b736ad6
|
@ -54,7 +54,7 @@ export default defineConfig({
|
|||
},
|
||||
ignoreMomentLocale: true,
|
||||
hash: true,
|
||||
title: "forge",
|
||||
title: "GitLink",
|
||||
routes,
|
||||
locale: {
|
||||
default: "zh-CN",
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
.lists {
|
||||
padding: 0px 15px;
|
||||
li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 70px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #eee;
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
a:first-child {
|
||||
flex: 1;
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
import React, { FC , useEffect , useState } from 'react';
|
||||
import {
|
||||
GlobalSettingModelState,
|
||||
ConnectProps,
|
||||
Loading,
|
||||
connect,
|
||||
Dispatch,
|
||||
} from 'umi';
|
||||
import { Modal, Button } from 'antd';
|
||||
import styles from './Index.less';
|
||||
import { openNewWindow } from '@/utils/util';
|
||||
|
||||
|
||||
interface PageProps extends Partial<ConnectProps> {
|
||||
filterlist: any;
|
||||
loading: { [key: string]: boolean; };
|
||||
dispatch: Dispatch;
|
||||
visible:boolean,
|
||||
onClose: () => void;
|
||||
}
|
||||
const SubCompetition:FC<PageProps>=({
|
||||
filterlist,
|
||||
visible,
|
||||
onClose = () => { },
|
||||
})=>{
|
||||
const [ list , setList ] = useState<any>([]);
|
||||
|
||||
useEffect(()=>{
|
||||
if(filterlist && filterlist.list && filterlist.list.length > 0 ){
|
||||
setList(filterlist.list);
|
||||
console.log(filterlist.list);
|
||||
}
|
||||
},[filterlist])
|
||||
return(
|
||||
<Modal
|
||||
centered
|
||||
keyboard={false}
|
||||
closable={true}
|
||||
destroyOnClose={true}
|
||||
visible={visible}
|
||||
title="选择报名赛事"
|
||||
width="600px"
|
||||
onCancel={onClose}
|
||||
footer={null}
|
||||
>
|
||||
{
|
||||
list && list.length>0 &&
|
||||
<ul className={styles.lists}>
|
||||
{
|
||||
list.map(function(i:any,k:number){
|
||||
return(
|
||||
<li>
|
||||
<a href={i.url} className={`c-grey-333 multi-llipsis1e`}>{i.name}</a>
|
||||
<Button href={i.url} type={"primary"}>报名此赛事</Button>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</ul>
|
||||
}
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default connect(
|
||||
({
|
||||
loading,
|
||||
globalSetting,
|
||||
}: {
|
||||
loading: Loading;
|
||||
globalSetting: GlobalSettingModelState;
|
||||
}) => ({
|
||||
globalSetting,
|
||||
loading: loading.effects,
|
||||
}),
|
||||
)(SubCompetition);
|
|
@ -25,7 +25,8 @@ import ENV from '@/utils/env';
|
|||
import { getCookie, openNewWindow,setCookie,setDocumentTitle } from '@/utils/util';
|
||||
import { handleVerifyLogin, handleVerify , handleProfleCompletedModal } from '@/utils/verifyLogin';
|
||||
import { isSuperAdmin } from '@/utils/authority';
|
||||
import SubmitResult from './SubmitResult'
|
||||
import SubmitResult from './SubmitResult';
|
||||
import SubCompetition from './components/SubCompetition';
|
||||
import QR from './mCode.png';
|
||||
|
||||
interface PageProps extends ConnectProps {
|
||||
|
@ -72,6 +73,9 @@ const competitionDetails: FC<PageProps> = ({
|
|||
const [TabResults, setTabResults] = useState<any>([]);
|
||||
//弹窗
|
||||
const [isshowType, setisshowType] = useState<any>();
|
||||
|
||||
const [ subComShow , setSubComShow ] = useState<any>(false);
|
||||
const [ subComList , setSubComList] = useState<any>([]);
|
||||
const loction = useLocation();
|
||||
const see = useRef(null)
|
||||
useEffect(() => {
|
||||
|
@ -163,6 +167,18 @@ const competitionDetails: FC<PageProps> = ({
|
|||
if(!handleProfleCompletedModal()){
|
||||
return;
|
||||
}
|
||||
if(globalSetting?.setting?.sub_competitions){
|
||||
let subArr = globalSetting?.setting?.sub_competitions;
|
||||
if(subArr.length>0){
|
||||
let filterArr = subArr.filter((i:any)=>i.identifier === item.identifier);
|
||||
console.log(filterArr);
|
||||
if(filterArr && filterArr.length >0 ){
|
||||
setSubComShow(true);
|
||||
setSubComList(filterArr[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (HeaderDetail?.is_authentication && !user?.userInfo?.authentication) {
|
||||
dispatch({
|
||||
|
@ -173,11 +189,11 @@ const competitionDetails: FC<PageProps> = ({
|
|||
})
|
||||
return
|
||||
}
|
||||
if(item.identifier === "gcc-courses-2022" || item.identifier === "gcc_2022_projects_type2" || item.identifier === "gcc_2022_projects_type1"){
|
||||
let arr = HeaderDetail.competition_modules?.filter((item:any)=>item.name === "赛事发布");
|
||||
arr && arr.length > 0 && getrightdatas(arr[0]);
|
||||
return;
|
||||
}
|
||||
// if(item.identifier === "gcc_2022_projects_type2" || item.identifier === "gcc_2022_projects_type1"){
|
||||
// let arr = HeaderDetail.competition_modules?.filter((item:any)=>item.name === "赛事发布");
|
||||
// arr && arr.length > 0 && getrightdatas(arr[0]);
|
||||
// return;
|
||||
// }
|
||||
if (url === "ismodel") {
|
||||
if (item.member_of_course === true) {
|
||||
openNewWindow(`/classrooms/${item.course_id}`)
|
||||
|
@ -293,6 +309,7 @@ const competitionDetails: FC<PageProps> = ({
|
|||
|
||||
return (
|
||||
<div className={"edu-container minH500"}>
|
||||
<SubCompetition visible={subComShow} onClose={()=>setSubComShow(false)} filterlist={subComList}/>
|
||||
<Breadcrumb className="mt10" separator=">">
|
||||
<Breadcrumb.Item><Link to={"/competitions/index"}>在线竞赛</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item>{HeaderDetail.name}{HeaderDetail.sub_title ? '-' + HeaderDetail.sub_title : null}</Breadcrumb.Item>
|
||||
|
@ -336,6 +353,7 @@ const competitionDetails: FC<PageProps> = ({
|
|||
HeaderDetail.competition_status !== 'nearly_published' && HeaderDetail.enroll_end && HeaderDetail.competition_status !== 'ended' ?
|
||||
<Button type="primary" className={styles.buttonsize} disabled={true} >报名截止</Button> : null
|
||||
}
|
||||
{/* */}
|
||||
{HeaderDetail.competition_status === 'progressing' && HeaderDetail.enroll_end != true ? <Button type="primary" disabled={StaffDetail.enrolled && !HeaderDetail.need_attachment} className={styles.buttonsize} style={{fontSize:"18px"}} onClick={
|
||||
(e) => {
|
||||
if (StaffDetail.enrolled && HeaderDetail.need_attachment) {
|
||||
|
@ -344,7 +362,7 @@ const competitionDetails: FC<PageProps> = ({
|
|||
}
|
||||
gotocourse(e, HeaderDetail, HeaderDetail.mode === 2 ? 'ismodel' : HeaderDetail.personal ? 'personal' : `/competitions/index/${HeaderDetail.identifier}/enroll`)
|
||||
}
|
||||
}>{StaffDetail.enrolled ? HeaderDetail.need_attachment ? '上传作品' : '已报名' : (HeaderDetail.identifier === "gcc-courses-2022" || HeaderDetail.identifier === "gcc_2022_projects_type2" || HeaderDetail.identifier === "gcc_2022_projects_type1" ? "前往“赛事发布”板块报名":'立即报名')}</Button> : null}
|
||||
}>{StaffDetail.enrolled ? HeaderDetail.need_attachment ? '上传作品' : '已报名' : '立即报名'}</Button> : null}
|
||||
{user.userInfo.real_name != "游客" && <span onClick={(e) => gotocourse(e, HeaderDetail, `/competitions/index/${HeaderDetail.identifier}/enroll`)} className={styles.myteam}>{isSuperAdmin() ? '参赛战队>>' : '我的战队>>'}</span>}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -122,10 +122,7 @@ const competitionsPage: FC<PageProps> = ({
|
|||
})
|
||||
return
|
||||
}
|
||||
if(item.identifier === "gcc-courses-2022" || item.identifier === "gcc_2022_projects_type2" || item.identifier === "gcc_2022_projects_type1"){
|
||||
openNewWindow(`/competitions/index/${item.identifier}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (url === "ismodel") {
|
||||
if (item.member_of_course === true) {
|
||||
openNewWindow(`/classrooms/${item.course_id}`)
|
||||
|
@ -276,7 +273,7 @@ const competitionsPage: FC<PageProps> = ({
|
|||
{item && item.competition_status === 'nearly_published' ? <span className={styles.Unpublishedtext} onClick={(e) => noclick(e)}>未发布</span> : null}
|
||||
{item && item.competition_status !== 'nearly_published' && item.enroll_end && item.competition_status !== 'ended' ? <span className={styles.Unpublishedtext} onClick={(e) => noclick(e)}>报名截止</span> : null}
|
||||
{item && item.competition_status === 'progressing' && item.enroll_end != true ? <Button className={styles.signup} onClick={
|
||||
(e) => gotocourse(e, item, item.mode === 2 ? 'ismodel' : item.personal ? 'personal' : `/competitions/index/${item.identifier}/enroll`)
|
||||
(e) => gotocourse(e, item, item.mode === 2 ? 'ismodel' : item.personal ? 'personal' : `/competitions/index/${item.identifier}`)
|
||||
|
||||
} style={{ cursor: 'pointer'}}>立即报名</Button> : null}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<meta http-equiv="Cache-Control" content="no-transform" />
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="viewport" content="width=1226">
|
||||
<title>forge</title>
|
||||
<title>GitLink</title>
|
||||
<meta name="keywords" content="头歌,EduCoder,信息技术实践教学,精品课程网,慕课MOOC">
|
||||
<meta name="google" content="notranslate" />
|
||||
<meta http-equiv="Content-language" content="en">
|
||||
|
|
|
@ -22,7 +22,7 @@ export interface ConfigProps {
|
|||
|
||||
export const GlobalConfig: ConfigProps = {
|
||||
local: {
|
||||
API_SERVER: 'http://localhost:3000',
|
||||
API_SERVER: 'https://pre-data.educoder.net',
|
||||
IMG_SERVER: 'https://testforgeplus.trustie.net/',
|
||||
REPORT_SERVER: "http://192.168.1.57:3001",
|
||||
FORGE: "https://test-oldweb.educoder.net/",
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
export const DEV = {
|
||||
PROXY_SERVER: "https://kepukehuan-data.educoder.net",
|
||||
API_SERVER: "http://localhost:8000",
|
||||
API_SERVER: "https://pre-data.educoder.net",
|
||||
REPORT_SERVER: "http://192.168.1.57:3001",
|
||||
IMG_SERVER: 'https://new-testali-cdn.educoder.net',
|
||||
FORGE: "https://code.educoder.net/",
|
||||
SSH_SERVER:"wss://webssh.educoder.net",
|
||||
QQLoginCB: encodeURIComponent("https://test-newweb.educoder.net"),
|
||||
FORGE_SERVER:"https://testforgeplus.trustie.net"
|
||||
FORGE_SERVER:"https://pre.gitlink.org.cn"
|
||||
}
|
||||
|
||||
export default DEV
|
Loading…
Reference in New Issue