1) 修改page

This commit is contained in:
zhangds 2022-08-15 11:56:34 +08:00
parent 979a862672
commit a86dd06885
1 changed files with 20 additions and 0 deletions

View File

@ -200,6 +200,23 @@ const UseKeyList = (props, ref) => {
const key_query_el = useRef(null); const key_query_el = useRef(null);
const plan_list_el = useRef(null); const plan_list_el = useRef(null);
const resParam = () => {
return new Promise((res, rej) => {
const { queryParams, limit, page } = state;
return {
...queryParams,
limit,
page,
};
});
};
const tetxajax = () => {
resParam().then((res) => {
console.log("请求方法....", res);
});
};
/** /**
* 获取table 数据 * 获取table 数据
* data 兼容 react state 无同步问题 * data 兼容 react state 无同步问题
@ -275,6 +292,7 @@ const UseKeyList = (props, ref) => {
limit: 10, limit: 10,
hash: null, hash: null,
}; };
dispatch({ type: "setPages", payload: { page: 1, limit: 10 } });
getTable(data); getTable(data);
}; };
@ -535,6 +553,8 @@ const UseKeyList = (props, ref) => {
const onPageChange = (e) => { const onPageChange = (e) => {
dispatch({ type: "setPages", payload: { page: e } }); dispatch({ type: "setPages", payload: { page: e } });
getTable({ page: e, hash: state.hash }); getTable({ page: e, hash: state.hash });
tetxajax();
}; };
const onCountChange = (e) => { const onCountChange = (e) => {