Commit fbb154f93dadbb029c6e92146214a37b12ee51f6

Authored by xingyu
1 parent 372de7a4

perf: 用户部门树超出高度后添加滚动条

yudao-ui-admin-vue3/src/types/auto-components.d.ts
... ... @@ -51,6 +51,7 @@ declare module '@vue/runtime-core' {
51 51 ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
52 52 ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
53 53 ElRow: typeof import('element-plus/es')['ElRow']
  54 + ElScroll: typeof import('element-plus/es')['ElScroll']
54 55 ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
55 56 ElSelect: typeof import('element-plus/es')['ElSelect']
56 57 ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
... ...
yudao-ui-admin-vue3/src/views/system/user/index.vue
... ... @@ -8,17 +8,19 @@
8 8 </div>
9 9 </template>
10 10 <el-input v-model="filterText" placeholder="搜索部门" />
11   - <el-tree
12   - ref="treeRef"
13   - node-key="id"
14   - default-expand-all
15   - :data="deptOptions"
16   - :props="defaultProps"
17   - :highlight-current="true"
18   - :filter-node-method="filterNode"
19   - :expand-on-click-node="false"
20   - @node-click="handleDeptNodeClick"
21   - />
  11 + <el-scrollbar height="650">
  12 + <el-tree
  13 + ref="treeRef"
  14 + node-key="id"
  15 + default-expand-all
  16 + :data="deptOptions"
  17 + :props="defaultProps"
  18 + :highlight-current="true"
  19 + :filter-node-method="filterNode"
  20 + :expand-on-click-node="false"
  21 + @node-click="handleDeptNodeClick"
  22 + />
  23 + </el-scrollbar>
22 24 </el-card>
23 25 <el-card class="w-4/5 user" style="margin-left: 10px" :gutter="12" shadow="hover">
24 26 <template #header>
... ... @@ -534,8 +536,8 @@ onMounted(async () =&gt; {
534 536  
535 537 <style scoped>
536 538 .user {
537   - height: 900px;
538   - max-height: 960px;
  539 + height: 780px;
  540 + max-height: 800px;
539 541 }
540 542 .card-header {
541 543 display: flex;
... ...