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({