@jswork/antd-components 1.0.208 → 1.0.209
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/dist/main.cjs.js +1 -1
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.d.mts +10 -2
- package/dist/main.d.ts +10 -2
- package/dist/main.esm.js +1 -1
- package/dist/main.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/table.tsx +12 -2
package/package.json
CHANGED
package/src/lib/table.tsx
CHANGED
|
@@ -67,6 +67,14 @@ export type AcTableProps = TableProps & {
|
|
|
67
67
|
* The extra params when reset the page.
|
|
68
68
|
*/
|
|
69
69
|
paramsReset?: Record<string, any>;
|
|
70
|
+
/**
|
|
71
|
+
* Use custom router path for add page.
|
|
72
|
+
*/
|
|
73
|
+
pathAdd?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Use custom router path for edit page.
|
|
76
|
+
*/
|
|
77
|
+
pathEdit?: string;
|
|
70
78
|
/**
|
|
71
79
|
* Custom get standard data.
|
|
72
80
|
* @param params { current: number; pageSize: number }
|
|
@@ -360,8 +368,9 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
360
368
|
* CURD(page): Redirect to add page.
|
|
361
369
|
*/
|
|
362
370
|
public add = () => {
|
|
363
|
-
const { module, paramsAdd } = this.props;
|
|
371
|
+
const { module, paramsAdd, pathAdd } = this.props;
|
|
364
372
|
const qs = this.toQueryString(paramsAdd);
|
|
373
|
+
if(pathAdd) return nx.$nav?.(pathAdd);
|
|
365
374
|
nx.$nav?.(`/${module}/${this.routerKey}/add${qs}`);
|
|
366
375
|
};
|
|
367
376
|
|
|
@@ -369,8 +378,9 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
369
378
|
* CURD(page): Redirect to edit page.
|
|
370
379
|
*/
|
|
371
380
|
public edit = (item: any) => {
|
|
372
|
-
const { module, rowKey, paramsEdit } = this.props;
|
|
381
|
+
const { module, rowKey, paramsEdit, pathEdit } = this.props;
|
|
373
382
|
const qs = this.toQueryString(paramsEdit);
|
|
383
|
+
if(pathEdit) return nx.$nav?.(pathEdit);
|
|
374
384
|
nx.$nav?.(`/${module}/${this.routerKey}/${item[rowKey as string]}/edit${qs}`);
|
|
375
385
|
};
|
|
376
386
|
|