From 93779db584e5dbda4fdfd385928000c568be98a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9E=E5=AE=9D=E5=B1=B1?= <1253070437@qq.com> Date: Wed, 11 Feb 2026 01:23:13 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9C=BA=E6=9E=84=E3=80=91=E5=86=8D?= =?UTF-8?q?=E6=AC=A1=E4=BC=98=E5=8C=96=E5=A4=A7=E6=95=B0=E6=8D=AE=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=9C=BA=E6=9E=84=E6=8E=88=E6=9D=83=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E3=80=81=E7=95=8C=E9=9D=A2=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/XnOrgSelector/index.vue | 10 +- .../components/XnPositionSelector/index.vue | 10 +- .../src/components/XnRoleSelector/index.vue | 10 +- .../src/components/XnUserSelector/index.vue | 9 +- snowy-admin-web/src/views/biz/org/index.vue | 43 ++++-- .../src/views/biz/position/index.vue | 43 +++--- snowy-admin-web/src/views/biz/user/index.vue | 43 +++--- snowy-admin-web/src/views/sys/org/index.vue | 43 ++++-- .../src/views/sys/position/index.vue | 42 ++++-- snowy-admin-web/src/views/sys/role/index.vue | 67 +++++---- snowy-admin-web/src/views/sys/user/index.vue | 42 ++++-- .../org/service/impl/BizOrgServiceImpl.java | 128 +++++++++++++----- 12 files changed, 320 insertions(+), 170 deletions(-) diff --git a/snowy-admin-web/src/components/XnOrgSelector/index.vue b/snowy-admin-web/src/components/XnOrgSelector/index.vue index a916b6e3..fd74d8bf 100644 --- a/snowy-admin-web/src/components/XnOrgSelector/index.vue +++ b/snowy-admin-web/src/components/XnOrgSelector/index.vue @@ -36,6 +36,7 @@ :tree-data="treeData" :field-names="treeFieldNames" :load-data="onLoadData" + :height="treeHeight" @select="treeSelect" > @@ -153,7 +154,7 @@ import { message } from 'ant-design-vue' import { remove, isEmpty, cloneDeep } from 'lodash-es' import userCenterApi from '@/api/sys/userCenterApi' - import { useSlots } from 'vue' + import { useSlots, triggerRef } from 'vue' // 弹窗是否打开 const visible = ref(false) // 主表格common @@ -252,11 +253,12 @@ const current = ref(0) // 当前页数 const pageSize = ref(10) // 每页条数 const total = ref(0) // 数据总数 + const treeHeight = ref(400) // 懒加载子节点 const onLoadData = (treeNode) => { return new Promise((resolve) => { - if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children) { + if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) { resolve() return } @@ -271,7 +273,7 @@ isLeaf: item.isLeaf === undefined ? false : item.isLeaf } }) - treeData.value = [...treeData.value] + triggerRef(treeData) resolve() }) }) @@ -321,6 +323,8 @@ return } visible.value = true + // 动态计算树高度,适配不同屏幕 + treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460) // 获取机构树 if (typeof props.orgTreeLazyApi === 'function') { props diff --git a/snowy-admin-web/src/components/XnPositionSelector/index.vue b/snowy-admin-web/src/components/XnPositionSelector/index.vue index a22a26d6..547a5541 100644 --- a/snowy-admin-web/src/components/XnPositionSelector/index.vue +++ b/snowy-admin-web/src/components/XnPositionSelector/index.vue @@ -36,6 +36,7 @@ :tree-data="treeData" :field-names="treeFieldNames" :load-data="onLoadData" + :height="treeHeight" @select="treeSelect" > @@ -153,7 +154,7 @@ import { message } from 'ant-design-vue' import { remove, isEmpty, cloneDeep } from 'lodash-es' import userCenterApi from '@/api/sys/userCenterApi' - import { useSlots } from 'vue' + import { useSlots, triggerRef } from 'vue' // 弹窗是否打开 const visible = ref(false) // 主表格common @@ -248,11 +249,12 @@ const current = ref(0) // 当前页数 const pageSize = ref(10) // 每页条数 const total = ref(0) // 数据总数 + const treeHeight = ref(400) // 懒加载子节点 const onLoadData = (treeNode) => { return new Promise((resolve) => { - if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children) { + if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) { resolve() return } @@ -267,7 +269,7 @@ isLeaf: item.isLeaf === undefined ? false : item.isLeaf } }) - treeData.value = [...treeData.value] + triggerRef(treeData) resolve() }) }) @@ -317,6 +319,8 @@ return } visible.value = true + // 动态计算树高度,适配不同屏幕 + treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460) // 获取机构树 if (typeof props.orgTreeLazyApi === 'function') { props diff --git a/snowy-admin-web/src/components/XnRoleSelector/index.vue b/snowy-admin-web/src/components/XnRoleSelector/index.vue index c2a42179..ba119107 100644 --- a/snowy-admin-web/src/components/XnRoleSelector/index.vue +++ b/snowy-admin-web/src/components/XnRoleSelector/index.vue @@ -36,6 +36,7 @@ :tree-data="treeData" :field-names="treeFieldNames" :load-data="onLoadData" + :height="treeHeight" @select="treeSelect" > @@ -154,7 +155,7 @@ import { message } from 'ant-design-vue' import { remove, isEmpty, cloneDeep } from 'lodash-es' import userCenterApi from '@/api/sys/userCenterApi' - import { useSlots } from 'vue' + import { useSlots, triggerRef, nextTick } from 'vue' // 弹窗是否打开 const visible = ref(false) // 主表格common @@ -255,11 +256,12 @@ const current = ref(0) // 当前页数 const pageSize = ref(10) // 每页条数 const total = ref(0) // 数据总数 + const treeHeight = ref(400) // 懒加载子节点 const onLoadData = (treeNode) => { return new Promise((resolve) => { - if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children) { + if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) { resolve() return } @@ -274,7 +276,7 @@ isLeaf: item.isLeaf === undefined ? false : item.isLeaf } }) - treeData.value = [...treeData.value] + triggerRef(treeData) resolve() }) }) @@ -324,6 +326,8 @@ return } visible.value = true + // 动态计算树高度,适配不同屏幕 + treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460) // 获取机构树 if (typeof props.orgTreeLazyApi === 'function') { props diff --git a/snowy-admin-web/src/components/XnUserSelector/index.vue b/snowy-admin-web/src/components/XnUserSelector/index.vue index 797b19b3..2640d10b 100644 --- a/snowy-admin-web/src/components/XnUserSelector/index.vue +++ b/snowy-admin-web/src/components/XnUserSelector/index.vue @@ -43,6 +43,7 @@ :tree-data="treeData" :field-names="treeFieldNames" :load-data="onLoadData" + :height="treeHeight" @select="treeSelect" > @@ -163,6 +164,7 @@ import { message } from 'ant-design-vue' import { remove, isEmpty, cloneDeep } from 'lodash-es' import userCenterApi from '@/api/sys/userCenterApi' + import { triggerRef } from 'vue' // 弹窗是否打开 const visible = ref(false) const deleteShow = ref('') @@ -261,6 +263,7 @@ const current = ref(0) // 当前页数 const pageSize = ref(10) // 每页条数 const total = ref(0) // 数据总数 + const treeHeight = ref(400) // 获取选中列表的api const userListByIdList = (param) => { if (typeof props.userListByIdListApi === 'function') { @@ -287,7 +290,7 @@ // 懒加载子节点 const onLoadData = (treeNode) => { return new Promise((resolve) => { - if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children) { + if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) { resolve() return } @@ -302,7 +305,7 @@ isLeaf: item.isLeaf === undefined ? false : item.isLeaf } }) - treeData.value = [...treeData.value] + triggerRef(treeData) resolve() }) }) @@ -315,6 +318,8 @@ return } visible.value = true + // 动态计算树高度,适配不同屏幕 + treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460) // 获取机构树 if (typeof props.orgTreeLazyApi === 'function') { props diff --git a/snowy-admin-web/src/views/biz/org/index.vue b/snowy-admin-web/src/views/biz/org/index.vue index da53b670..445bf9cb 100644 --- a/snowy-admin-web/src/views/biz/org/index.vue +++ b/snowy-admin-web/src/views/biz/org/index.vue @@ -2,8 +2,14 @@