@jswork/antd-components 1.0.209 → 1.0.210
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.esm.js +1 -1
- package/dist/main.esm.js.map +1 -1
- package/package.json +3 -2
- package/src/lib/table.tsx +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jswork/antd-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.210",
|
|
4
4
|
"main": "dist/main.cjs.js",
|
|
5
5
|
"module": "dist/main.esm.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@ant-design/icons": "*",
|
|
21
21
|
"@ebay/nice-form-react": "*",
|
|
22
|
-
"@jswork/react-ant-status-switch": "*",
|
|
23
22
|
"@jswork/next": "*",
|
|
23
|
+
"@jswork/react-ant-status-switch": "*",
|
|
24
24
|
"antd": "*",
|
|
25
25
|
"react-router-dom": "*"
|
|
26
26
|
},
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@jswork/next-create-fetcher": "^1.0.6",
|
|
61
61
|
"@jswork/next-dom-event": "^1.0.8",
|
|
62
62
|
"@jswork/next-gpid": "^1.0.4",
|
|
63
|
+
"@jswork/next-tmpl": "^1.0.7",
|
|
63
64
|
"@jswork/next-tree-walk": "^1.0.7",
|
|
64
65
|
"@jswork/next-unique": "^1.0.2",
|
|
65
66
|
"@jswork/noop": "^1.0.0",
|
package/src/lib/table.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import { ReactHarmonyEvents } from '@jswork/harmony-events';
|
|
|
13
13
|
import nx from '@jswork/next';
|
|
14
14
|
import '@jswork/next-compact-object';
|
|
15
15
|
import '@jswork/next-create-fetcher';
|
|
16
|
+
import '@jswork/next-tmpl';
|
|
16
17
|
import UrlSyncFlat from '@jswork/url-sync-flat';
|
|
17
18
|
import { Table, TableProps } from 'antd';
|
|
18
19
|
import { ColumnsType } from 'antd/es/table';
|
|
@@ -370,7 +371,7 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
370
371
|
public add = () => {
|
|
371
372
|
const { module, paramsAdd, pathAdd } = this.props;
|
|
372
373
|
const qs = this.toQueryString(paramsAdd);
|
|
373
|
-
if(pathAdd) return nx.$nav?.(pathAdd);
|
|
374
|
+
if (pathAdd) return nx.$nav?.(pathAdd);
|
|
374
375
|
nx.$nav?.(`/${module}/${this.routerKey}/add${qs}`);
|
|
375
376
|
};
|
|
376
377
|
|
|
@@ -380,7 +381,10 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
380
381
|
public edit = (item: any) => {
|
|
381
382
|
const { module, rowKey, paramsEdit, pathEdit } = this.props;
|
|
382
383
|
const qs = this.toQueryString(paramsEdit);
|
|
383
|
-
if(pathEdit)
|
|
384
|
+
if (pathEdit) {
|
|
385
|
+
const _editPath = nx.tmpl(pathEdit, item);
|
|
386
|
+
return nx.$nav?.(nx.tmpl(_editPath, item));
|
|
387
|
+
}
|
|
384
388
|
nx.$nav?.(`/${module}/${this.routerKey}/${item[rowKey as string]}/edit${qs}`);
|
|
385
389
|
};
|
|
386
390
|
|