|
|
|
@ -22,6 +22,7 @@ import PersonalModalteam from './competmodal/PersonalModalteam';
|
|
|
|
|
import PersonalCompetititem from './personal/PersonalCompetititem';
|
|
|
|
|
import ExittheteamModel from './competmodal/ExittheteamModel';
|
|
|
|
|
import pexjiazai from "./pexjiazai.png";
|
|
|
|
|
|
|
|
|
|
// 团队竞赛报名无报名
|
|
|
|
|
class Registration extends React.Component {
|
|
|
|
|
/***
|
|
|
|
@ -74,6 +75,8 @@ class Registration extends React.Component {
|
|
|
|
|
// //// ////console.log("调用子组件 ");
|
|
|
|
|
// ////console.log(this.props.isAdmin());
|
|
|
|
|
// //// ////console.log(this.props.isAdmin())
|
|
|
|
|
this.GetenrollmentAPI();
|
|
|
|
|
this.Getthenavigationbar();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -85,12 +88,26 @@ class Registration extends React.Component {
|
|
|
|
|
//console.log(this.props.user.admin);
|
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
|
this.Getdata(keyword, page, per_page, this.props.user.admin);
|
|
|
|
|
this.GetenrollmentAPI();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取导航栏
|
|
|
|
|
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(result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
//// ////console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//获取报名配置API
|
|
|
|
|
GetenrollmentAPI = () => {
|
|
|
|
|
const url = `/competitions/${"gcc-task-2020"}/competition_staff.json`;
|
|
|
|
@ -591,35 +608,45 @@ class Registration extends React.Component {
|
|
|
|
|
//个人竞赛
|
|
|
|
|
// /competitions/:identifier/competition_teams.json
|
|
|
|
|
Personalregistration = () => {
|
|
|
|
|
let {teacher_staff, member_staff, data} = this.state;
|
|
|
|
|
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 === true) {
|
|
|
|
|
if (data) {
|
|
|
|
|
if (data.length > teacher_staff.maximum) {
|
|
|
|
|
message.success('已限制多次报名!');
|
|
|
|
|
return
|
|
|
|
|
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 (teacher_staff.mutiple_limited === true) {
|
|
|
|
|
if (member_staff.mutiple_limited) {
|
|
|
|
|
if (member_staff.mutiple_limited === true) {
|
|
|
|
|
if (data) {
|
|
|
|
|
if (data.length > teacher_staff.maximum) {
|
|
|
|
|
message.success('已限制多次报名!');
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -631,7 +658,7 @@ class Registration extends React.Component {
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state;
|
|
|
|
|
var listItems = "";
|
|
|
|
|
// var listItems = "";
|
|
|
|
|
|
|
|
|
|
// if (competition_teams) {
|
|
|
|
|
// listItems = competition_teams.map((item, index) =>
|
|
|
|
@ -716,7 +743,7 @@ class Registration extends React.Component {
|
|
|
|
|
: ""}
|
|
|
|
|
{/*列表*/}
|
|
|
|
|
{
|
|
|
|
|
pint === 1 || pint === 3 ?
|
|
|
|
|
type === 6 ?
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
marginTop: "31px"
|
|
|
|
@ -726,7 +753,7 @@ class Registration extends React.Component {
|
|
|
|
|
{
|
|
|
|
|
data && data.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<Registrationitem item={item}></Registrationitem>
|
|
|
|
|
<Registrationitem key={index} item={item}></Registrationitem>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|