This commit is contained in:
北海一刀 2021-11-18 09:52:50 +08:00
commit f80f4999d3
3 changed files with 18 additions and 13 deletions

View File

@ -81,16 +81,12 @@ import _ from "lodash";
this.props.onNextClick(page_num); this.props.onNextClick(page_num);
} }
onPageClick(e){ onPageClick(e){
console.log(e)
if(e=="…")
{
return;
}
this.setState({page:e}) this.setState({page:e})
this.props.onJumpPage(e) this.props.onJumpPage(e)
} }
onInputChange(e,page_num){ onInputChange(e,page_num){
console.log("当前页码变化")
let jump = e.target.value > page_num ? page_num : e.target.value; let jump = e.target.value > page_num ? page_num : e.target.value;
this.setState({jump_page:jump}) this.setState({jump_page:jump})
@ -143,8 +139,6 @@ import _ from "lodash";
btnPages.push(i); btnPages.push(i);
} }
let btns = this.getPageArr(btnPages,this.state.page,5)
return ( return (
<div className="pagination"> <div className="pagination">
<div className="pagination-context"> <div className="pagination-context">
@ -172,9 +166,9 @@ import _ from "lodash";
<div className="page-btn-group"> <div className="page-btn-group">
<Icon onClick={()=>{this.onPrevClick()}} type={"left"} className={ this.state.page > 1 ? "page-prev" :"page-prev disabled" } /> <Icon onClick={()=>{this.onPrevClick()}} type={"left"} className={ this.state.page > 1 ? "page-prev" :"page-prev disabled" } />
{ {
btns.map((item, index) => { btnPages.map((item, index) => {
return ( return (
<div onClick={()=>{this.onPageClick(item)}} key={index} className={ item== this.state.page ? "btn-page active":"btn-page"}>{item}</div> <div onClick={()=>{this.onPageClick(item.page)}} key={index} className={ item.page == this.state.page ? "btn-page active":"btn-page"}>{item.text}</div>
) )
}) })
} }

View File

@ -183,11 +183,17 @@ export default class acclist extends React.Component{
//page //page
pageChange(e){ pageChange(e){
this.setState({page:e}); this.setState({page:e});
setTimeout(() => {
this.getCodeListFn();
}, 10);
} }
//limit //limit
countChange(e){ countChange(e){
this.setState({page:1,limit:e}); this.setState({page:1,limit:e});
this.getCodeListFn();
setTimeout(() => {
this.getCodeListFn();
}, 10);
} }
//敲回车查询 //敲回车查询
sureFn(){ sureFn(){

View File

@ -235,12 +235,17 @@ export default class orderlist extends React.Component{
//page //page
pageChange(e){ pageChange(e){
this.setState({page:e}); this.setState({page:e});
this.getOrderFn(); setTimeout(() => {
this.getOrderFn();
}, 0);
} }
//limit //limit
countChange(e){ countChange(e){
this.setState({page:1,limit:e}); this.setState({page:1,limit:e});
this.getOrderFn(); setTimeout(() => {
this.getOrderFn();
}, 0);
} }
//敲回车查询 //敲回车查询
sureFn(){ sureFn(){