@jswork/antd-components 1.0.146 → 1.0.147

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.146",
3
+ "version": "1.0.147",
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-25 23:50:34
5
+ * @LastEditTime: 2025-10-25 23:54:58
6
6
  *
7
7
  *
8
8
  * 路由风格: /{module}/{name} eg: /admin/staff-roles
@@ -202,10 +202,11 @@ export class AcTable extends React.Component<AcTableProps, AcTableState> {
202
202
  );
203
203
  };
204
204
 
205
- public optimisticUpdate = async (inId: any, inData: Record<string, any>) => {
205
+ public optimisticUpdate = async (inData: Record<string, any>) => {
206
206
  const { rowKey } = this.props;
207
+ const id = inData[rowKey as string];
207
208
  const dataSource = this.state.dataSource!.slice();
208
- const index = dataSource.findIndex((item) => item[rowKey as string] === inId);
209
+ const index = dataSource.findIndex((item) => item[rowKey as string] === id);
209
210
  if (index !== -1) {
210
211
  dataSource[index] = {
211
212
  ...dataSource[index],
@@ -14,7 +14,7 @@ const useCommand = (inName?: string) => {
14
14
  const add = () => execute('add');
15
15
  const edit = () => execute('edit');
16
16
  const destroy = () => execute('destroy');
17
- const optimisticUpdate = (inId: any, inData: Record<string, any>) => execute('optimisticUpdate', inId, inData);
17
+ const optimisticUpdate = (inData: Record<string, any>) => execute('optimisticUpdate', inData);
18
18
 
19
19
  return {
20
20
  listen,