From 28ea779f832030b457847f55a4b05c2ab05b4cb5 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 17 Jan 2023 11:17:09 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=A0=B7=E5=BC=8F=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=80=89=E4=B8=AD=E8=A1=8C=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/XTable/src/XTable.vue | 43 +++++++++++++++++-- .../src/hooks/web/useVxeCrudSchemas.ts | 9 ++++ .../src/hooks/web/useXTable.ts | 14 ++++-- .../src/plugins/vxeTable/index.ts | 8 ++-- 4 files changed, 62 insertions(+), 12 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue b/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue index a3941e01b..a4875abc0 100644 --- a/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue +++ b/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue @@ -229,19 +229,19 @@ const getPageConfig = (options: XTableProps) => { if (pagination != false) { options.pagerConfig = { border: false, // 带边框 - background: true, // 带背景颜色 + background: false, // 带背景颜色 perfect: false, // 配套的样式 pageSize: 10, // 每页大小 pagerCount: 7, // 显示页码按钮的数量 autoHidden: false, // 当只有一页时自动隐藏 pageSizes: [5, 10, 20, 30, 50, 100], // 每页大小选项列表 layouts: [ + 'Sizes', 'PrevJump', 'PrevPage', - 'JumpNumber', + 'Number', 'NextPage', 'NextJump', - 'Sizes', 'FullJump', 'Total' ] @@ -324,12 +324,47 @@ const getSearchData = () => { return queryParams } +// 获取当前列 +const getCurrentColumn = () => { + const g = unref(xGrid) + if (!g) { + return + } + return g.getCurrentColumn() +} + +// 获取当前选中列,redio +const getRadioRecord = () => { + const g = unref(xGrid) + if (!g) { + return + } + return g.getRadioRecord(false) +} + +// 获取当前选中列,checkbox +const getCheckboxRecords = () => { + const g = unref(xGrid) + if (!g) { + return + } + return g.getCheckboxRecords(false) +} const setProps = (prop: Partial) => { innerProps.value = { ...unref(innerProps), ...prop } } defineExpose({ reload, Ref: xGrid, getSearchData, deleteData, exportList }) -emit('register', { reload, getSearchData, setProps, deleteData, exportList }) +emit('register', { + reload, + getSearchData, + setProps, + deleteData, + exportList, + getCurrentColumn, + getRadioRecord, + getCheckboxRecords +})