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