落地页翻页请求后端问题

This commit is contained in:
姜棚 2021-12-22 16:52:48 +08:00
parent 69585f9908
commit 0e1ff9ca43
4 changed files with 32 additions and 19 deletions

View File

@ -121,10 +121,6 @@ import _ from "lodash";
this.onJumpPage(1) this.onJumpPage(1)
switch(key) switch(key)
{ {
case "0":
this.setState({count:5})
this.props.onCountChange(5);
break;
case "1": case "1":
this.setState({count:10}) this.setState({count:10})
this.props.onCountChange(10); this.props.onCountChange(10);
@ -187,7 +183,6 @@ import _ from "lodash";
</DropdownClickTrigger> </DropdownClickTrigger>
<DropdownContent> <DropdownContent>
<Menu onClick={(e,key) => {this.onMenuClick(e,key)}} className="mymenu" > <Menu onClick={(e,key) => {this.onMenuClick(e,key)}} className="mymenu" >
<MenuItem key={0}>5</MenuItem>
<MenuItem key={1}>10</MenuItem> <MenuItem key={1}>10</MenuItem>
<MenuItem key={2}>20</MenuItem> <MenuItem key={2}>20</MenuItem>
<MenuItem key={3}>50</MenuItem> <MenuItem key={3}>50</MenuItem>

View File

@ -26,7 +26,7 @@ import {
Pop Pop
} from 'zent'; } from 'zent';
import "../../../assets/comm.css" import "../../../assets/comm.css"
import _ from "lodash";
import Ipt from "../../../components/input/main" import Ipt from "../../../components/input/main"
import Grid from "../../../components/gird/main.js" import Grid from "../../../components/gird/main.js"
import TabPage from "../../../components/tabPage/main.js" import TabPage from "../../../components/tabPage/main.js"
@ -139,7 +139,7 @@ export default class acclist extends React.Component {
page: 1, page: 1,
limit: 10, limit: 10,
key_word:"", key_word:"",
status: 1, status: null,
dataCount: 0, dataCount: 0,
preview_visible:false, preview_visible:false,
preview_url:"", preview_url:"",
@ -157,7 +157,12 @@ export default class acclist extends React.Component {
{ {
data.title = this.state.key_word data.title = this.state.key_word
} }
getThemeList(data).then((res) => { let queryParams = _.omitBy(data, (value) => {
return _.isNaN(value) || _.isNil(value)
})
getThemeList(queryParams).then((res) => {
handelResponse(res, (req, msg) => { handelResponse(res, (req, msg) => {
console.log("求结果") console.log("求结果")
console.log(req) console.log(req)
@ -185,7 +190,8 @@ export default class acclist extends React.Component {
let data = { let data = {
page: e, page: e,
limit:this.state.limit, limit:this.state.limit,
title: this.state.key_word title: this.state.key_word,
status:this.state.status
} }
this.getTableList(data) this.getTableList(data)
@ -246,11 +252,16 @@ export default class acclist extends React.Component {
page: 1, page: 1,
limit:10, limit:10,
} }
let status = null;
if( e > 0) if( e > 0)
{ {
data.status = e; status = e;
}
}else{
status = null
}
data.status = status
this.setState({status:status})
if(this.state.key_word) if(this.state.key_word)
{ {
data.title = this.state.key_word data.title = this.state.key_word
@ -274,12 +285,11 @@ export default class acclist extends React.Component {
sureFn(){ sureFn(){
this.setState({page:1}) this.setState({page:1})
this.setState({limit:10}) this.setState({limit:10})
console.log("回车")
console.log(this.state.key_word)
let data={ let data={
page: 1, page: 1,
limit:10, limit:10,
title:this.state.key_word title:this.state.key_word,
status:this.state.status
} }
this.getTableList(data); this.getTableList(data);

View File

@ -178,13 +178,20 @@ export default class acclist extends React.Component{
tabFn(e){ tabFn(e){
console.log(e) console.log(e)
switch(e){ let status = e > 0 ? e : null
if(!status)
{
this.setState({status:e})
} }
this.setState({search:""})
let params={
page:1,
limit:10,
status : status
}
this.getKeyCodeList(params)
} }
render(){ render(){
const { current, pageSize } = this.state; const { current, pageSize } = this.state;

View File

@ -771,6 +771,7 @@ export default class acclist extends React.Component{
<MenuItem key="2">再次发送key</MenuItem> <MenuItem key="2">再次发送key</MenuItem>
<MenuItem key="3">修改接收邮箱发送</MenuItem> <MenuItem key="3">修改接收邮箱发送</MenuItem>
<MenuItem key="4">修改接收手机发送</MenuItem> <MenuItem key="4">修改接收手机发送</MenuItem>
<MenuItem key="5">作废</MenuItem>
</Menu> </Menu>