|
|
|
@ -31,7 +31,10 @@ class EcStudentList extends Component {
|
|
|
|
|
student_id:undefined,
|
|
|
|
|
Modallisttypess:0,
|
|
|
|
|
ismanager:false,
|
|
|
|
|
isSpin:false
|
|
|
|
|
isSpin:false,
|
|
|
|
|
pages:1,
|
|
|
|
|
per_pages:20,
|
|
|
|
|
total_student:0,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount(){
|
|
|
|
@ -39,25 +42,27 @@ class EcStudentList extends Component {
|
|
|
|
|
let major_id=this.props.match.params.major_id;
|
|
|
|
|
let year_id=this.props.match.params.year_id;
|
|
|
|
|
|
|
|
|
|
// const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data';
|
|
|
|
|
// axios.get(url, {
|
|
|
|
|
// withCredentials: true,
|
|
|
|
|
// }).then((response) => {
|
|
|
|
|
// if(response){
|
|
|
|
|
// if(response.status){
|
|
|
|
|
// if(response.status===200){
|
|
|
|
|
// this.setState({
|
|
|
|
|
// majorschoollist:response.data,
|
|
|
|
|
// ismanager:response.data.ismanager,
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
// .catch(function (error) {
|
|
|
|
|
// console.log(error);
|
|
|
|
|
// });
|
|
|
|
|
const url ='/ec_years/'+year_id+'/students.json';
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
page:this.state.pages,
|
|
|
|
|
per_page:this.state.per_pages,
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if(response){
|
|
|
|
|
if(response.status){
|
|
|
|
|
if(response.status===200){
|
|
|
|
|
this.setState({
|
|
|
|
|
total_student:response.data.count,
|
|
|
|
|
majorschoollist:response.data,
|
|
|
|
|
ismanager:response.data.ismanager,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
// let majorschoollist={
|
|
|
|
|
// ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"},
|
|
|
|
|
// {index: 1, student_name: "同意", student_id: "s20111458"},
|
|
|
|
@ -85,16 +90,23 @@ class EcStudentList extends Component {
|
|
|
|
|
uploadcomponentDidMount(){
|
|
|
|
|
let major_id=this.props.match.params.major_id;
|
|
|
|
|
let year_id=this.props.match.params.year_id;
|
|
|
|
|
const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data';
|
|
|
|
|
const url ='/ec_years/'+year_id+'/students.json';
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
withCredentials: true,
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
page:this.state.pages,
|
|
|
|
|
per_page:this.state.per_pages,
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if(response){
|
|
|
|
|
if(response.status){
|
|
|
|
|
if(response.status===200){
|
|
|
|
|
this.setState({
|
|
|
|
|
total_student:response.data.count,
|
|
|
|
|
majorschoollist:response.data,
|
|
|
|
|
ismanager:response.data.ismanager,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
@ -152,18 +164,26 @@ class EcStudentList extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showecStudentList=(page)=>{
|
|
|
|
|
|
|
|
|
|
let major_id=this.props.match.params.major_id;
|
|
|
|
|
let year_id=this.props.match.params.year_id;
|
|
|
|
|
const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data?page='+page;
|
|
|
|
|
const url ='/ec_years/'+year_id+'/students.json';
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
withCredentials: true,
|
|
|
|
|
page:this.state.pages,
|
|
|
|
|
per_page:this.state.per_pages,
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if(response){
|
|
|
|
|
if(response.status){
|
|
|
|
|
if(response.status===200){
|
|
|
|
|
this.setState({
|
|
|
|
|
total_student:response.data.count,
|
|
|
|
|
majorschoollist:response.data,
|
|
|
|
|
ismanager:response.data.ismanager,
|
|
|
|
|
pages:page,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
@ -261,6 +281,7 @@ class EcStudentList extends Component {
|
|
|
|
|
studentall,
|
|
|
|
|
student_id,
|
|
|
|
|
Modallisttypess,
|
|
|
|
|
total_student,
|
|
|
|
|
ismanager
|
|
|
|
|
}=this.state;
|
|
|
|
|
// ec_students: []
|
|
|
|
@ -313,11 +334,11 @@ class EcStudentList extends Component {
|
|
|
|
|
<a className="fr font-15 courseSystem" onClick={this.windowsgoblack}>返回</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white eacourse">
|
|
|
|
|
<div className="edu-back-white ">
|
|
|
|
|
|
|
|
|
|
<div className="clearfix padding20-30 bor-bottom-greyE"><span
|
|
|
|
|
className=" font-18 courseSystem">学生列表(
|
|
|
|
|
{majorschoollist===undefined?"":majorschoollist.total_student}
|
|
|
|
|
{total_student}
|
|
|
|
|
)</span>
|
|
|
|
|
<div className="color-grey-9 mr10">提供模板支持导入学生信息(请先下载模板) <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
|
|
|
|
|
</div>
|
|
|
|
@ -368,7 +389,7 @@ class EcStudentList extends Component {
|
|
|
|
|
<div className="edu-txt-center color-grey-9 pt50">
|
|
|
|
|
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/></p>
|
|
|
|
|
<p>学生数据为空,请导入数据</p>
|
|
|
|
|
</div>:majorschoollist.ec_students.map((item,key)=>{
|
|
|
|
|
</div>:majorschoollist.students.map((item,key)=>{
|
|
|
|
|
// console.log(item)
|
|
|
|
|
return(
|
|
|
|
|
<li className="clearfix" key={key}>
|
|
|
|
@ -392,7 +413,7 @@ class EcStudentList extends Component {
|
|
|
|
|
|
|
|
|
|
<div style={{width:'100%',position: 'relative'}}>
|
|
|
|
|
{
|
|
|
|
|
majorschoollist===undefined?"":majorschoollist.total_page===0||majorschoollist.total_student<51?"": <Pagination size="small" className={"pagelistStudentList mt30"} pageSize={50} showQuickJumper defaultCurrent={1} total={majorschoollist.total_student} onChange={this.showecStudentList} />
|
|
|
|
|
majorschoollist===undefined?"":majorschoollist.students===0||majorschoollist.total_student<51?"": <Pagination size="small" className={"pagelistStudentList mt30"} pageSize={20} showQuickJumper current={1} total={majorschoollist.students.length} onChange={this.showecStudentList} />
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|