From 5fe6bf78cdaa4dcf114faff570e358d12595bf33 Mon Sep 17 00:00:00 2001 From: zhongwenkai <3478244299@qq.com> Date: Fri, 3 Jul 2026 11:55:32 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=83=BD=E6=BA=90=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=92=8C=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86-=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=B1=80=E9=83=A8=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/criticalComponent/index.vue | 22 +++++++++++++++ src/views/mes/deviceledger/index.vue | 20 +++++++++++++ src/views/mes/devicetype/index.vue | 21 ++++++++++++++ src/views/mes/dvrepair/index.vue | 20 +++++++++++++ src/views/mes/dvsubject/index.vue | 31 +++++++++++++++++++-- src/views/mes/energydevice/index.vue | 21 ++++++++++++++ src/views/mes/energydevicecheck/index.vue | 19 +++++++++++++ src/views/mes/energytype/index.vue | 22 +++++++++++++++ src/views/mes/planMaintenance/index.vue | 21 +++++++++++++- src/views/mes/taskManagement/index.vue | 25 +++++++++++++++-- src/views/mes/workOrderManagement/index.vue | 22 +++++++++++++++ 11 files changed, 238 insertions(+), 6 deletions(-) diff --git a/src/views/mes/criticalComponent/index.vue b/src/views/mes/criticalComponent/index.vue index d7504f19..0259cb84 100644 --- a/src/views/mes/criticalComponent/index.vue +++ b/src/views/mes/criticalComponent/index.vue @@ -107,10 +107,12 @@ @@ -217,8 +219,20 @@ const { t } = useI18n() const loading = ref(true) const list = ref([]) const total = ref(0) +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() const exportLoading = ref(false) +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 queryParams = reactive({ pageNo: 1, pageSize: 10, @@ -235,6 +249,7 @@ const showAllFilters = ref(false) const filterCount = 5 const toggleFilters = () => { showAllFilters.value = !showAllFilters.value + updatePlanTableMaxHeight() } const importDialogVisible = ref(false) @@ -263,6 +278,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -392,5 +408,11 @@ const importTemplate = async () => { onMounted(() => { getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/mes/deviceledger/index.vue b/src/views/mes/deviceledger/index.vue index ea93acd5..f20e3f65 100644 --- a/src/views/mes/deviceledger/index.vue +++ b/src/views/mes/deviceledger/index.vue @@ -298,6 +298,7 @@ :data="list" :stripe="true" :show-overflow-tooltip="true" + :max-height="planTableMaxHeight" row-key="id" @selection-change="handleSelectionChange" > @@ -693,6 +694,17 @@ const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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([]) const handleSelectionChange = (rows: any[]) => { selectedIds.value = rows?.map((row) => row.id).filter((id) => id !== undefined) ?? [] @@ -703,6 +715,7 @@ const toggleView = () => { currentView.value = currentView.value === 'table' ? 'grid' : 'table' // 保存视图偏好 localStorage.setItem('equipment-view', currentView.value) + updatePlanTableMaxHeight() } const dictStore = useDictStoreWithOut() @@ -1022,6 +1035,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -1100,6 +1114,12 @@ onMounted(async () => { getDeviceTypeTree() getTypeTree() getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/mes/devicetype/index.vue b/src/views/mes/devicetype/index.vue index cef681ba..ff3ddb1b 100644 --- a/src/views/mes/devicetype/index.vue +++ b/src/views/mes/devicetype/index.vue @@ -63,10 +63,12 @@ ([]) // 列表的数据 const total = ref(0) // 列表的总页数 +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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 showPagination = ref(true) const queryParams = reactive({ pageNo: 1, @@ -177,6 +191,7 @@ const getList = async () => { showPagination.value = true } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -229,5 +244,11 @@ const handleExport = async () => { /** 初始化 **/ onMounted(() => { getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/mes/dvrepair/index.vue b/src/views/mes/dvrepair/index.vue index 708258bf..f2e77422 100644 --- a/src/views/mes/dvrepair/index.vue +++ b/src/views/mes/dvrepair/index.vue @@ -127,6 +127,7 @@ :data="list" :stripe="true" :show-overflow-tooltip="true" + :max-height="planTableMaxHeight" row-key="id" @selection-change="handleSelectionChange"> @@ -259,6 +260,7 @@ const showAllFilters = ref(false) const filterCount = 8 const toggleFilters = () => { showAllFilters.value = !showAllFilters.value + updatePlanTableMaxHeight() } const statusOptions = [ @@ -308,6 +310,17 @@ const isProcessedRepair = (value: any) => { } const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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([]) const handleSelectionChange = (rows: any[]) => { selectedIds.value = rows?.map((row) => row.id).filter((id) => id !== undefined) ?? [] @@ -322,6 +335,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -399,5 +413,11 @@ const handleExport = async () => { /** 初始化 **/ onMounted(() => { getList() + updatePlanTableMaxHeight() + window.addEventListener("resize", updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener("resize", updatePlanTableMaxHeight) }) diff --git a/src/views/mes/dvsubject/index.vue b/src/views/mes/dvsubject/index.vue index 3c1d7eef..197e304b 100644 --- a/src/views/mes/dvsubject/index.vue +++ b/src/views/mes/dvsubject/index.vue @@ -62,8 +62,15 @@ + ref="tableRef" + v-loading="loading" + :data="list" + :stripe="true" + :show-overflow-tooltip="true" + :max-height="planTableMaxHeight" + row-key="id" + @selection-change="handleSelectionChange" + >