|
|
@ -58,6 +58,7 @@ const actionsColumns = {
|
|
|
|
title: '操作',
|
|
|
|
title: '操作',
|
|
|
|
key: 'actions',
|
|
|
|
key: 'actions',
|
|
|
|
minWidth: 200,
|
|
|
|
minWidth: 200,
|
|
|
|
|
|
|
|
width: 200,
|
|
|
|
fixed: 'right',
|
|
|
|
fixed: 'right',
|
|
|
|
render(row) {
|
|
|
|
render(row) {
|
|
|
|
return h(ListAction, {
|
|
|
|
return h(ListAction, {
|
|
|
@ -394,15 +395,6 @@ async function formatColumns() {
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
width: 200,
|
|
|
|
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) {
|
|
|
|
render(row: any) {
|
|
|
|
return row.fromusername
|
|
|
|
return row.fromusername
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -576,6 +568,23 @@ const maxHeight = computed(() => {
|
|
|
|
return tableData.value.length ? `${unref(deviceHeight)}px` : 'auto'
|
|
|
|
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)
|
|
|
|
query(pagination.page, pagination.pageSize)
|
|
|
|
|
|
|
|
|
|
|
|
const customTabelRef = ref(null)
|
|
|
|
const customTabelRef = ref(null)
|
|
|
@ -967,11 +976,12 @@ defineExpose({
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="wrapper-content">
|
|
|
|
<div class="wrapper-content">
|
|
|
|
<NDataTable
|
|
|
|
<NDataTable
|
|
|
|
|
|
|
|
id="table"
|
|
|
|
ref="tableRef"
|
|
|
|
ref="tableRef"
|
|
|
|
v-model:checked-row-keys="checkedRowKeys"
|
|
|
|
v-model:checked-row-keys="checkedRowKeys"
|
|
|
|
remote
|
|
|
|
remote
|
|
|
|
:columns="columnsRef"
|
|
|
|
:columns="columnsRef"
|
|
|
|
:scroll-x="1250"
|
|
|
|
:scroll-x="scrollX"
|
|
|
|
:max-height="maxHeight"
|
|
|
|
:max-height="maxHeight"
|
|
|
|
:data="tableData"
|
|
|
|
:data="tableData"
|
|
|
|
:loading="loading"
|
|
|
|
:loading="loading"
|
|
|
|