dev_ec
杨树林 5 years ago
parent 340290d66d
commit e03e085062

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

Loading…
Cancel
Save