mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 11:58:10 +08:00
fix: 修复嵌套模式当列隐藏时不显示展开按钮问题 Close: #8301
This commit is contained in:
parent
1ca520ef25
commit
a4a7fcda71
@ -51,7 +51,6 @@ export const Column = types
|
||||
toggable: true,
|
||||
expandable: false,
|
||||
checkdisable: false,
|
||||
isPrimary: false,
|
||||
searchable: types.maybe(types.frozen()),
|
||||
enableSearch: true,
|
||||
sortable: false,
|
||||
@ -67,6 +66,13 @@ export const Column = types
|
||||
remark: types.optional(types.frozen(), undefined),
|
||||
className: types.union(types.string, types.frozen())
|
||||
})
|
||||
.views(self => ({
|
||||
get isPrimary() {
|
||||
const table = getParent(self, 2) as any;
|
||||
|
||||
return table.filteredColumns[0]?.id === self.id;
|
||||
}
|
||||
}))
|
||||
.actions(self => ({
|
||||
toggleToggle(min = 1) {
|
||||
self.toggled = !self.toggled;
|
||||
@ -1016,7 +1022,6 @@ export const TableStore = iRendererStore
|
||||
pristine: item.pristine || item,
|
||||
toggled: item.toggled !== false,
|
||||
breakpoint: item.breakpoint,
|
||||
isPrimary: index === PARTITION_INDEX,
|
||||
/** 提前映射变量,方便后续view中使用 */
|
||||
label: isPureVariable(item.label)
|
||||
? resolveVariableAndFilter(item.label, self.data)
|
||||
|
@ -169,7 +169,7 @@ export default function Cell({
|
||||
);
|
||||
}
|
||||
return [prefix, affix, addtionalClassName];
|
||||
}, [item.expandable, item.expanded]);
|
||||
}, [item.expandable, item.expanded, column.isPrimary]);
|
||||
|
||||
// 根据条件缓存 data,避免孩子重复渲染
|
||||
const hasCustomTrackExpression =
|
||||
|
Loading…
Reference in New Issue
Block a user