@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/antd-components",
3
- "version": "1.0.138",
3
+ "version": "1.0.140",
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 1290657123@qq.com
5
- * @LastEditTime: 2025-10-24 21:11:05
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, name } = this.props;
210
- nx.$nav?.(`/${module}/${name}/add`);
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, name, rowKey } = this.props;
215
- nx.$nav?.(`/${module}/${name}/${item[rowKey as string]}/edit`);
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 ----- */