Skip to content

Commit 3be9b50

Browse files
author
huchen
committed
搜索和重置的时候跳到第一页
Signed-off-by: huchen <huchen@xiandanmall.com>
1 parent 19190b3 commit 3be9b50

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/Quark/components/QueryFilter.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const QueryFilter: React.FC<Action> = (props) => {
3131
let query = {};
3232

3333
query['api'] = history.location.query.api;
34-
query['page'] = history.location.query.page;
3534
query['pageSize'] = history.location.query.pageSize;
3635

3736
query['search'] = values;
@@ -47,8 +46,11 @@ const QueryFilter: React.FC<Action> = (props) => {
4746
query['random'] = Math.random();
4847

4948
history.push({ pathname: history.location.pathname, query: query });
50-
49+
50+
51+
5152
if (props.current) {
53+
props.current.pageInfo.current = 1;
5254
props.current.reload();
5355
}
5456
};
@@ -57,7 +59,6 @@ const QueryFilter: React.FC<Action> = (props) => {
5759
let query = {};
5860

5961
query['api'] = history.location.query.api;
60-
query['page'] = history.location.query.page;
6162
query['pageSize'] = history.location.query.pageSize;
6263

6364
if(history.location.query.sorter) {
@@ -71,9 +72,12 @@ const QueryFilter: React.FC<Action> = (props) => {
7172
// hack random
7273
query['random'] = Math.random();
7374

75+
console.log(JSON.stringify(query));
76+
console.log('on_reset');
7477
history.push({ pathname: history.location.pathname, query: query });
7578

7679
if (props.current) {
80+
props.current.pageInfo.current = 1;
7781
props.current.reload();
7882
}
7983
};

0 commit comments

Comments
 (0)