|
@@ -1,7 +1,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref, nextTick, onMounted } from 'vue'
|
|
import { ref, nextTick, onMounted } from 'vue'
|
|
|
import { type VxeGridInstance, type VxeGridProps } from 'vxe-table'
|
|
import { type VxeGridInstance, type VxeGridProps } from 'vxe-table'
|
|
|
-import { autoWidth } from '@/utils/table'
|
|
|
|
|
|
|
+// import { autoWidth } from '@/utils/table'
|
|
|
import { useRowClickStyle } from '@/hooks/rowClickStyle'
|
|
import { useRowClickStyle } from '@/hooks/rowClickStyle'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
import { formatTimezone, formatNumber } from '@/utils/tools'
|
|
import { formatTimezone, formatNumber } from '@/utils/tools'
|
|
@@ -66,8 +66,9 @@ const getTableColumns = async () => {
|
|
|
{ type: 'checkbox', width: 50, fixed: 'left' },
|
|
{ type: 'checkbox', width: 50, fixed: 'left' },
|
|
|
...handleColumns(res.data.OperationTableColumns)
|
|
...handleColumns(res.data.OperationTableColumns)
|
|
|
]
|
|
]
|
|
|
|
|
+ console.log('tableData.value.columns', tableData.value.columns)
|
|
|
const index = tableData.value.columns.findIndex((item: any) => item.title === 'Action')
|
|
const index = tableData.value.columns.findIndex((item: any) => item.title === 'Action')
|
|
|
- if (index !== -1) {
|
|
|
|
|
|
|
+ if (index === -1) {
|
|
|
tableData.value.columns.push({
|
|
tableData.value.columns.push({
|
|
|
title: 'Action',
|
|
title: 'Action',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
@@ -79,7 +80,7 @@ const getTableColumns = async () => {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
- tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
|
|
+ // tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
tableLoadingColumn.value = false
|
|
tableLoadingColumn.value = false
|
|
|
selectedTableData.value = []
|
|
selectedTableData.value = []
|
|
|
})
|
|
})
|
|
@@ -126,7 +127,7 @@ const getTableData = async (isPageChange?: boolean) => {
|
|
|
.finally(() => {
|
|
.finally(() => {
|
|
|
selectedTableData.value = []
|
|
selectedTableData.value = []
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
- tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
|
|
+ // tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
tableLoadingTableData.value = false
|
|
tableLoadingTableData.value = false
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
@@ -149,16 +150,16 @@ const SearchOperationLog = (val: any) => {
|
|
|
.finally(() => {
|
|
.finally(() => {
|
|
|
selectedTableData.value = []
|
|
selectedTableData.value = []
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
- tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
|
|
+ // tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
tableLoadingTableData.value = false
|
|
tableLoadingTableData.value = false
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
Promise.all([getTableColumns(), getTableData(false)]).finally(() => {
|
|
Promise.all([getTableColumns(), getTableData(false)]).finally(() => {
|
|
|
- nextTick(() => {
|
|
|
|
|
- tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // nextTick(() => {
|
|
|
|
|
+ // tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
+ // })
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -253,9 +254,9 @@ const handleCustomizeColumns = () => {
|
|
|
// 定制表格
|
|
// 定制表格
|
|
|
const customizeColumns = async () => {
|
|
const customizeColumns = async () => {
|
|
|
await getTableColumns()
|
|
await getTableColumns()
|
|
|
- nextTick(() => {
|
|
|
|
|
- tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // nextTick(() => {
|
|
|
|
|
+ // tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
+ // })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const tableLoadingColumn = ref(false)
|
|
const tableLoadingColumn = ref(false)
|