style: 基础设施-列表局部滚动

main
zhongwenkai 2 days ago
parent e2e7ee87cc
commit 19b53cc197

@ -89,7 +89,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="日志编号" align="center" prop="id" width="100" fix="right" />
<el-table-column label="用户编号" align="center" prop="userId" />
<el-table-column label="用户类型" align="center" prop="userType" sortable>
@ -159,6 +159,18 @@ const message = useMessage() // 消息弹窗
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -182,6 +194,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -221,5 +234,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -86,7 +86,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="日志编号" align="center" prop="id" />
<el-table-column label="用户编号" align="center" prop="userId" />
<el-table-column label="用户类型" align="center" prop="userType" sortable>
@ -172,6 +172,18 @@ const message = useMessage() // 消息弹窗
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -194,6 +206,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -247,5 +260,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -56,7 +56,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column align="center" label="数据源">
<template #default="scope">
{{
@ -163,6 +163,18 @@ const { push } = useRouter() // 路由跳转
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -182,6 +194,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -249,5 +262,11 @@ onMounted(async () => {
await getList()
//
dataSourceConfigList.value = await DataSourceConfigApi.getDataSourceConfigList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -79,7 +79,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="参数主键" align="center" prop="id" />
<el-table-column label="参数分类" align="center" prop="category" />
<el-table-column label="参数名称" align="center" prop="name" :show-overflow-tooltip="true" sortable />
@ -151,6 +151,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -171,6 +183,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -223,5 +236,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -50,7 +50,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="文件名" align="center" prop="name" :show-overflow-tooltip="true" sortable />
<el-table-column label="文件路径" align="center" prop="path" :show-overflow-tooltip="true" />
<el-table-column label="URL" align="center" prop="url" :show-overflow-tooltip="true" />
@ -132,6 +132,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -151,6 +163,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -188,5 +201,11 @@ const handleDelete = async (id: number) => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -61,7 +61,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="配置名" align="center" prop="name" sortable />
<el-table-column label="存储器" align="center" prop="storage">
@ -139,6 +139,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -157,6 +169,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -213,5 +226,11 @@ const handleTest = async (id) => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -71,7 +71,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table ref="tableRef" v-loading="loading" :data="list" :max-height="planTableMaxHeight">
<el-table-column label="任务编号" align="center" prop="id" />
<el-table-column label="任务名称" align="center" prop="name" sortable />
<el-table-column label="任务状态" align="center" prop="status" sortable>
@ -162,6 +162,18 @@ const { push } = useRouter() // 路由
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -181,6 +193,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -296,5 +309,11 @@ const handleJobLog = (id?: number) => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -66,7 +66,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="标题" align="center" prop="title" />
<el-table-column label="内容" align="center" prop="content" />
@ -129,6 +129,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const list = ref<FeedbackVO[]>([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -150,6 +162,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -206,5 +219,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -74,7 +74,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="关联计划id" align="center" prop="planId" />
<el-table-column label="派工数量" align="center" prop="num" />
@ -141,6 +141,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const list = ref<BaogongRecordVO[]>([]) //
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -161,6 +173,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -213,5 +226,11 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -81,10 +81,12 @@
<ContentWrap>
<el-table
ref="tableRef"
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
:max-height="planTableMaxHeight"
row-key="id"
@selection-change="handleSelectionChange"
>
@ -152,6 +154,18 @@ const { t } = useI18n()
const loading = ref(true)
const list = ref<ProcessParameterVO[]>([])
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -168,6 +182,7 @@ const filterCount = 4
const toggleFilters = () => {
showAllFilters.value = !showAllFilters.value
updatePlanTableMaxHeight()
}
const getList = async () => {
@ -178,6 +193,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -227,5 +243,11 @@ const handleExport = async () => {
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -81,10 +81,12 @@
<ContentWrap>
<el-table
ref="tableRef"
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
:max-height="planTableMaxHeight"
row-key="id"
@selection-change="handleSelectionChange"
>
@ -152,6 +154,18 @@ const { t } = useI18n()
const loading = ref(true)
const list = ref<ProcessRouteVO[]>([])
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 queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -168,6 +182,7 @@ const filterCount = 4
const toggleFilters = () => {
showAllFilters.value = !showAllFilters.value
updatePlanTableMaxHeight()
}
const getList = async () => {
@ -178,6 +193,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -227,5 +243,11 @@ const handleExport = async () => {
onMounted(() => {
getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

@ -40,7 +40,7 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @selection-change="handleSelectionChange">
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="t('ProductionPlan.WorkReportRecord.tableTaskCodeColumn')" align="center" prop="taskCode" min-width="120px" sortable />
<el-table-column :label="t('ProductionPlan.WorkReportRecord.tablePlanCodeColumn')" align="center" prop="planCode" min-width="120px" sortable />
@ -86,6 +86,18 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const list = ref<BaogongRecordStatVO[]>([]) //
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<(string | number)[]>([])
//
@ -142,6 +154,7 @@ const getList = async () => {
total.value = data.total
} finally {
loading.value = false
updatePlanTableMaxHeight()
}
}
@ -217,6 +230,12 @@ const handleStatExport = async () => {
//
onMounted(async () => {
await getList()
updatePlanTableMaxHeight()
window.addEventListener("resize", updatePlanTableMaxHeight)
})
onBeforeUnmount(() => {
window.removeEventListener("resize", updatePlanTableMaxHeight)
})
</script>

Loading…
Cancel
Save