Browse Source

👣 重构

master
wangxiang 3 years ago
parent
commit
1053b9adb6
  1. 11
      kicc-ui/src/views/system/config/index.vue

11
kicc-ui/src/views/system/config/index.vue

@ -240,11 +240,14 @@ @@ -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-tablerowSelection,
const {
getRowSelection,
@ -254,7 +257,7 @@ @@ -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 @@ @@ -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 @@ @@ -304,6 +306,7 @@
if (result) {
state.tableProps.dataSource = result.data;
setPagination({ total: result.total });
redoHeight();
}
} finally {
state.tableProps.loading = false;

Loading…
Cancel
Save