mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 10:38:16 +08:00
fix: 修复 crud nested 模式深层次点选异常 (#9440)
This commit is contained in:
parent
9cc9a72bc2
commit
1b90148c3a
@ -471,9 +471,9 @@ const data = [
|
|||||||
version: '1',
|
version: '1',
|
||||||
grade: 'A'
|
grade: 'A'
|
||||||
}
|
}
|
||||||
].map(function (child, i) {
|
].map(function (child, j) {
|
||||||
return Object.assign({}, child, {
|
return Object.assign({}, child, {
|
||||||
id: (i + 1) * 100 + (index + 1) * 1000 + i + 1
|
id: (index + 1) * 10000 + (i + 1) * 100 + 1 + j
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -1546,11 +1546,11 @@ export const TableStore = iRendererStore
|
|||||||
self.selectedRows.clear();
|
self.selectedRows.clear();
|
||||||
|
|
||||||
selected.forEach(item => {
|
selected.forEach(item => {
|
||||||
let resolved = self.rows.find(a => a.pristine === item);
|
let resolved = findTree(self.rows, a => a.pristine === item);
|
||||||
|
|
||||||
// 先严格比较,
|
// 先严格比较,
|
||||||
if (!resolved) {
|
if (!resolved) {
|
||||||
resolved = self.rows.find(a => {
|
resolved = findTree(self.rows, a => {
|
||||||
const selectValue = item[valueField || 'value'];
|
const selectValue = item[valueField || 'value'];
|
||||||
const itemValue = a.pristine[valueField || 'value'];
|
const itemValue = a.pristine[valueField || 'value'];
|
||||||
return selectValue === itemValue;
|
return selectValue === itemValue;
|
||||||
@ -1559,14 +1559,14 @@ export const TableStore = iRendererStore
|
|||||||
|
|
||||||
// 再宽松比较
|
// 再宽松比较
|
||||||
if (!resolved) {
|
if (!resolved) {
|
||||||
resolved = self.rows.find(a => {
|
resolved = findTree(self.rows, a => {
|
||||||
const selectValue = item[valueField || 'value'];
|
const selectValue = item[valueField || 'value'];
|
||||||
const itemValue = a.pristine[valueField || 'value'];
|
const itemValue = a.pristine[valueField || 'value'];
|
||||||
return selectValue == itemValue;
|
return selectValue == itemValue;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
resolved && self.selectedRows.push(resolved);
|
resolved && self.selectedRows.push(resolved as any);
|
||||||
});
|
});
|
||||||
|
|
||||||
updateCheckDisable();
|
updateCheckDisable();
|
||||||
|
Loading…
Reference in New Issue
Block a user