@jswork/antd-components 1.0.138 → 1.0.140
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.d.mts +1 -0
- package/dist/main.d.ts +1 -0
- 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 +10 -5
package/package.json
CHANGED
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 1290657123@qq.com
|
|
5
|
-
* @LastEditTime: 2025-10-
|
|
5
|
+
* @LastEditTime: 2025-10-25 08:59:09
|
|
6
6
|
*/
|
|
7
7
|
import type { EventMittNamespace } from '@jswork/event-mitt';
|
|
8
8
|
import { ReactHarmonyEvents } from '@jswork/harmony-events';
|
|
@@ -112,6 +112,11 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
112
112
|
public sync = new UrlSyncFlat();
|
|
113
113
|
private defaultFetcher: Function;
|
|
114
114
|
|
|
115
|
+
get routerKey() {
|
|
116
|
+
const { name } = this.props;
|
|
117
|
+
return name!.replace(/_/g, '_');
|
|
118
|
+
}
|
|
119
|
+
|
|
115
120
|
constructor(props: AcTableProps) {
|
|
116
121
|
super(props);
|
|
117
122
|
const { defaultCurrent, defaultPageSize, params } = this.props;
|
|
@@ -206,13 +211,13 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
|
|
|
206
211
|
};
|
|
207
212
|
|
|
208
213
|
public add = () => {
|
|
209
|
-
const { module
|
|
210
|
-
nx.$nav?.(`/${module}/${
|
|
214
|
+
const { module } = this.props;
|
|
215
|
+
nx.$nav?.(`/${module}/${this.routerKey}/add`);
|
|
211
216
|
};
|
|
212
217
|
|
|
213
218
|
public edit = (item: any) => {
|
|
214
|
-
const { module,
|
|
215
|
-
nx.$nav?.(`/${module}/${
|
|
219
|
+
const { module, rowKey } = this.props;
|
|
220
|
+
nx.$nav?.(`/${module}/${this.routerKey}/${item[rowKey as string]}/edit`);
|
|
216
221
|
};
|
|
217
222
|
|
|
218
223
|
/* ----- public eventBus methods end ----- */
|