mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
fix: 修复CRUD nested 模式展示异常 (#9488)
This commit is contained in:
parent
52b6bba766
commit
55c8243b73
@ -70,7 +70,11 @@ export const Column = types
|
||||
get isPrimary() {
|
||||
const table = getParent(self, 2) as any;
|
||||
|
||||
return table.filteredColumns[0]?.id === self.id;
|
||||
return (
|
||||
table.filteredColumns.find(
|
||||
(column: any) => !column.type.startsWith('__')
|
||||
)?.id === self.id
|
||||
);
|
||||
}
|
||||
}))
|
||||
.actions(self => ({
|
||||
|
@ -170,7 +170,7 @@ export function Cell({
|
||||
);
|
||||
}
|
||||
return [prefix, affix, addtionalClassName];
|
||||
}, [item.expandable, item.expanded, column.isPrimary]);
|
||||
}, [item.expandable, item.expanded, column.isPrimary, store.isNested]);
|
||||
|
||||
// 根据条件缓存 data,避免孩子重复渲染
|
||||
const hasCustomTrackExpression =
|
||||
|
@ -355,12 +355,15 @@ export default observer((props: TableRowProps) => {
|
||||
id={item.id}
|
||||
newIndex={item.newIndex}
|
||||
isHover={item.isHover}
|
||||
partial={item.partial}
|
||||
checked={item.checked}
|
||||
modified={item.modified}
|
||||
moved={item.moved}
|
||||
depth={item.depth}
|
||||
expandable={item.expandable}
|
||||
checkdisable={item.checkdisable}
|
||||
loading={item.loading}
|
||||
error={item.error}
|
||||
// data 在 TableRow 里面没有使用,这里写上是为了当列数据变化的时候 TableRow 重新渲染,
|
||||
// 不是 item.locals 的原因是 item.locals 会变化多次,比如父级上下文变化也会进来,但是 item.data 只会变化一次。
|
||||
data={canAccessSuperData ? item.locals : item.data}
|
||||
|
Loading…
Reference in New Issue
Block a user