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 @@
// //
rowSelection: { type: 'checkbox' }, rowSelection: { type: 'checkbox' },
// //
bordered: true bordered: true,
//
tableLayout: 'fixed'
} }
}); });
const defineBasicTableProps = defineProps(basicProps); const defineBasicTableProps = defineProps(basicProps);
const basicTableProps = computed(() => ({ ...toRaw(defineBasicTableProps), ...state.tableProps } as unknown as BasicTableProps)); const basicTableProps = computed(() => ({ ...toRaw(defineBasicTableProps), ...state.tableProps } as unknown as BasicTableProps));
const dataSourceRef = computed(() => state.tableProps.dataSource);
// vben-tablerowSelection, // vben-tablerowSelection,
const { const {
getRowSelection, getRowSelection,
@ -254,7 +257,7 @@
getSelectRowKeys, getSelectRowKeys,
deleteSelectRowByKey, deleteSelectRowByKey,
setSelectedRowKeys setSelectedRowKeys
} = useRowSelection(basicTableProps, ref(state.tableProps.dataSource), noop); } = useRowSelection(basicTableProps, dataSourceRef, noop);
// vben-table // vben-table
const { const {
getPaginationInfo, getPaginationInfo,
@ -266,12 +269,11 @@
// 使vben-table线 // 使vben-table线
const { getRowClassName } = useTableStyle(basicTableProps, prefixCls); const { getRowClassName } = useTableStyle(basicTableProps, prefixCls);
// 使vben-table // 使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 // a-table
const getBindValues = computed(() => { const getBindValues = computed(() => {
const propsData: Recordable = { const propsData: Recordable = {
...state.tableProps, ...state.tableProps,
tableLayout: 'fixed',
columns: columns, columns: columns,
size: state.selectedKeys[0], size: state.selectedKeys[0],
scroll: unref(getScrollRef), scroll: unref(getScrollRef),
@ -304,6 +306,7 @@
if (result) { if (result) {
state.tableProps.dataSource = result.data; state.tableProps.dataSource = result.data;
setPagination({ total: result.total }); setPagination({ total: result.total });
redoHeight();
} }
} finally { } finally {
state.tableProps.loading = false; state.tableProps.loading = false;

Loading…
Cancel
Save