|
|
|
@ -9,7 +9,7 @@ import moment from 'moment';
|
|
|
|
|
import {SnackbarHOC, WordsBtn} from 'educoder';
|
|
|
|
|
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
|
|
|
|
|
import competition from './comcss/competition.css';
|
|
|
|
|
import {Button, Pagination, message} from 'antd';
|
|
|
|
|
import {Button, Pagination, message, Spin} from 'antd';
|
|
|
|
|
import Registrationitem from './Registrationitem';
|
|
|
|
|
import RegisNodata from './RegisNodata';
|
|
|
|
|
import CompetitionMaxImg from './CompetitionMaxImg';
|
|
|
|
@ -19,7 +19,10 @@ import RegisListviewdata from './RegisListviewdata';
|
|
|
|
|
import PersonModal from './competmodal/PersonModal';
|
|
|
|
|
import MessagePersonModal from './competmodal/MessagePersonModal';
|
|
|
|
|
import PersonalModalteam from './competmodal/PersonalModalteam';
|
|
|
|
|
import PersonalCompetititem from './personal/PersonalCompetititem'
|
|
|
|
|
import PersonalCompetititem from './personal/PersonalCompetititem';
|
|
|
|
|
import ExittheteamModel from './competmodal/ExittheteamModel';
|
|
|
|
|
import pexjiazai from "./pexjiazai.png";
|
|
|
|
|
|
|
|
|
|
// 团队竞赛报名无报名
|
|
|
|
|
class Registration extends React.Component {
|
|
|
|
|
/***
|
|
|
|
@ -28,6 +31,7 @@ class Registration extends React.Component {
|
|
|
|
|
*"enrolled: false, // 是否已经报名
|
|
|
|
|
*"teacher_staff": { // 为空表示不支持老师报名
|
|
|
|
|
*"member_staff": { // 为空表示不支持学生报名
|
|
|
|
|
* personal// 是否是个人赛
|
|
|
|
|
* **/
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
@ -44,6 +48,7 @@ class Registration extends React.Component {
|
|
|
|
|
page: 1,
|
|
|
|
|
per_page: 20,
|
|
|
|
|
data: [],
|
|
|
|
|
competition_teams: [],
|
|
|
|
|
count: 0,
|
|
|
|
|
GetenrollmentAPI: undefined,
|
|
|
|
|
personal: false,
|
|
|
|
@ -53,29 +58,65 @@ class Registration extends React.Component {
|
|
|
|
|
member_staff: null,
|
|
|
|
|
messagePer: "提示",
|
|
|
|
|
messagePerbool: false,
|
|
|
|
|
intpermessages: "确认"
|
|
|
|
|
intpermessages: "确认",
|
|
|
|
|
messageexit: "提示",
|
|
|
|
|
messageexitol: false,
|
|
|
|
|
exitintpermessages: "是否退出战队",
|
|
|
|
|
itemid: undefined,
|
|
|
|
|
itemiddata: [],
|
|
|
|
|
pint: 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
//console.log("componentDidMount Registration");
|
|
|
|
|
// ////console.log("调用子组件 ");
|
|
|
|
|
//console.log(this.props.isAdmin());
|
|
|
|
|
// ////console.log(this.props.isAdmin())
|
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
|
this.Getdata(keyword, page, per_page);
|
|
|
|
|
// ////console.log("componentDidMount Registration");
|
|
|
|
|
// //// ////console.log("调用子组件 ");
|
|
|
|
|
// ////console.log(this.props.isAdmin());
|
|
|
|
|
// //// ////console.log(this.props.isAdmin())
|
|
|
|
|
this.GetenrollmentAPI();
|
|
|
|
|
this.Getthenavigationbar();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
|
if (prevProps.user != this.props.user) {
|
|
|
|
|
//console.log("Registration");
|
|
|
|
|
//console.log("componentDidUpdate");
|
|
|
|
|
//console.log(this.props.user.admin);
|
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
|
this.Getdata(keyword, page, per_page, this.props.user.admin);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 获取导航栏
|
|
|
|
|
Getthenavigationbar = () => {
|
|
|
|
|
const url = `/competitions/${"gcc-task-2020"}/competition_modules.json`;
|
|
|
|
|
axios.get((url)).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
//// ////console.log("获取报名配置API");
|
|
|
|
|
//// ////console.log(result);
|
|
|
|
|
console.log("Getthenavigationbar");
|
|
|
|
|
console.log(result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
//// ////console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//获取报名配置API
|
|
|
|
|
GetenrollmentAPI = () => {
|
|
|
|
|
const url = `/competitions/${"gcc-course-2019"}/competition_staff.json`;
|
|
|
|
|
const url = `/competitions/${"gcc-task-2020"}/competition_staff.json`;
|
|
|
|
|
axios.get((url)).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
////console.log("获取报名配置API");
|
|
|
|
|
////console.log(result);
|
|
|
|
|
//// ////console.log("获取报名配置API");
|
|
|
|
|
//// ////console.log(result);
|
|
|
|
|
this.setState({
|
|
|
|
|
GetenrollmentAPI: result.data,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
@ -84,14 +125,27 @@ class Registration extends React.Component {
|
|
|
|
|
teacher_staff: result.data.teacher_staff,
|
|
|
|
|
member_staff: result.data.member_staff,
|
|
|
|
|
})
|
|
|
|
|
if (result.data.enroll_ended === true) {
|
|
|
|
|
this.setState({
|
|
|
|
|
pint: 0
|
|
|
|
|
})
|
|
|
|
|
} else if (result.data.enrolled === true) {
|
|
|
|
|
this.setState({
|
|
|
|
|
pint: 2
|
|
|
|
|
})
|
|
|
|
|
} else if (result.data.enrolled === false) {
|
|
|
|
|
this.setState({
|
|
|
|
|
pint: 1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
////console.log(error);
|
|
|
|
|
//// ////console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Getdata = (keyword, page, per_page) => {
|
|
|
|
|
Getdata = (keyword, page, per_page, admin) => {
|
|
|
|
|
//搜索关键字 keyword
|
|
|
|
|
//页数 page
|
|
|
|
|
//分页 per_page
|
|
|
|
@ -100,66 +154,234 @@ class Registration extends React.Component {
|
|
|
|
|
page: page,
|
|
|
|
|
per_page: per_page,
|
|
|
|
|
};
|
|
|
|
|
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
|
|
|
|
|
let url = `/competitions/${"gcc-task-2020"}/competition_teams.json`;
|
|
|
|
|
axios.get((url), {params: datas}).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
////console.log(result);
|
|
|
|
|
if (result.data.count === 0) {
|
|
|
|
|
// 没有创建数据的
|
|
|
|
|
if (this.props.isAdmin() === true) {
|
|
|
|
|
//管理员
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 4,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
})
|
|
|
|
|
//// ////console.log(result);\
|
|
|
|
|
if (result.data.personal === false) {
|
|
|
|
|
//不是个人赛
|
|
|
|
|
if (result.data.my_teams.length === 0) {
|
|
|
|
|
// 没有创建数据的
|
|
|
|
|
if (admin === true) {
|
|
|
|
|
//管理员
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 4,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
//普通账号
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 1,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//普通人
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 1,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
})
|
|
|
|
|
//有数据的
|
|
|
|
|
|
|
|
|
|
if (admin === true) {
|
|
|
|
|
if (result.data.my_teams[0].manage_permission === true) {
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 5,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 4,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (result.data.my_teams[0].manage_permission === true) {
|
|
|
|
|
//普通账号true 为创建了竞赛
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 2,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
//普通账号true 加入了竞赛
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 3,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 6,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
loadingstate: false,
|
|
|
|
|
})
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
if (admin === true) {
|
|
|
|
|
//管理员
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 4,
|
|
|
|
|
count: 0,
|
|
|
|
|
competition_teams: [],
|
|
|
|
|
data: [],
|
|
|
|
|
loadingstate: false,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
//普通账号
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 1,
|
|
|
|
|
count: 0,
|
|
|
|
|
competition_teams: [],
|
|
|
|
|
data: [],
|
|
|
|
|
loadingstate: false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Getdatatype5 = (keyword, page, per_page, admin) => {
|
|
|
|
|
//搜索关键字 keyword
|
|
|
|
|
//页数 page
|
|
|
|
|
//分页 per_page
|
|
|
|
|
const datas = {
|
|
|
|
|
keyword: keyword,
|
|
|
|
|
page: page,
|
|
|
|
|
per_page: per_page,
|
|
|
|
|
};
|
|
|
|
|
let url = `/competitions/${"gcc-task-2020"}/competition_teams.json`;
|
|
|
|
|
axios.get((url), {params: datas}).then((result) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
loadingstate: false,
|
|
|
|
|
})
|
|
|
|
|
if (result) {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
//// ////console.log(result);
|
|
|
|
|
if (result.data.personal === false) {
|
|
|
|
|
//不是个人赛
|
|
|
|
|
//console.log("Getdatatype5");
|
|
|
|
|
//console.log(result.data.my_teams.length);
|
|
|
|
|
if (result.data.my_teams.length === 0) {
|
|
|
|
|
// 没有创建数据的
|
|
|
|
|
//管理员
|
|
|
|
|
//console.log("a");
|
|
|
|
|
//console.log(this.state.competition_teams);
|
|
|
|
|
//console.log(result.data.competition_teams);
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 4,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
//有数据的
|
|
|
|
|
if (this.props.isAdmin() === true) {
|
|
|
|
|
//console.log("b");
|
|
|
|
|
|
|
|
|
|
if (result.data.my_teams[0].manage_permission === true) {
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 5,
|
|
|
|
|
data: result.data.competition_teams,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
if (result.data.competition_teams[0].manage_permission === true) {
|
|
|
|
|
//学生true 为创建了竞赛
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 2,
|
|
|
|
|
data: result.data.competition_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
//学生true 加入了竞赛
|
|
|
|
|
//console.log("c");
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 3,
|
|
|
|
|
data: result.data.competition_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
type: 4,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//团队赛
|
|
|
|
|
//console.log("d");
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 6,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
////console.log(error);
|
|
|
|
|
//console.log("k");
|
|
|
|
|
|
|
|
|
|
//console.log(error);
|
|
|
|
|
//console.log("报错了");
|
|
|
|
|
if (admin === true) {
|
|
|
|
|
//管理员
|
|
|
|
|
this.setState({
|
|
|
|
|
count: 0,
|
|
|
|
|
competition_teams: [],
|
|
|
|
|
data: [],
|
|
|
|
|
loadingstate: false,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
//普通账号
|
|
|
|
|
this.setState({
|
|
|
|
|
count: 0,
|
|
|
|
|
competition_teams: [],
|
|
|
|
|
data: [],
|
|
|
|
|
loadingstate: false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//团队竞赛翻页
|
|
|
|
|
paginationonChangestwo = (pageNumber) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
pages: pageNumber,
|
|
|
|
|
loadingstate: true,
|
|
|
|
|
})
|
|
|
|
|
const {keyword, per_page} = this.state;
|
|
|
|
|
this.Getdatatype5(keyword, pageNumber, per_page, this.props.user.admin);
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* 加入战队
|
|
|
|
@ -246,7 +468,8 @@ class Registration extends React.Component {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
tmodalsType: true
|
|
|
|
|
tmodalsType: true,
|
|
|
|
|
Newtit: true,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
//学生
|
|
|
|
@ -259,16 +482,20 @@ class Registration extends React.Component {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
tmodalsType: true
|
|
|
|
|
tmodalsType: true,
|
|
|
|
|
Newtit: true,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
// tmodalsType: true
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//编辑战队
|
|
|
|
|
Createateamedit = (data) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
tmodalsType: true,
|
|
|
|
|
Newtit: false,
|
|
|
|
|
itemiddata: data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
Tmoconfirm = (bool) => {
|
|
|
|
|
//boolfalse 取消 true 确认
|
|
|
|
|
this.setState({
|
|
|
|
@ -285,7 +512,7 @@ class Registration extends React.Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//创建战队确认
|
|
|
|
|
Tmoconfirm1 = (bool) => {
|
|
|
|
|
//boolfalse 取消 true 确认
|
|
|
|
|
this.setState({
|
|
|
|
@ -293,8 +520,7 @@ class Registration extends React.Component {
|
|
|
|
|
})
|
|
|
|
|
if (bool) {
|
|
|
|
|
//确认
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.Refreshteam();
|
|
|
|
|
} else {
|
|
|
|
|
//取消
|
|
|
|
|
|
|
|
|
@ -308,12 +534,136 @@ class Registration extends React.Component {
|
|
|
|
|
messagePerbool: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//显示退出战队弹框
|
|
|
|
|
Exittheteamshow = (itemid, bool) => {
|
|
|
|
|
if (bool === true) {
|
|
|
|
|
this.setState({
|
|
|
|
|
messageexitol: true,
|
|
|
|
|
itemid: itemid,
|
|
|
|
|
exitintpermessages: "是否删除战队",
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
messageexitol: true,
|
|
|
|
|
itemid: itemid,
|
|
|
|
|
exitintpermessages: "是否退出战队",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
//刷新战队
|
|
|
|
|
Refreshteam = () => {
|
|
|
|
|
|
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
|
this.Getdata(keyword, page, per_page, this.props.user.admin);
|
|
|
|
|
this.GetenrollmentAPI();
|
|
|
|
|
}
|
|
|
|
|
//退出战队
|
|
|
|
|
Exittheteam = (bool) => {
|
|
|
|
|
// ////console.log(this.state.itemid);
|
|
|
|
|
if (bool) {
|
|
|
|
|
this.setState({
|
|
|
|
|
messageexitol: true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let url = `/competitions/${"gcc-task-2020"}/competition_teams/${this.state.itemid}/leave.json`;
|
|
|
|
|
axios.post(url).then((response) => {
|
|
|
|
|
if (response) {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
////console.log("退出战队");
|
|
|
|
|
////console.log(response);
|
|
|
|
|
this.Refreshteam();
|
|
|
|
|
this.setState({
|
|
|
|
|
messageexitol: false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
////console.log(error)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
messageexitol: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//搜索战队
|
|
|
|
|
RegistrationSearchvalue = (value) => {
|
|
|
|
|
//console.log("RegistrationSearchvalue");
|
|
|
|
|
//console.log(this.props.user.admin);
|
|
|
|
|
this.setState({
|
|
|
|
|
pages: 1,
|
|
|
|
|
limit: 20,
|
|
|
|
|
})
|
|
|
|
|
this.Getdatatype5(value, 1, 20, this.props.user.admin);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//个人竞赛
|
|
|
|
|
// /competitions/:identifier/competition_teams.json
|
|
|
|
|
Personalregistration = () => {
|
|
|
|
|
let {teacher_staff, member_staff, data, enroll_ended} = this.state;
|
|
|
|
|
if (enroll_ended === true) {
|
|
|
|
|
//已截止
|
|
|
|
|
this.props.showNotification(`报名已截止`);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (teacher_staff) {
|
|
|
|
|
if (teacher_staff.mutiple_limited) {
|
|
|
|
|
if (teacher_staff.mutiple_limited === true) {
|
|
|
|
|
if (data) {
|
|
|
|
|
if (data.length > teacher_staff.maximum) {
|
|
|
|
|
this.props.showNotification(`你已经报名,不能重复报名!`);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (member_staff) {
|
|
|
|
|
if (member_staff.mutiple_limited) {
|
|
|
|
|
if (member_staff.mutiple_limited === true) {
|
|
|
|
|
if (data) {
|
|
|
|
|
if (data.length > member_staff.maximum) {
|
|
|
|
|
this.props.showNotification(`你已经报名,不能重复报名!`);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const url = `/competitions/${"gcc-task-2020"}/competition_teams.json`;
|
|
|
|
|
axios.post(url).then((response) => {
|
|
|
|
|
if (response) {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
|
|
|
|
|
this.Refreshteam();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data} = this.state;
|
|
|
|
|
const listItems = test.map((item, index) =>
|
|
|
|
|
<RegisListviewdata></RegisListviewdata>
|
|
|
|
|
);
|
|
|
|
|
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state;
|
|
|
|
|
// var listItems = "";
|
|
|
|
|
|
|
|
|
|
// if (competition_teams) {
|
|
|
|
|
// listItems = competition_teams.map((item, index) =>
|
|
|
|
|
//
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// const listItemss = test.map((item, index) =>
|
|
|
|
|
//
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix ">
|
|
|
|
@ -329,12 +679,36 @@ class Registration extends React.Component {
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state}
|
|
|
|
|
messagePerboolbuton={() => this.messagePerboolbuton()}></MessagePersonModal>
|
|
|
|
|
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={true}
|
|
|
|
|
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}></PersonModal>
|
|
|
|
|
<PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state}
|
|
|
|
|
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
|
|
|
|
|
{
|
|
|
|
|
messagePerbool === true ?
|
|
|
|
|
<MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state}
|
|
|
|
|
messagePerboolbuton={() => this.messagePerboolbuton()}
|
|
|
|
|
GetenrollmentAPI={GetenrollmentAPI}></MessagePersonModal>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
tmodalsType === true ?
|
|
|
|
|
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={Newtit}
|
|
|
|
|
itemiddata={itemiddata} GetenrollmentAPI={GetenrollmentAPI}
|
|
|
|
|
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}></PersonModal>
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
tmodalsTypes === true ?
|
|
|
|
|
<PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state}
|
|
|
|
|
GetenrollmentAPI={GetenrollmentAPI}
|
|
|
|
|
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
messageexitol === true ?
|
|
|
|
|
<ExittheteamModel {...this.props} {...this.state} GetenrollmentAPI={GetenrollmentAPI}
|
|
|
|
|
Exittheteam={(bool) => this.Exittheteam(bool)}></ExittheteamModel>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<div className="educontent mb20 ">
|
|
|
|
|
<p className="clearfix mb20 mt10">
|
|
|
|
|
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
|
|
|
|
@ -347,25 +721,62 @@ class Registration extends React.Component {
|
|
|
|
|
</div>
|
|
|
|
|
{/*大图*/}
|
|
|
|
|
<CompetitionMaxImg type={type} Jointheteam={() => this.Jointheteam()}
|
|
|
|
|
pint={pint}
|
|
|
|
|
{...this.props} {...this.state}
|
|
|
|
|
Createateam={() => this.Createateam()}></CompetitionMaxImg>
|
|
|
|
|
Createateam={() => this.Createateam()}
|
|
|
|
|
Personalregistration={() => this.Personalregistration()}
|
|
|
|
|
></CompetitionMaxImg>
|
|
|
|
|
{/*大图结尾*/}
|
|
|
|
|
{/*没数据*/}
|
|
|
|
|
{
|
|
|
|
|
pint === 1 || pint === 3 ?
|
|
|
|
|
<div style={{
|
|
|
|
|
marginTop: "22px"
|
|
|
|
|
}}>
|
|
|
|
|
<p>参赛总人数:<span style={{color: "#459BE5"}}>{data === null || data === undefined ? 0 : data.length}</span>人
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
: ""}
|
|
|
|
|
{/*列表*/}
|
|
|
|
|
{
|
|
|
|
|
type === 6 ?
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
marginTop: "31px"
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Spin spinning={loadingstate}>
|
|
|
|
|
{
|
|
|
|
|
data && data.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<Registrationitem key={index} item={item}></Registrationitem>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</Spin>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
: ""}
|
|
|
|
|
{
|
|
|
|
|
type === 1 ?
|
|
|
|
|
<RegisNodata></RegisNodata>
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
{/*普通账号出现单人 战队弹框*/}
|
|
|
|
|
{
|
|
|
|
|
type === 2 || type === 3 || type === 5 ?
|
|
|
|
|
<PersonalCompetititem type={type} data={data}></PersonalCompetititem>
|
|
|
|
|
<PersonalCompetititem type={type} data={data}
|
|
|
|
|
Exittheteamshow={(itemid) => this.Exittheteamshow(itemid)}
|
|
|
|
|
Createateamedit={(itemid) => this.Createateamedit(itemid)}></PersonalCompetititem>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
type === 4 || type === 5 ?
|
|
|
|
|
<RegistrationSearch></RegistrationSearch>
|
|
|
|
|
<RegistrationSearch count={count}
|
|
|
|
|
RegistrationSearchvalue={(value) => this.RegistrationSearchvalue(value)}></RegistrationSearch>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
{/*<Registrationitem></Registrationitem>*/}
|
|
|
|
@ -378,19 +789,38 @@ class Registration extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{type === 4 || type === 5 ?
|
|
|
|
|
listItems
|
|
|
|
|
<Spin spinning={loadingstate}>
|
|
|
|
|
{
|
|
|
|
|
competition_teams && competition_teams.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<RegisListviewdata key={index} item={item}></RegisListviewdata>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</Spin>
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
type === 4 || type === 5 ?
|
|
|
|
|
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
|
|
|
|
|
<Pagination showQuickJumper current={pages}
|
|
|
|
|
onChange={this.paginationonChangestwo} pageSize={limit}
|
|
|
|
|
total={30}></Pagination>
|
|
|
|
|
</div>
|
|
|
|
|
: ""
|
|
|
|
|
(
|
|
|
|
|
count < 20 ? <div style={{
|
|
|
|
|
height: "20px",
|
|
|
|
|
minHeight: "20px"
|
|
|
|
|
}}></div> :
|
|
|
|
|
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
|
|
|
|
|
<Pagination showQuickJumper current={pages}
|
|
|
|
|
onChange={this.paginationonChangestwo} pageSize={limit}
|
|
|
|
|
total={count}></Pagination>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
: <div style={{
|
|
|
|
|
height: "20px",
|
|
|
|
|
minHeight: "20px"
|
|
|
|
|
}}></div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|