style:生产计划-列表局部滚动

main
黄伟杰 4 days ago
parent 5b22b2b692
commit 7564e21743

@ -78,7 +78,7 @@
<el-tab-pane :label="t('ProductionPlan.Plan.tabToStoreLabel')" name="4" />
<el-tab-pane :label="t('ProductionPlan.Plan.tabStoredLabel')" name="5" />
</el-tabs>
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id">
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight" row-key="id">
<!-- 投料进度子表的列表 -->
<el-table-column type="expand">
<template #default="scope">
@ -304,6 +304,17 @@ const loading = ref(true) // 列表的加载中
const list = ref<PlanVO[]>([]) //
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 inspectableMap = reactive<Record<number, boolean | undefined>>({})
const baogongRecordRefreshKey = ref(0)
const zjProductPreListRefreshKey = ref(0)
@ -336,6 +347,7 @@ const filterCount = 4 // 筛选框数量
/** 切换筛选框展开/折叠 */
const toggleFilters = () => {
showAllFilters.value = !showAllFilters.value
updatePlanTableMaxHeight()
}
const warehouseList = ref<WarehouseVO[]>([]) //
@ -359,6 +371,7 @@ const getList = async () => {
await refreshInspectableMap(list.value)
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -423,6 +436,12 @@ onMounted(async () => {
queryParams.status = '1'
}
await getList()
updatePlanTableMaxHeight()
window.addEventListener('resize', updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener('resize', updatePlanTableMaxHeight)
})
/** 物料需求 */
const itemFormRef = ref()

Loading…
Cancel
Save