dev_forum
杨树明 5 years ago
parent dae8ba4951
commit 9f16821756

@ -21,7 +21,8 @@ import {
DatePicker,
Radio,
Tooltip,
notification
notification,
Pagination
} from "antd";
import {Link, Switch, Route, Redirect} from 'react-router-dom';
import axios from 'axios';
@ -89,11 +90,22 @@ class ShixunStudentWork extends Component {
})
}
getupdata=()=>{
getupdata=(pages)=>{
let {order,b_order,page,limit,group_infolist,search}=this.state;
var homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/" + homeworkid + "/code_review_results.json";
axios.get(url).then((response) => {
axios.get(url,{params:{
order:order,
sort:b_order,
page:pages===undefined?page:pages,
limit:limit,
group_ids:group_infolist,
search:search
},
paramsSerializer: function(params) {
return qs.stringify(params, {arrayFormat: 'brackets'})
}}).then((response) => {
if (response.data.status === undefined || response.data.status === 0) {
if(response.data!=undefined){
if(response.data.status!=-2){
@ -198,12 +210,12 @@ class ShixunStudentWork extends Component {
}
TablePagination = (e) => {
TablePagination = (pages) => {
this.setState({
page:e.current
page:pages
})
this.getupdata(pages)
}
inputSearchValue=(e)=>{
@ -818,6 +830,7 @@ class ShixunStudentWork extends Component {
</div>
<div className={"justify break_full_word new_li edu-back-white"} style={{minHeight: "480px"}}>
<style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;}
@ -826,22 +839,24 @@ class ShixunStudentWork extends Component {
{datalist === undefined ? "" : <Table
dataSource={datalist}
columns={columns}
pagination={ datalist.length<11?false:{ //分页
total: datalist.length===0?0:data&&data.all_reviews_count, //数据总数量
pageSize: 10, //显示几条一页
current:page,
}}
onChange={this.TablePagination}
pagination={false}
/>}
</div>
</div>
</div>:""}
</div>
</div></div>
{
datalist === undefined ? "":datalist.length<11?
<div className="edu-txt-center mt30 mb20">
<Pagination showQuickJumper current={page}
onChange={this.TablePagination} pageSize={10}
total={datalist.length===0?0:data&&data.copy_reviews_count}></Pagination>
</div>
: ""
}
</div>
</div>

Loading…
Cancel
Save