|
|
|
|
@ -48,7 +48,7 @@ type="success" plain @click="handleExport" :loading="exportLoading"
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table
|
|
|
|
|
ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id"
|
|
|
|
|
ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight" row-key="id"
|
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" fixed="left" reserve-selection />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldInspectionItems.index')" align="center" width="80" fixed="left">
|
|
|
|
|
@ -126,6 +126,17 @@ const loading = ref(true) // 列表的加载中
|
|
|
|
|
const list = ref<DvSubjectVO[]>([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
const planTableMaxHeight = ref(520)
|
|
|
|
|
const planPaginationRef = ref<HTMLElement>()
|
|
|
|
|
|
|
|
|
|
const updatePlanTableMaxHeight = async () => {
|
|
|
|
|
await nextTick()
|
|
|
|
|
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
|
|
|
|
|
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
|
|
|
|
|
const pageBottomGap = 56
|
|
|
|
|
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
|
|
|
|
|
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
|
|
|
|
|
}
|
|
|
|
|
const selectedIds = ref<number[]>([])
|
|
|
|
|
|
|
|
|
|
const handleSelectionChange = (rows: any[]) => {
|
|
|
|
|
@ -148,6 +159,7 @@ const showAllFilters = ref(false)
|
|
|
|
|
const filterCount = 3
|
|
|
|
|
const toggleFilters = () => {
|
|
|
|
|
showAllFilters.value = !showAllFilters.value
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getTagDict = (dictType: string, value: any) => {
|
|
|
|
|
@ -190,6 +202,7 @@ const getList = async () => {
|
|
|
|
|
total.value = data.total
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -256,6 +269,12 @@ const handleExport = async () => {
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
await dictStore.setDictMap()
|
|
|
|
|
dictReady.value = true
|
|
|
|
|
getList()
|
|
|
|
|
await getList()
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
window.addEventListener("resize", updatePlanTableMaxHeight)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
window.removeEventListener("resize", updatePlanTableMaxHeight)
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|