@jswork/antd-components 1.0.189 → 1.0.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/antd-components",
3
- "version": "1.0.189",
3
+ "version": "1.0.190",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
package/src/lib/table.tsx CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: aric 1290657123@qq.com
3
3
  * @Date: 2025-10-03 07:11:26
4
4
  * @LastEditors: aric.zheng 1290657123@qq.com
5
- * @LastEditTime: 2025-10-29 15:31:38
5
+ * @LastEditTime: 2025-10-29 15:40:02
6
6
  *
7
7
  *
8
8
  * 路由风格: /{module}/{name} eg: /admin/staff-roles
@@ -83,6 +83,14 @@ export type AcTableProps = TableProps & {
83
83
  * @param model
84
84
  */
85
85
  onDestroyComplete?: (model: any) => void;
86
+ /**
87
+ * When refetch called.
88
+ */
89
+ onRefetch?: () => void;
90
+ /**
91
+ * When reset called.
92
+ */
93
+ onReset?: () => void;
86
94
  /**
87
95
  * Default page.
88
96
  */
@@ -103,7 +111,6 @@ export type AcTableProps = TableProps & {
103
111
  * The response total key.
104
112
  */
105
113
  totalPath?: string;
106
-
107
114
  /**
108
115
  * Column fields for table.
109
116
  */
@@ -297,15 +304,17 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
297
304
  * Refresh data use current state.
298
305
  */
299
306
  public refetch = async () => {
307
+ const { onRefetch } = this.props;
300
308
  const { current, pageSize } = this.state;
301
309
  await this.fetchData(current, pageSize);
310
+ onRefetch?.();
302
311
  };
303
312
 
304
313
  /**
305
314
  * Reset to default state, and fetch data.
306
315
  */
307
316
  public reset = async () => {
308
- const { defaultCurrent, defaultPageSize } = this.props;
317
+ const { defaultCurrent, defaultPageSize, onReset } = this.props;
309
318
  this.setState(
310
319
  {
311
320
  current: defaultCurrent,
@@ -315,6 +324,7 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
315
324
  },
316
325
  () => {
317
326
  void this.fetchData(defaultCurrent!, defaultPageSize!, null);
327
+ onReset?.();
318
328
  },
319
329
  );
320
330
  };
@@ -387,6 +397,8 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
387
397
  className,
388
398
  pagination,
389
399
  onPageChange,
400
+ onRefetch,
401
+ onReset,
390
402
  params,
391
403
  paramsAdd,
392
404
  paramsEdit,