From 1053b9adb6dc6f04505d863060692c66b4ccba71 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Sat, 7 May 2022 01:52:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=A3=20=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kicc-ui/src/views/system/config/index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kicc-ui/src/views/system/config/index.vue b/kicc-ui/src/views/system/config/index.vue index 037a98bd..85f9142f 100644 --- a/kicc-ui/src/views/system/config/index.vue +++ b/kicc-ui/src/views/system/config/index.vue @@ -240,11 +240,14 @@ // 表格行配置 rowSelection: { type: 'checkbox' }, // 是否展示外边框和列边框 - bordered: true + bordered: true, + // 表格布局 + tableLayout: 'fixed' } }); const defineBasicTableProps = defineProps(basicProps); const basicTableProps = computed(() => ({ ...toRaw(defineBasicTableProps), ...state.tableProps } as unknown as BasicTableProps)); + const dataSourceRef = computed(() => state.tableProps.dataSource); // 基于vben-table扩展rowSelection,实现勾选数据自主可控 const { getRowSelection, @@ -254,7 +257,7 @@ getSelectRowKeys, deleteSelectRowByKey, setSelectedRowKeys - } = useRowSelection(basicTableProps, ref(state.tableProps.dataSource), noop); + } = useRowSelection(basicTableProps, dataSourceRef, noop); // 基于vben-table扩展分页 const { getPaginationInfo, @@ -266,12 +269,11 @@ // 使用vben-table行斑马线 const { getRowClassName } = useTableStyle(basicTableProps, prefixCls); // 使用vben-table自动计算表格高度跟在指定区域显示滚动条 - const { getScrollRef, redoHeight } = useTableScroll(basicTableProps, tableElRef, columns as any, getRowSelectionRef, state.tableProps.dataSource as any); + const { getScrollRef, redoHeight } = useTableScroll(basicTableProps, tableElRef, columns as any, getRowSelectionRef, dataSourceRef); // 设置并绑定a-table属性 const getBindValues = computed(() => { const propsData: Recordable = { ...state.tableProps, - tableLayout: 'fixed', columns: columns, size: state.selectedKeys[0], scroll: unref(getScrollRef), @@ -304,6 +306,7 @@ if (result) { state.tableProps.dataSource = result.data; setPagination({ total: result.total }); + redoHeight(); } } finally { state.tableProps.loading = false;