fix(admin): 部门树页左右两栏锁定视口高度并改用 ElTable 固定表头滚动

This commit is contained in:
HTEWJ\26070045 committed 2026-10-29 17:48:38 +08:00
1 parent bf44a5a70e
commit 90166068ee
1 file changed
+17 -6
@@ -106,7 +106,7 @@ onMounted(() => {
<template>
<ElConfigProvider :locale="elementLocale">
<section class="admin-table-section">
<section class="admin-table-section admin-dept-page">
<header class="admin-table-header admin-table-header--stacked">
<div>
<h2 class="section-title">{{ t('admin.dept.title') }}</h2>
@@ -243,13 +243,13 @@ onMounted(() => {
/>
</div>
<div v-loading="memberLoading" class="admin-dept-members__tablewrap">
<ElTable
v-loading="memberLoading"
:data="memberData?.members ?? []"
row-key="id"
stripe
height="100%"
:empty-text="t('admin.dept.members.empty')"
class="admin-dept-members__table"
>
<ElTableColumn :label="t('admin.dept.members.columns.name')" min-width="160">
<template #default="{ row }">
@@ -270,6 +270,7 @@ onMounted(() => {
</template>
</ElTableColumn>
</ElTable>
</div>
<footer v-if="memberData" class="admin-dept-members__footer">
<ElPagination
@@ -302,6 +303,13 @@ onMounted(() => {
<style scoped>
/* 页内布局(非 Element 控件内部),间距对齐迁移规范:筛选条、面板分隔、分页右侧 */
/* AdminLayout 内容列高度确定(h-dvh 壳内 flex-1 min-h-0),本页卡片填满后左右两栏各自滚动 */
.admin-dept-page {
height: 100%;
min-height: 24rem;
display: flex;
flex-direction: column;
}
.admin-dept-filter {
display: flex;
align-items: center;
@@ -313,16 +321,16 @@ onMounted(() => {
width: 16rem;
}
.admin-dept-body {
flex: 1;
min-height: 0;
display: flex;
align-items: stretch;
min-height: 24rem;
}
.admin-dept-tree {
width: 320px;
flex-shrink: 0;
padding: 12px 8px 12px 32px;
border-right: 1px solid var(--el-border-color-lighter);
max-height: calc(100vh - 280px);
overflow-y: auto;
}
.admin-dept-tree__row {
@@ -384,10 +392,12 @@ onMounted(() => {
.admin-dept-members {
flex: 1;
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
}
.admin-dept-members__empty {
flex: 1;
margin: auto;
}
.admin-dept-members__header {
@@ -425,8 +435,9 @@ onMounted(() => {
.admin-dept-members__search {
width: 16rem;
}
.admin-dept-members__table {
.admin-dept-members__tablewrap {
flex: 1;
min-height: 0;
}
.admin-dept-members__footer {
display: flex;