From bc7fcf648d66e1fc1432ab3da2fc44b74019e2ba Mon Sep 17 00:00:00 2001 From: Dragon <> Date: Wed, 10 Apr 2024 13:32:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=88=E5=AE=A1=E5=8A=A8=E6=80=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/final/content/Content.vue | 30 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 07589d1..a7aa03d 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -58,6 +58,7 @@ const actionsColumns = { title: '操作', key: 'actions', minWidth: 200, + width: 200, fixed: 'right', render(row) { return h(ListAction, { @@ -394,15 +395,6 @@ async function formatColumns() { key: columnsRef.value[index].key, fixed: columnsRef.value[index].fixed || undefined, width: 200, - sorter: 'default', - renderSorterIcon: ({ order }) => { - if (order === false) - return h(SvgIcon, { name: 'sort-2' }) - if (order === 'ascend') - return h(SvgIcon, { name: 'sort-1' }) - if (order === 'descend') - return h(SvgIcon, { name: 'sort-3' }) - }, render(row: any) { return row.fromusername }, @@ -576,6 +568,23 @@ const maxHeight = computed(() => { return tableData.value.length ? `${unref(deviceHeight)}px` : 'auto' }) +const scrollX = computed(() => { + const table = unref(tableRef) + if (!table) + return + const tableEl: any = table?.$el + const wrapper = tableEl.querySelector('.n-data-table-wrapper') + const arr = columnsRef.value.filter(item => !item.fixed) + let width = 0 + console.log(arr) + arr.forEach((item) => { + width += Number(item.width) || 200 + }) + console.log(wrapper.offsetWidth + width) + console.log(arr) + return wrapper.offsetWidth + width +}) + query(pagination.page, pagination.pageSize) const customTabelRef = ref(null) @@ -967,11 +976,12 @@ defineExpose({