diff --git a/mock/cfc/mock/crud/table2.js b/mock/cfc/mock/crud/table2.js index 967aec430..a7f49f75c 100755 --- a/mock/cfc/mock/crud/table2.js +++ b/mock/cfc/mock/crud/table2.js @@ -471,9 +471,9 @@ const data = [ version: '1', grade: 'A' } - ].map(function (child, i) { + ].map(function (child, j) { return Object.assign({}, child, { - id: (i + 1) * 100 + (index + 1) * 1000 + i + 1 + id: (index + 1) * 10000 + (i + 1) * 100 + 1 + j }); }) }); diff --git a/packages/amis-core/src/store/table.ts b/packages/amis-core/src/store/table.ts index 829e190b9..3207072ef 100644 --- a/packages/amis-core/src/store/table.ts +++ b/packages/amis-core/src/store/table.ts @@ -1546,11 +1546,11 @@ export const TableStore = iRendererStore self.selectedRows.clear(); selected.forEach(item => { - let resolved = self.rows.find(a => a.pristine === item); + let resolved = findTree(self.rows, a => a.pristine === item); // 先严格比较, if (!resolved) { - resolved = self.rows.find(a => { + resolved = findTree(self.rows, a => { const selectValue = item[valueField || 'value']; const itemValue = a.pristine[valueField || 'value']; return selectValue === itemValue; @@ -1559,14 +1559,14 @@ export const TableStore = iRendererStore // 再宽松比较 if (!resolved) { - resolved = self.rows.find(a => { + resolved = findTree(self.rows, a => { const selectValue = item[valueField || 'value']; const itemValue = a.pristine[valueField || 'value']; return selectValue == itemValue; }); } - resolved && self.selectedRows.push(resolved); + resolved && self.selectedRows.push(resolved as any); }); updateCheckDisable();