|
|
@ -19,6 +19,7 @@ import RegisListviewdata from './RegisListviewdata';
|
|
|
|
import PersonModal from './competmodal/PersonModal';
|
|
|
|
import PersonModal from './competmodal/PersonModal';
|
|
|
|
import MessagePersonModal from './competmodal/MessagePersonModal';
|
|
|
|
import MessagePersonModal from './competmodal/MessagePersonModal';
|
|
|
|
import PersonalModalteam from './competmodal/PersonalModalteam';
|
|
|
|
import PersonalModalteam from './competmodal/PersonalModalteam';
|
|
|
|
|
|
|
|
import PersonalCompetititem from './personal/PersonalCompetititem'
|
|
|
|
// 团队竞赛报名无报名
|
|
|
|
// 团队竞赛报名无报名
|
|
|
|
class Registration extends React.Component {
|
|
|
|
class Registration extends React.Component {
|
|
|
|
/***
|
|
|
|
/***
|
|
|
@ -53,14 +54,15 @@ class Registration extends React.Component {
|
|
|
|
messagePer: "提示",
|
|
|
|
messagePer: "提示",
|
|
|
|
messagePerbool: false,
|
|
|
|
messagePerbool: false,
|
|
|
|
intpermessages: "确认"
|
|
|
|
intpermessages: "确认"
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
// //console.log("componentDidMount ");
|
|
|
|
//console.log("componentDidMount Registration");
|
|
|
|
// //console.log("调用子组件 ");
|
|
|
|
// ////console.log("调用子组件 ");
|
|
|
|
// //console.log(this.props);
|
|
|
|
//console.log(this.props.isAdmin());
|
|
|
|
// //console.log(this.props.isAdmin())
|
|
|
|
// ////console.log(this.props.isAdmin())
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
this.Getdata(keyword, page, per_page);
|
|
|
|
this.Getdata(keyword, page, per_page);
|
|
|
|
this.GetenrollmentAPI();
|
|
|
|
this.GetenrollmentAPI();
|
|
|
@ -72,8 +74,8 @@ class Registration extends React.Component {
|
|
|
|
axios.get((url)).then((result) => {
|
|
|
|
axios.get((url)).then((result) => {
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
if (result.data) {
|
|
|
|
if (result.data) {
|
|
|
|
//console.log("获取报名配置API");
|
|
|
|
////console.log("获取报名配置API");
|
|
|
|
//console.log(result);
|
|
|
|
////console.log(result);
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
GetenrollmentAPI: result.data,
|
|
|
|
GetenrollmentAPI: result.data,
|
|
|
|
personal: result.data.personal,
|
|
|
|
personal: result.data.personal,
|
|
|
@ -85,7 +87,7 @@ class Registration extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|
//console.log(error);
|
|
|
|
////console.log(error);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -102,24 +104,55 @@ class Registration extends React.Component {
|
|
|
|
axios.get((url), {params: datas}).then((result) => {
|
|
|
|
axios.get((url), {params: datas}).then((result) => {
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
if (result.data) {
|
|
|
|
if (result.data) {
|
|
|
|
//console.log(result);
|
|
|
|
////console.log(result);
|
|
|
|
if (result.data.count === 0) {
|
|
|
|
if (result.data.count === 0) {
|
|
|
|
|
|
|
|
// 没有创建数据的
|
|
|
|
|
|
|
|
if (this.props.isAdmin() === true) {
|
|
|
|
|
|
|
|
//管理员
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
type: 4,
|
|
|
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//普通人
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
type: 1,
|
|
|
|
type: 1,
|
|
|
|
count: result.data.count,
|
|
|
|
count: result.data.count,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//有数据的
|
|
|
|
|
|
|
|
if (this.props.isAdmin() === true) {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
type: 5,
|
|
|
|
data: result.data.competition_teams,
|
|
|
|
data: result.data.competition_teams,
|
|
|
|
count: result.data.count,
|
|
|
|
count: result.data.count,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
} 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 加入了竞赛
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
type: 3,
|
|
|
|
|
|
|
|
data: result.data.competition_teams,
|
|
|
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|
//console.log(error);
|
|
|
|
////console.log(error);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
paginationonChangestwo = (pageNumber) => {
|
|
|
|
paginationonChangestwo = (pageNumber) => {
|
|
|
@ -277,7 +310,7 @@ class Registration extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes} = this.state;
|
|
|
|
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data} = this.state;
|
|
|
|
const listItems = test.map((item, index) =>
|
|
|
|
const listItems = test.map((item, index) =>
|
|
|
|
<RegisListviewdata></RegisListviewdata>
|
|
|
|
<RegisListviewdata></RegisListviewdata>
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -326,7 +359,7 @@ class Registration extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type === 2 || type === 3 || type === 5 ?
|
|
|
|
type === 2 || type === 3 || type === 5 ?
|
|
|
|
<Registrationitem type={type}></Registrationitem>
|
|
|
|
<PersonalCompetititem type={type} data={data}></PersonalCompetititem>
|
|
|
|
: ""
|
|
|
|
: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -335,6 +368,7 @@ class Registration extends React.Component {
|
|
|
|
<RegistrationSearch></RegistrationSearch>
|
|
|
|
<RegistrationSearch></RegistrationSearch>
|
|
|
|
: ""
|
|
|
|
: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{/*<Registrationitem></Registrationitem>*/}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type === 4 || type === 5 ?
|
|
|
|
type === 4 || type === 5 ?
|
|
|
|
<RegisListview></RegisListview>
|
|
|
|
<RegisListview></RegisListview>
|
|
|
|