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> <template>
<ElConfigProvider :locale="elementLocale"> <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"> <header class="admin-table-header admin-table-header--stacked">
<div> <div>
<h2 class="section-title">{{ t('admin.dept.title') }}</h2> <h2 class="section-title">{{ t('admin.dept.title') }}</h2>
@@ -243,13 +243,13 @@ onMounted(() => {
/> />
</div> </div>
<div v-loading="memberLoading" class="admin-dept-members__tablewrap">
<ElTable <ElTable
v-loading="memberLoading"
:data="memberData?.members ?? []" :data="memberData?.members ?? []"
row-key="id" row-key="id"
stripe stripe
height="100%"
:empty-text="t('admin.dept.members.empty')" :empty-text="t('admin.dept.members.empty')"
class="admin-dept-members__table"
> >
<ElTableColumn :label="t('admin.dept.members.columns.name')" min-width="160"> <ElTableColumn :label="t('admin.dept.members.columns.name')" min-width="160">
<template #default="{ row }"> <template #default="{ row }">
@@ -270,6 +270,7 @@ onMounted(() => {
</template> </template>
</ElTableColumn> </ElTableColumn>
</ElTable> </ElTable>
</div>
<footer v-if="memberData" class="admin-dept-members__footer"> <footer v-if="memberData" class="admin-dept-members__footer">
<ElPagination <ElPagination
@@ -302,6 +303,13 @@ onMounted(() => {
<style scoped> <style scoped>
/* 页内布局(非 Element 控件内部),间距对齐迁移规范:筛选条、面板分隔、分页右侧 */ /* 页内布局(非 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 { .admin-dept-filter {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -313,16 +321,16 @@ onMounted(() => {
width: 16rem; width: 16rem;
} }
.admin-dept-body { .admin-dept-body {
flex: 1;
min-height: 0;
display: flex; display: flex;
align-items: stretch; align-items: stretch;
min-height: 24rem;
} }
.admin-dept-tree { .admin-dept-tree {
width: 320px; width: 320px;
flex-shrink: 0; flex-shrink: 0;
padding: 12px 8px 12px 32px; padding: 12px 8px 12px 32px;
border-right: 1px solid var(--el-border-color-lighter); border-right: 1px solid var(--el-border-color-lighter);
max-height: calc(100vh - 280px);
overflow-y: auto; overflow-y: auto;
} }
.admin-dept-tree__row { .admin-dept-tree__row {
@@ -384,10 +392,12 @@ onMounted(() => {
.admin-dept-members { .admin-dept-members {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.admin-dept-members__empty { .admin-dept-members__empty {
flex: 1;
margin: auto; margin: auto;
} }
.admin-dept-members__header { .admin-dept-members__header {
@@ -425,8 +435,9 @@ onMounted(() => {
.admin-dept-members__search { .admin-dept-members__search {
width: 16rem; width: 16rem;
} }
.admin-dept-members__table { .admin-dept-members__tablewrap {
flex: 1; flex: 1;
min-height: 0;
} }
.admin-dept-members__footer { .admin-dept-members__footer {
display: flex; display: flex;