自定义checkbox后,树展开列表,样式乱了,动态计算 expandIconColumnIndex
parent
3aa81e50da
commit
6203e202d8
|
@ -146,6 +146,7 @@
|
|||
handleCustomSelectColumn,
|
||||
clearSelectedRowKeys,
|
||||
deleteSelectRowByKey,
|
||||
getExpandIconColumnIndex,
|
||||
} = useCustomSelection(
|
||||
getProps,
|
||||
emit,
|
||||
|
@ -248,6 +249,8 @@
|
|||
dataSource,
|
||||
footer: unref(getFooterProps),
|
||||
...unref(getExpandOption),
|
||||
// 【QQYUN-5837】动态计算 expandIconColumnIndex
|
||||
expandIconColumnIndex: getExpandIconColumnIndex.value,
|
||||
};
|
||||
|
||||
//update-begin---author:wangshuai ---date:20230214 for:[QQYUN-4237]代码生成 内嵌子表模式 没有滚动条------------
|
||||
|
|
|
@ -435,6 +435,20 @@ export function useCustomSelection(
|
|||
}
|
||||
}
|
||||
|
||||
// 【QQYUN-5837】动态计算 expandIconColumnIndex
|
||||
const getExpandIconColumnIndex = computed(() => {
|
||||
const { expandIconColumnIndex } = unref(propsRef);
|
||||
// 未设置选择列,则保持不变
|
||||
if (getRowSelectionRef.value == null) {
|
||||
return expandIconColumnIndex;
|
||||
}
|
||||
// 设置了选择列,并且未传入 index 参数,则返回 1
|
||||
if (expandIconColumnIndex == null) {
|
||||
return 1;
|
||||
}
|
||||
return expandIconColumnIndex;
|
||||
});
|
||||
|
||||
return {
|
||||
getRowSelection,
|
||||
getRowSelectionRef,
|
||||
|
@ -446,6 +460,7 @@ export function useCustomSelection(
|
|||
isCustomSelection,
|
||||
handleCustomSelectColumn,
|
||||
clearSelectedRowKeys,
|
||||
getExpandIconColumnIndex,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
const [register, { expandAll, collapseAll }] = useTable({
|
||||
title: '树形表格',
|
||||
isTreeTable: true,
|
||||
expandIconColumnIndex: 1,
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
getCheckboxProps(record: Recordable) {
|
||||
|
|
|
@ -68,7 +68,6 @@
|
|||
schemas: searchFormSchema,
|
||||
},
|
||||
isTreeTable: true,
|
||||
expandIconColumnIndex: 1,
|
||||
},
|
||||
exportConfig: {
|
||||
name: '分类字典列表',
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
size: 'small',
|
||||
pagination: false,
|
||||
isTreeTable: true,
|
||||
expandIconColumnIndex: 1,
|
||||
striped: true,
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
|
|
Loading…
Reference in New Issue