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

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

Loading…
Cancel
Save