mirror of
https://gitee.com/xiaonuobase/snowy.git
synced 2026-03-22 02:37:16 +08:00
【更新】机构大数据完善与登录优化(待验证)
This commit is contained in:
@@ -30,7 +30,7 @@ export default {
|
||||
return request('ownUser', data, 'get')
|
||||
},
|
||||
// 获取机构树选择器(懒加载)
|
||||
groupOrgTreeLazySelector(data) {
|
||||
groupOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取用户选择器
|
||||
|
||||
@@ -26,12 +26,8 @@ export default {
|
||||
orgList(data) {
|
||||
return request('list', data, 'get')
|
||||
},
|
||||
// 获取机构树
|
||||
orgTree(data) {
|
||||
return request('tree', data, 'get')
|
||||
},
|
||||
// 获取机构树(懒加载)
|
||||
orgTreeLazy(data) {
|
||||
orgTree(data) {
|
||||
return request('tree', data, 'get')
|
||||
},
|
||||
// 提交表单 edit为true时为编辑,默认为新增
|
||||
@@ -47,7 +43,7 @@ export default {
|
||||
return request('detail', data, 'get')
|
||||
},
|
||||
// 获取机构树选择器(懒加载)
|
||||
orgTreeLazySelector(data) {
|
||||
orgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取人员选择器
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
return request('detail', data, 'get')
|
||||
},
|
||||
// 获取机构树选择器(懒加载)
|
||||
positionOrgTreeLazySelector(data) {
|
||||
positionOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取岗位选择器
|
||||
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
return request('resetPassword', data)
|
||||
},
|
||||
// 获取机构树选择器(懒加载)
|
||||
userOrgTreeLazySelector(data) {
|
||||
orgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取职位选择器
|
||||
|
||||
@@ -50,15 +50,11 @@ export default {
|
||||
configSysThirdAllowFlagList(data) {
|
||||
return request('sysThirdAllowFlagList', data, 'get')
|
||||
},
|
||||
// 获取机构树
|
||||
configOrgTree(data) {
|
||||
return request('orgTree', data, 'get')
|
||||
// 获取组织树选择器(懒加载)
|
||||
configOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取机构树(懒加载)
|
||||
configOrgTreeLazy(data) {
|
||||
return request('orgTreeLazy', data, 'get')
|
||||
},
|
||||
// 获取机构选择器
|
||||
// 获取组织选择器
|
||||
configOrgSelector(data) {
|
||||
return request('orgSelector', data, 'get')
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
return request('ownUser', data, 'get')
|
||||
},
|
||||
// 获取组织树选择器(懒加载)
|
||||
groupOrgTreeLazySelector(data) {
|
||||
groupOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取用户选择器
|
||||
|
||||
@@ -22,12 +22,8 @@ export default {
|
||||
orgPage(data) {
|
||||
return request('page', data, 'get')
|
||||
},
|
||||
// 获取组织树
|
||||
orgTree(data) {
|
||||
return request('tree', data, 'get')
|
||||
},
|
||||
// 获取组织树(懒加载)
|
||||
orgTreeLazy(data) {
|
||||
orgTree(data) {
|
||||
return request('tree', data, 'get')
|
||||
},
|
||||
// 提交表单 edit为true时为编辑,默认为新增
|
||||
@@ -43,7 +39,7 @@ export default {
|
||||
return request('detail', data, 'get')
|
||||
},
|
||||
// 获取组织树选择器(懒加载)
|
||||
orgOrgTreeLazySelector(data) {
|
||||
orgOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取用户选择器
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
return request('detail', data, 'get')
|
||||
},
|
||||
// 获取组织树选择器(懒加载)
|
||||
positionOrgTreeLazySelector(data) {
|
||||
positionOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取职位选择器
|
||||
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
return request('grantUser', data)
|
||||
},
|
||||
// 获取组织树选择器(懒加载)
|
||||
roleOrgTreeLazySelector(data) {
|
||||
roleOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取资源授权树
|
||||
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
return request('resetPassword', data)
|
||||
},
|
||||
// 获取组织树选择器(懒加载)
|
||||
userOrgTreeLazySelector(data) {
|
||||
userOrgTreeSelector(data) {
|
||||
return request('orgTreeSelector', data, 'get')
|
||||
},
|
||||
// 获取职位选择器
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
### 说明
|
||||
|
||||
该组件为小诺机构选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。支持同步全量树和异步懒加载树两种模式。
|
||||
该组件为小诺机构选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。使用异步懒加载树模式。
|
||||
|
||||
@author yubaoshan
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
| 1 | radioModel | Boolean | 是否单选;与addShow隐藏同时可用 | false |
|
||||
| 2 | dataIsConverterFlw | Boolean | 是否为工作流格式 | false |
|
||||
| 3 | selectorConverterKey | String | 工作流转换器key | ORG |
|
||||
| 4 | orgTreeApi | Function | 机构树接口(同步全量加载) | - |
|
||||
| 5 | orgTreeLazyApi | Function | 机构树懒加载接口(配置后优先使用异步模式,不配则走同步全量) | - |
|
||||
| 6 | orgPageApi | Function | 机构分页接口 | - |
|
||||
| 7 | orgListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 8 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 9 | dataType | String | 数据类型array或string | array |
|
||||
| 10 | show | Boolean | 是否显示已选择机构(非表单内、单纯的选择机构需要隐藏) | true |
|
||||
| 11 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
| 4 | orgTreeApi | Function | 机构树懒加载接口 | - |
|
||||
| 5 | orgPageApi | Function | 机构分页接口 | - |
|
||||
| 6 | orgListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 7 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 8 | dataType | String | 数据类型array或string | array |
|
||||
| 9 | show | Boolean | 是否显示已选择机构(非表单内、单纯的选择机构需要隐藏) | true |
|
||||
| 10 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
|
||||
### emits定义
|
||||
|
||||
|
||||
@@ -202,9 +202,6 @@
|
||||
orgTreeApi: {
|
||||
type: Function
|
||||
},
|
||||
orgTreeLazyApi: {
|
||||
type: Function
|
||||
},
|
||||
orgPageApi: {
|
||||
type: Function
|
||||
},
|
||||
@@ -258,12 +255,12 @@
|
||||
// 懒加载子节点
|
||||
const onLoadData = (treeNode) => {
|
||||
return new Promise((resolve) => {
|
||||
if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
if (typeof props.orgTreeApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
resolve()
|
||||
return
|
||||
}
|
||||
props
|
||||
.orgTreeLazyApi({
|
||||
.orgTreeApi({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -289,15 +286,6 @@
|
||||
getDataNameById(data)
|
||||
openModal()
|
||||
}
|
||||
// 获取机构树的api
|
||||
const orgTree = (param) => {
|
||||
if (typeof props.orgTreeApi === 'function') {
|
||||
return props.orgTreeApi(param)
|
||||
} else {
|
||||
message.warning('未配置机构树API')
|
||||
return Promise.resolve([])
|
||||
}
|
||||
}
|
||||
// 获取列表的api
|
||||
const orgPage = (param) => {
|
||||
if (typeof props.orgPageApi === 'function') {
|
||||
@@ -326,50 +314,25 @@
|
||||
// 动态计算树高度,适配不同屏幕
|
||||
treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460)
|
||||
// 获取机构树
|
||||
if (typeof props.orgTreeLazyApi === 'function') {
|
||||
props
|
||||
.orgTreeLazyApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
props
|
||||
.orgTreeApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
} else {
|
||||
orgTree()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data
|
||||
// 默认展开2级
|
||||
treeData.value.forEach((item) => {
|
||||
// 因为0的顶级
|
||||
if (item.parentId === '0') {
|
||||
defaultExpandedKeys.value.push(item.id)
|
||||
// 取到下级ID
|
||||
if (item.children) {
|
||||
item.children.forEach((items) => {
|
||||
defaultExpandedKeys.value.push(items.id)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
searchFormState.value.size = pageSize.value
|
||||
loadData()
|
||||
if (isEmpty(recordIds.value)) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
### 说明
|
||||
|
||||
该组件为小诺职位选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。支持同步全量树和异步懒加载树两种模式。
|
||||
该组件为小诺职位选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。使用异步懒加载树模式。
|
||||
|
||||
@author yubaoshan
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
|-----|-------------------------|---------------|---------------------------------------------|--------|
|
||||
| 1 | radioModel | Boolean | 是否单选;与addShow隐藏同时可用 | false |
|
||||
| 2 | dataIsConverterFlw | Boolean | 是否为工作流格式 | false |
|
||||
| 3 | orgTreeApi | Function | 机构树接口(同步全量加载) | - |
|
||||
| 4 | orgTreeLazyApi | Function | 机构树懒加载接口(配置后优先使用异步模式,不配则走同步全量) | - |
|
||||
| 5 | positionPageApi | Function | 职位分页接口 | - |
|
||||
| 6 | positionListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 7 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 8 | dataType | String | 数据类型array或string | array |
|
||||
| 9 | show | Boolean | 是否显示已选择职位(非表单内、单纯的选择职位需要隐藏) | true |
|
||||
| 10 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
| 3 | orgTreeApi | Function | 机构树懒加载接口 | - |
|
||||
| 4 | positionPageApi | Function | 职位分页接口 | - |
|
||||
| 5 | positionListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 6 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 7 | dataType | String | 数据类型array或string | array |
|
||||
| 8 | show | Boolean | 是否显示已选择职位(非表单内、单纯的选择职位需要隐藏) | true |
|
||||
| 9 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
|
||||
### emits定义
|
||||
|
||||
|
||||
@@ -198,9 +198,6 @@
|
||||
orgTreeApi: {
|
||||
type: Function
|
||||
},
|
||||
orgTreeLazyApi: {
|
||||
type: Function
|
||||
},
|
||||
positionPageApi: {
|
||||
type: Function
|
||||
},
|
||||
@@ -254,12 +251,12 @@
|
||||
// 懒加载子节点
|
||||
const onLoadData = (treeNode) => {
|
||||
return new Promise((resolve) => {
|
||||
if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
if (typeof props.orgTreeApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
resolve()
|
||||
return
|
||||
}
|
||||
props
|
||||
.orgTreeLazyApi({
|
||||
.orgTreeApi({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -285,15 +282,6 @@
|
||||
getDataNameById(data)
|
||||
openModal()
|
||||
}
|
||||
// 获取机构树的api
|
||||
const orgTree = (param) => {
|
||||
if (typeof props.orgTreeApi === 'function') {
|
||||
return props.orgTreeApi(param)
|
||||
} else {
|
||||
message.warning('未配置机构树API')
|
||||
return Promise.resolve([])
|
||||
}
|
||||
}
|
||||
// 获取列表的api
|
||||
const positionPage = (param) => {
|
||||
if (typeof props.positionPageApi === 'function') {
|
||||
@@ -322,50 +310,25 @@
|
||||
// 动态计算树高度,适配不同屏幕
|
||||
treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460)
|
||||
// 获取机构树
|
||||
if (typeof props.orgTreeLazyApi === 'function') {
|
||||
props
|
||||
.orgTreeLazyApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
props
|
||||
.orgTreeApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
} else {
|
||||
orgTree()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data
|
||||
// 默认展开2级
|
||||
treeData.value.forEach((item) => {
|
||||
// 因为0的顶级
|
||||
if (item.parentId === '0') {
|
||||
defaultExpandedKeys.value.push(item.id)
|
||||
// 取到下级ID
|
||||
if (item.children) {
|
||||
item.children.forEach((items) => {
|
||||
defaultExpandedKeys.value.push(items.id)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
searchFormState.value.size = pageSize.value
|
||||
loadData()
|
||||
if (isEmpty(recordIds.value)) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
### 说明
|
||||
|
||||
该组件为小诺角色选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。支持同步全量树和异步懒加载树两种模式。
|
||||
该组件为小诺角色选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。使用异步懒加载树模式。
|
||||
|
||||
@author yubaoshan
|
||||
|
||||
@@ -14,15 +14,14 @@
|
||||
|-----|---------------------|---------------|---------------------------------------------|--------|
|
||||
| 1 | radioModel | Boolean | 是否单选;与addShow隐藏同时可用 | false |
|
||||
| 2 | dataIsConverterFlw | Boolean | 是否为工作流格式 | false |
|
||||
| 3 | orgTreeApi | Function | 机构树接口(同步全量加载) | - |
|
||||
| 4 | orgTreeLazyApi | Function | 机构树懒加载接口(配置后优先使用异步模式,不配则走同步全量) | - |
|
||||
| 5 | rolePageApi | Function | 角色分页接口 | - |
|
||||
| 6 | roleListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 7 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 8 | dataType | String | 数据类型array或string | array |
|
||||
| 9 | show | Boolean | 是否显示已选择角色(非表单内、单纯的选择角色需要隐藏) | true |
|
||||
| 10 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
| 11 | roleGlobal | Boolean | 是否展示"全局"节点 | true |
|
||||
| 3 | orgTreeApi | Function | 机构树懒加载接口 | - |
|
||||
| 4 | rolePageApi | Function | 角色分页接口 | - |
|
||||
| 5 | roleListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 6 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 7 | dataType | String | 数据类型array或string | array |
|
||||
| 8 | show | Boolean | 是否显示已选择角色(非表单内、单纯的选择角色需要隐藏) | true |
|
||||
| 9 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
| 10 | roleGlobal | Boolean | 是否展示"全局"节点 | true |
|
||||
|
||||
### emits定义
|
||||
|
||||
|
||||
@@ -199,9 +199,6 @@
|
||||
orgTreeApi: {
|
||||
type: Function
|
||||
},
|
||||
orgTreeLazyApi: {
|
||||
type: Function
|
||||
},
|
||||
rolePageApi: {
|
||||
type: Function
|
||||
},
|
||||
@@ -261,12 +258,12 @@
|
||||
// 懒加载子节点
|
||||
const onLoadData = (treeNode) => {
|
||||
return new Promise((resolve) => {
|
||||
if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
if (typeof props.orgTreeApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
resolve()
|
||||
return
|
||||
}
|
||||
props
|
||||
.orgTreeLazyApi({
|
||||
.orgTreeApi({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -292,15 +289,6 @@
|
||||
getDataNameById(data)
|
||||
openModal()
|
||||
}
|
||||
// 获取机构树的api
|
||||
const orgTree = (param) => {
|
||||
if (typeof props.orgTreeApi === 'function') {
|
||||
return props.orgTreeApi(param)
|
||||
} else {
|
||||
message.warning('未配置机构树API')
|
||||
return Promise.resolve([])
|
||||
}
|
||||
}
|
||||
// 获取列表的api
|
||||
const rolePage = (param) => {
|
||||
if (typeof props.rolePageApi === 'function') {
|
||||
@@ -321,10 +309,7 @@
|
||||
}
|
||||
}
|
||||
const openModal = () => {
|
||||
if (
|
||||
(typeof props.orgTreeApi !== 'function' && typeof props.orgTreeLazyApi !== 'function') ||
|
||||
typeof props.rolePageApi !== 'function'
|
||||
) {
|
||||
if (typeof props.orgTreeApi !== 'function' || typeof props.rolePageApi !== 'function') {
|
||||
message.warning('未配置角色选择器API')
|
||||
return
|
||||
}
|
||||
@@ -332,61 +317,25 @@
|
||||
// 动态计算树高度,适配不同屏幕
|
||||
treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460)
|
||||
// 获取机构树
|
||||
if (typeof props.orgTreeLazyApi === 'function') {
|
||||
props
|
||||
.orgTreeLazyApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
props
|
||||
.orgTreeApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
} else {
|
||||
orgTree()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data
|
||||
// 树中插入全局角色类型
|
||||
if (props.roleGlobal) {
|
||||
const globalRoleType = [
|
||||
{
|
||||
id: 'GLOBAL',
|
||||
parentId: '-1',
|
||||
name: '全局'
|
||||
}
|
||||
]
|
||||
treeData.value = globalRoleType.concat(data)
|
||||
}
|
||||
// 默认展开2级
|
||||
treeData.value.forEach((item) => {
|
||||
// 因为0的顶级
|
||||
if (item.parentId === '0') {
|
||||
defaultExpandedKeys.value.push(item.id)
|
||||
// 取到下级ID
|
||||
if (item.children) {
|
||||
item.children.forEach((items) => {
|
||||
defaultExpandedKeys.value.push(items.id)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
searchFormState.value.size = pageSize.value
|
||||
loadData()
|
||||
if (isEmpty(recordIds.value)) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
### 说明
|
||||
|
||||
该组件为小诺人员选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。支持同步全量树和异步懒加载树两种模式。
|
||||
该组件为小诺人员选择器,可返回id用逗号隔离的字符串或id数组类型的数据格式。使用异步懒加载树模式。
|
||||
|
||||
@author yubaoshan
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
|-----|---------------------|---------------|---------------------------------------------|--------|
|
||||
| 1 | radioModel | Boolean | 是否单选;与addShow隐藏同时可用 | false |
|
||||
| 2 | dataIsConverterFlw | Boolean | 是否为工作流格式 | false |
|
||||
| 3 | orgTreeApi | Function | 机构树接口(同步全量加载) | - |
|
||||
| 4 | orgTreeLazyApi | Function | 机构树懒加载接口(配置后优先使用异步模式,不配则走同步全量) | - |
|
||||
| 5 | userPageApi | Function | 用户分页接口 | - |
|
||||
| 6 | userListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 7 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 8 | dataType | String | 数据类型array或string | string |
|
||||
| 9 | userShow | Boolean | 是否显示已选择用户(非表单内、单纯的选择用户需要隐藏) | true |
|
||||
| 10 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
| 3 | orgTreeApi | Function | 机构树懒加载接口 | - |
|
||||
| 4 | userPageApi | Function | 用户分页接口 | - |
|
||||
| 5 | userListByIdListApi | Function | 通过id数组查询list数据接口 | 已配置 |
|
||||
| 6 | value | Object或String | 通过v-model:value绑定数据 | - |
|
||||
| 7 | dataType | String | 数据类型array或string | string |
|
||||
| 8 | userShow | Boolean | 是否显示已选择用户(非表单内、单纯的选择用户需要隐藏) | true |
|
||||
| 9 | addShow | Boolean | 是否默认的增加人员按钮,与radioModel为或的关系 | true |
|
||||
|
||||
### emits定义
|
||||
|
||||
|
||||
@@ -213,9 +213,6 @@
|
||||
orgTreeApi: {
|
||||
type: Function
|
||||
},
|
||||
orgTreeLazyApi: {
|
||||
type: Function
|
||||
},
|
||||
userPageApi: {
|
||||
type: Function
|
||||
},
|
||||
@@ -290,12 +287,12 @@
|
||||
// 懒加载子节点
|
||||
const onLoadData = (treeNode) => {
|
||||
return new Promise((resolve) => {
|
||||
if (typeof props.orgTreeLazyApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
if (typeof props.orgTreeApi !== 'function' || treeNode.dataRef.children || treeNode.dataRef.isLeaf) {
|
||||
resolve()
|
||||
return
|
||||
}
|
||||
props
|
||||
.orgTreeLazyApi({
|
||||
.orgTreeApi({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -321,51 +318,25 @@
|
||||
// 动态计算树高度,适配不同屏幕
|
||||
treeHeight.value = Math.min(Math.max(window.innerHeight - 350, 250), 460)
|
||||
// 获取机构树
|
||||
if (typeof props.orgTreeLazyApi === 'function') {
|
||||
props
|
||||
.orgTreeLazyApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
props
|
||||
.orgTreeApi()
|
||||
.then((data) => {
|
||||
if (!isEmpty(data)) {
|
||||
treeData.value = data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
defaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
} else {
|
||||
props
|
||||
.orgTreeApi()
|
||||
.then((data) => {
|
||||
if (data !== null) {
|
||||
treeData.value = data
|
||||
// 默认展开2级
|
||||
treeData.value.forEach((item) => {
|
||||
// 因为0的顶级
|
||||
if (item.parentId === '0') {
|
||||
defaultExpandedKeys.value.push(item.id)
|
||||
// 取到下级ID
|
||||
if (item.children) {
|
||||
item.children.forEach((items) => {
|
||||
defaultExpandedKeys.value.push(items.id)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
cardLoading.value = false
|
||||
})
|
||||
searchFormState.value.size = pageSize.value
|
||||
loadData()
|
||||
if (isEmpty(recordIds.value)) {
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
<xn-user-selector
|
||||
ref="userSelectorRef"
|
||||
:org-tree-api="selectorApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectorApiFunction.orgTreeLazyApi"
|
||||
:user-page-api="selectorApiFunction.userPageApi"
|
||||
data-type="object"
|
||||
:user-show="false"
|
||||
@@ -185,12 +184,7 @@
|
||||
// 传递设计器需要的API
|
||||
const selectorApiFunction = {
|
||||
orgTreeApi: (param) => {
|
||||
return bizGroupApi.groupOrgTreeLazySelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
orgTreeLazyApi: (param) => {
|
||||
return bizGroupApi.groupOrgTreeLazySelector(param).then((data) => {
|
||||
return bizGroupApi.groupOrgTreeSelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
v-model:treeExpandedKeys="treeDefaultExpandedKeys"
|
||||
:field-names="treeFieldNames"
|
||||
tree-line
|
||||
:load-data="isEditMode ? undefined : onLoadData"
|
||||
:load-data="isFullTree ? undefined : onLoadData"
|
||||
/>
|
||||
</a-spin>
|
||||
</a-form-item>
|
||||
@@ -40,7 +40,6 @@
|
||||
<a-form-item label="指定主管:" name="directorId">
|
||||
<xn-user-selector
|
||||
:org-tree-api="selectorApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectorApiFunction.orgTreeLazyApi"
|
||||
:user-page-api="selectorApiFunction.userPageApi"
|
||||
:radio-model="true"
|
||||
v-model:value="formData.directorId"
|
||||
@@ -72,8 +71,8 @@
|
||||
const treeLoading = ref(false)
|
||||
const treeDefaultExpandedKeys = ref([])
|
||||
const treeFieldNames = { children: 'children', label: 'name', value: 'id' }
|
||||
// 是否为编辑模式(编辑时加载全量树,新增时懒加载)
|
||||
const isEditMode = ref(false)
|
||||
// 是否加载了全量树(有parentId时加载全量树以便展开到选中节点,否则懒加载)
|
||||
const isFullTree = ref(false)
|
||||
// 在全量树中查找目标节点的所有祖先ID(用于展开树到选中节点)
|
||||
const collectAncestorKeys = (nodes, targetId, path = []) => {
|
||||
if (!nodes) return null
|
||||
@@ -99,10 +98,46 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// 加载全量树(用于需要展开到指定节点的场景)
|
||||
const loadFullTree = () => {
|
||||
return bizOrgApi.orgTreeSelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res,
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 加载懒加载树(无需展开到指定节点时使用)
|
||||
const loadLazyTree = () => {
|
||||
return bizOrgApi.orgTreeSelector().then((res) => {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
}),
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
})
|
||||
}
|
||||
// 打开抽屉
|
||||
const onOpen = (record, parentId) => {
|
||||
visible.value = true
|
||||
isEditMode.value = !!record
|
||||
formData.value = {
|
||||
sortCode: 99
|
||||
}
|
||||
@@ -110,23 +145,11 @@
|
||||
formData.value.parentId = parentId
|
||||
}
|
||||
nextTick(() => {
|
||||
if (isEditMode.value) {
|
||||
// 编辑模式:加载全量树 + 详情,等都完成后展开到选中节点
|
||||
if (record) {
|
||||
// 编辑模式:加载全量树 + 详情,展开到选中节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
const treePromise = bizOrgApi.orgTreeLazySelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res,
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
}
|
||||
})
|
||||
const treePromise = loadFullTree()
|
||||
const detailPromise = bizOrgApi.orgDetail({ id: record.id }).then((data) => {
|
||||
formData.value = Object.assign({}, data)
|
||||
return data
|
||||
@@ -138,25 +161,21 @@
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else if (parentId) {
|
||||
// 新增模式且有parentId:加载全量树,展开到parentId节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
loadFullTree()
|
||||
.then(() => {
|
||||
expandToSelectedOrgs()
|
||||
})
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else {
|
||||
// 新增模式:懒加载树
|
||||
bizOrgApi.orgTreeLazySelector().then((res) => {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
}),
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
})
|
||||
// 新增模式无parentId:懒加载树
|
||||
isFullTree.value = false
|
||||
loadLazyTree()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -168,7 +187,7 @@
|
||||
return
|
||||
}
|
||||
bizOrgApi
|
||||
.orgTreeLazySelector({
|
||||
.orgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -219,12 +238,7 @@
|
||||
// 传递设计器需要的API
|
||||
const selectorApiFunction = {
|
||||
orgTreeApi: (param) => {
|
||||
return bizOrgApi.orgTreeLazySelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
orgTreeLazyApi: (param) => {
|
||||
return bizOrgApi.orgTreeLazySelector(param).then((data) => {
|
||||
return bizOrgApi.orgTreeSelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
treeLoading.value = true
|
||||
searchMode.value = true
|
||||
bizOrgApi
|
||||
.orgTreeLazy({ searchKey: value.trim() })
|
||||
.orgTree({ searchKey: value.trim() })
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
@@ -259,7 +259,7 @@
|
||||
const loadTreeData = () => {
|
||||
treeLoading.value = true
|
||||
bizOrgApi
|
||||
.orgTreeLazy()
|
||||
.orgTree()
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
@@ -286,7 +286,7 @@
|
||||
treeLoading.value = true
|
||||
treeData.value = []
|
||||
bizOrgApi
|
||||
.orgTreeLazy({ searchKey: '' })
|
||||
.orgTree({ searchKey: '' })
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
@@ -304,7 +304,7 @@
|
||||
return
|
||||
}
|
||||
bizOrgApi
|
||||
.orgTreeLazy({
|
||||
.orgTree({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
// 编辑模式:加载全量树,等完成后展开到选中节点
|
||||
treeLoading.value = true
|
||||
bizPositionApi
|
||||
.positionOrgTreeLazySelector({ searchKey: '' })
|
||||
.positionOrgTreeSelector({ searchKey: '' })
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
@@ -125,7 +125,7 @@
|
||||
})
|
||||
} else {
|
||||
// 新增模式:懒加载树
|
||||
bizPositionApi.positionOrgTreeLazySelector().then((res) => {
|
||||
bizPositionApi.positionOrgTreeSelector().then((res) => {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
@@ -148,7 +148,7 @@
|
||||
return
|
||||
}
|
||||
bizPositionApi
|
||||
.positionOrgTreeLazySelector({
|
||||
.positionOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
const loadTreeData = () => {
|
||||
treeLoading.value = true
|
||||
bizOrgApi
|
||||
.orgTreeLazy()
|
||||
.orgTree()
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
@@ -278,7 +278,7 @@
|
||||
return
|
||||
}
|
||||
bizOrgApi
|
||||
.orgTreeLazy({ parentId: treeNode.dataRef.id })
|
||||
.orgTree({ parentId: treeNode.dataRef.id })
|
||||
.then((res) => {
|
||||
treeNode.dataRef.children = res.map((item) => {
|
||||
return {
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
:tree-data="treeData"
|
||||
v-model:treeExpandedKeys="treeDefaultExpandedKeys"
|
||||
:field-names="treeFieldNames"
|
||||
:load-data="isEditMode ? undefined : onLoadData"
|
||||
:load-data="isFullTree ? undefined : onLoadData"
|
||||
@change="selePositionData(formData.orgId, 0)"
|
||||
/>
|
||||
</a-spin>
|
||||
@@ -139,7 +139,7 @@
|
||||
:tree-data="treeData"
|
||||
v-model:treeExpandedKeys="childTreeExpandedKeys[index]"
|
||||
:field-names="treeFieldNames"
|
||||
:load-data="isEditMode ? undefined : onLoadData"
|
||||
:load-data="isFullTree ? undefined : onLoadData"
|
||||
@change="childOrgSelect(positionInfo, 0, index)"
|
||||
/>
|
||||
</a-spin>
|
||||
@@ -333,12 +333,40 @@
|
||||
const formData = ref({})
|
||||
const treeFieldNames = { children: 'children', label: 'name', key: 'id', value: 'id' }
|
||||
|
||||
// 是否为编辑模式(编辑时加载全量树,新增时懒加载)
|
||||
const isEditMode = ref(false)
|
||||
// 是否加载了全量树(有orgId时加载全量树以便展开到选中节点,否则懒加载)
|
||||
const isFullTree = ref(false)
|
||||
// 加载全量树(用于需要展开到指定节点的场景)
|
||||
const loadFullTree = () => {
|
||||
return bizUserApi.userOrgTreeSelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 加载懒加载树(无需展开到指定节点时使用)
|
||||
const loadLazyTree = () => {
|
||||
return bizUserApi.userOrgTreeSelector().then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 打开抽屉
|
||||
const onOpen = (record, orgId) => {
|
||||
visible.value = true
|
||||
isEditMode.value = !!record
|
||||
formData.value = {
|
||||
gender: '男',
|
||||
positionJson: []
|
||||
@@ -351,18 +379,11 @@
|
||||
})
|
||||
}
|
||||
nextTick(() => {
|
||||
if (isEditMode.value) {
|
||||
// 编辑模式:加载全量树 + 详情,等都完成后展开到选中节点
|
||||
if (record) {
|
||||
// 编辑模式:加载全量树 + 详情,展开到选中节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
const treePromise = bizUserApi.userOrgTreeLazySelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
const treePromise = loadFullTree()
|
||||
const detailPromise = convertFormData(record)
|
||||
Promise.all([treePromise, detailPromise])
|
||||
.then(() => {
|
||||
@@ -371,22 +392,21 @@
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else if (orgId) {
|
||||
// 新增模式且有orgId:加载全量树,展开到orgId节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
loadFullTree()
|
||||
.then(() => {
|
||||
expandToSelectedOrgs()
|
||||
})
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else {
|
||||
// 新增模式:懒加载树
|
||||
bizUserApi.userOrgTreeLazySelector().then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
// 新增模式无orgId:懒加载树
|
||||
isFullTree.value = false
|
||||
loadLazyTree()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -398,7 +418,7 @@
|
||||
return
|
||||
}
|
||||
bizUserApi
|
||||
.userOrgTreeLazySelector({
|
||||
.userOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
<Form ref="formRef" @successful="tableRef.refresh()" />
|
||||
<xn-role-selector
|
||||
ref="RoleSelectorPlusRef"
|
||||
:org-tree-lazy-api="selectorApiFunction.orgTreeLazyApi"
|
||||
:org-tree-api="selectorApiFunction.orgTreeApi"
|
||||
:role-page-api="selectorApiFunction.rolePageApi"
|
||||
:add-show="false"
|
||||
:role-global="true"
|
||||
@@ -322,7 +322,7 @@
|
||||
const loadTreeData = () => {
|
||||
treeLoading.value = true
|
||||
bizOrgApi
|
||||
.orgTreeLazy()
|
||||
.orgTree()
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
@@ -352,7 +352,7 @@
|
||||
return
|
||||
}
|
||||
bizOrgApi
|
||||
.orgTreeLazy({ parentId: treeNode.dataRef.id })
|
||||
.orgTree({ parentId: treeNode.dataRef.id })
|
||||
.then((res) => {
|
||||
treeNode.dataRef.children = res.map((item) => {
|
||||
return {
|
||||
@@ -501,8 +501,8 @@
|
||||
}
|
||||
// 传递设计器需要的API
|
||||
const selectorApiFunction = {
|
||||
orgTreeLazyApi: (param) => {
|
||||
return bizUserApi.userOrgTreeLazySelector(param).then((orgTree) => {
|
||||
orgTreeApi: (param) => {
|
||||
return bizUserApi.userOrgTreeSelector(param).then((orgTree) => {
|
||||
return Promise.resolve(orgTree)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
>
|
||||
<xn-org-selector
|
||||
:org-tree-api="selectApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectApiFunction.orgTreeLazyApi"
|
||||
:org-page-api="selectApiFunction.orgPageApi"
|
||||
:radio-model="true"
|
||||
dataType="string"
|
||||
@@ -71,7 +70,6 @@
|
||||
>
|
||||
<xn-position-selector
|
||||
:org-tree-api="selectApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectApiFunction.orgTreeLazyApi"
|
||||
:position-page-api="selectApiFunction.positionPageApi"
|
||||
:radio-model="true"
|
||||
dataType="string"
|
||||
@@ -87,7 +85,6 @@
|
||||
>
|
||||
<xn-role-selector
|
||||
:org-tree-api="selectApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectApiFunction.orgTreeLazyApi"
|
||||
:role-page-api="selectApiFunction.rolePageApi"
|
||||
:radio-model="true"
|
||||
dataType="string"
|
||||
@@ -142,13 +139,8 @@
|
||||
}
|
||||
// 传递选择组件需要的API
|
||||
const selectApiFunction = {
|
||||
orgTreeApi: () => {
|
||||
return configApi.configOrgTree().then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
orgTreeLazyApi: (param) => {
|
||||
return configApi.configOrgTreeLazy(param).then((data) => {
|
||||
orgTreeApi: (param) => {
|
||||
return configApi.configOrgTreeSelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
<xn-user-selector
|
||||
ref="userSelectorRef"
|
||||
:org-tree-api="selectorApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectorApiFunction.orgTreeLazyApi"
|
||||
:user-page-api="selectorApiFunction.userPageApi"
|
||||
data-type="object"
|
||||
:user-show="false"
|
||||
@@ -184,12 +183,7 @@
|
||||
// 传递设计器需要的API
|
||||
const selectorApiFunction = {
|
||||
orgTreeApi: (param) => {
|
||||
return sysGroupApi.groupOrgTreeLazySelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
orgTreeLazyApi: (param) => {
|
||||
return sysGroupApi.groupOrgTreeLazySelector(param).then((data) => {
|
||||
return sysGroupApi.groupOrgTreeSelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
v-model:treeExpandedKeys="treeDefaultExpandedKeys"
|
||||
:field-names="treeFieldNames"
|
||||
tree-line
|
||||
:load-data="isEditMode ? undefined : onLoadData"
|
||||
:load-data="isFullTree ? undefined : onLoadData"
|
||||
/>
|
||||
</a-spin>
|
||||
</a-form-item>
|
||||
@@ -40,7 +40,6 @@
|
||||
<a-form-item label="指定主管:" name="directorId">
|
||||
<xn-user-selector
|
||||
:org-tree-api="selectorApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectorApiFunction.orgTreeLazyApi"
|
||||
:user-page-api="selectorApiFunction.userPageApi"
|
||||
:radio-model="true"
|
||||
v-model:value="formData.directorId"
|
||||
@@ -72,8 +71,8 @@
|
||||
const treeLoading = ref(false)
|
||||
const treeDefaultExpandedKeys = ref([])
|
||||
const treeFieldNames = { children: 'children', label: 'name', value: 'id' }
|
||||
// 是否为编辑模式(编辑时加载全量树,新增时懒加载)
|
||||
const isEditMode = ref(false)
|
||||
// 是否加载了全量树(有parentId时加载全量树以便展开到选中节点,否则懒加载)
|
||||
const isFullTree = ref(false)
|
||||
// 在全量树中查找目标节点的所有祖先ID(用于展开树到选中节点)
|
||||
const collectAncestorKeys = (nodes, targetId, path = []) => {
|
||||
if (!nodes) return null
|
||||
@@ -99,10 +98,46 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// 加载全量树(用于需要展开到指定节点的场景)
|
||||
const loadFullTree = () => {
|
||||
return orgApi.orgOrgTreeSelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res,
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 加载懒加载树(无需展开到指定节点时使用)
|
||||
const loadLazyTree = () => {
|
||||
return orgApi.orgOrgTreeSelector().then((res) => {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
}),
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
})
|
||||
}
|
||||
// 打开抽屉
|
||||
const onOpen = (record, parentId) => {
|
||||
visible.value = true
|
||||
isEditMode.value = !!record
|
||||
formData.value = {
|
||||
sortCode: 99
|
||||
}
|
||||
@@ -110,23 +145,11 @@
|
||||
formData.value.parentId = parentId
|
||||
}
|
||||
nextTick(() => {
|
||||
if (isEditMode.value) {
|
||||
// 编辑模式:加载全量树 + 详情,等都完成后展开到选中节点
|
||||
if (record) {
|
||||
// 编辑模式:加载全量树 + 详情,展开到选中节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
const treePromise = orgApi.orgOrgTreeLazySelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res,
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
}
|
||||
})
|
||||
const treePromise = loadFullTree()
|
||||
const detailPromise = orgApi.orgDetail({ id: record.id }).then((data) => {
|
||||
formData.value = Object.assign({}, data)
|
||||
return data
|
||||
@@ -138,25 +161,21 @@
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else if (parentId) {
|
||||
// 新增模式且有parentId:加载全量树,展开到parentId节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
loadFullTree()
|
||||
.then(() => {
|
||||
expandToSelectedOrgs()
|
||||
})
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else {
|
||||
// 新增模式:懒加载树
|
||||
orgApi.orgOrgTreeLazySelector().then((res) => {
|
||||
treeData.value = [
|
||||
{
|
||||
id: '0',
|
||||
parentId: '-1',
|
||||
name: '顶级',
|
||||
children: res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
}),
|
||||
isLeaf: false
|
||||
}
|
||||
]
|
||||
treeDefaultExpandedKeys.value.push('0')
|
||||
})
|
||||
// 新增模式无parentId:懒加载树
|
||||
isFullTree.value = false
|
||||
loadLazyTree()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -168,7 +187,7 @@
|
||||
return
|
||||
}
|
||||
orgApi
|
||||
.orgOrgTreeLazySelector({
|
||||
.orgOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -219,12 +238,7 @@
|
||||
// 传递设计器需要的API
|
||||
const selectorApiFunction = {
|
||||
orgTreeApi: (param) => {
|
||||
return orgApi.orgOrgTreeLazySelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
orgTreeLazyApi: (param) => {
|
||||
return orgApi.orgOrgTreeLazySelector(param).then((data) => {
|
||||
return orgApi.orgOrgTreeSelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
treeLoading.value = true
|
||||
searchMode.value = true
|
||||
orgApi
|
||||
.orgTreeLazy({ searchKey: value.trim() })
|
||||
.orgTree({ searchKey: value.trim() })
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
@@ -258,7 +258,7 @@
|
||||
const loadTreeData = () => {
|
||||
treeLoading.value = true
|
||||
orgApi
|
||||
.orgTreeLazy()
|
||||
.orgTree()
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
@@ -285,7 +285,7 @@
|
||||
treeLoading.value = true
|
||||
treeData.value = []
|
||||
orgApi
|
||||
.orgTreeLazy({ searchKey: '' })
|
||||
.orgTree({ searchKey: '' })
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
@@ -303,7 +303,7 @@
|
||||
return
|
||||
}
|
||||
orgApi
|
||||
.orgTreeLazy({
|
||||
.orgTree({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
// 编辑模式:加载全量树,等完成后展开到选中节点
|
||||
treeLoading.value = true
|
||||
positionApi
|
||||
.positionOrgTreeLazySelector({ searchKey: '' })
|
||||
.positionOrgTreeSelector({ searchKey: '' })
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
@@ -124,7 +124,7 @@
|
||||
})
|
||||
} else {
|
||||
// 新增模式:懒加载树
|
||||
positionApi.positionOrgTreeLazySelector().then((res) => {
|
||||
positionApi.positionOrgTreeSelector().then((res) => {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
@@ -147,7 +147,7 @@
|
||||
return
|
||||
}
|
||||
positionApi
|
||||
.positionOrgTreeLazySelector({
|
||||
.positionOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
const loadTreeData = () => {
|
||||
treeLoading.value = true
|
||||
orgApi
|
||||
.orgTreeLazy()
|
||||
.orgTree()
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
@@ -275,7 +275,7 @@
|
||||
return
|
||||
}
|
||||
orgApi
|
||||
.orgTreeLazy({
|
||||
.orgTree({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
// 编辑模式:加载全量树,等完成后展开到选中节点
|
||||
treeLoading.value = true
|
||||
roleApi
|
||||
.roleOrgTreeLazySelector({ searchKey: '' })
|
||||
.roleOrgTreeSelector({ searchKey: '' })
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
@@ -133,7 +133,7 @@
|
||||
})
|
||||
} else {
|
||||
// 新增模式:懒加载树
|
||||
roleApi.roleOrgTreeLazySelector().then((res) => {
|
||||
roleApi.roleOrgTreeSelector().then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
@@ -158,7 +158,7 @@
|
||||
return
|
||||
}
|
||||
roleApi
|
||||
.roleOrgTreeLazySelector({
|
||||
.roleOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -144,7 +144,6 @@
|
||||
<xn-user-selector
|
||||
ref="userSelectorPlusRef"
|
||||
:org-tree-api="selectorApiFunction.orgTreeApi"
|
||||
:org-tree-lazy-api="selectorApiFunction.orgTreeLazyApi"
|
||||
:user-page-api="selectorApiFunction.userPageApi"
|
||||
data-type="object"
|
||||
:user-show="false"
|
||||
@@ -295,7 +294,7 @@
|
||||
const loadTreeData = () => {
|
||||
treeLoading.value = true
|
||||
orgApi
|
||||
.orgTreeLazy()
|
||||
.orgTree()
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
// 树中插入全局角色类型
|
||||
@@ -336,7 +335,7 @@
|
||||
return
|
||||
}
|
||||
orgApi
|
||||
.orgTreeLazy({ parentId: treeNode.dataRef.id })
|
||||
.orgTree({ parentId: treeNode.dataRef.id })
|
||||
.then((res) => {
|
||||
treeNode.dataRef.children = res.map((item) => {
|
||||
return {
|
||||
@@ -419,12 +418,7 @@
|
||||
// 传递设计器需要的API
|
||||
const selectorApiFunction = {
|
||||
orgTreeApi: (param) => {
|
||||
return orgApi.orgOrgTreeLazySelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
orgTreeLazyApi: (param) => {
|
||||
return orgApi.orgOrgTreeLazySelector(param).then((data) => {
|
||||
return orgApi.orgOrgTreeSelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
visible.value = true
|
||||
resultDataModel.dataScopeId = id
|
||||
// const treeData = data.data;
|
||||
roleApi.roleOrgTreeLazySelector().then((res) => {
|
||||
roleApi.roleOrgTreeSelector().then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
@@ -94,7 +94,7 @@
|
||||
return
|
||||
}
|
||||
roleApi
|
||||
.roleOrgTreeLazySelector({
|
||||
.roleOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
:tree-data="treeData"
|
||||
v-model:treeExpandedKeys="treeDefaultExpandedKeys"
|
||||
:field-names="treeFieldNames"
|
||||
:load-data="isEditMode ? undefined : onLoadData"
|
||||
:load-data="isFullTree ? undefined : onLoadData"
|
||||
@change="selePositionData(formData.orgId, 0)"
|
||||
/>
|
||||
</a-spin>
|
||||
@@ -139,7 +139,7 @@
|
||||
:tree-data="treeData"
|
||||
v-model:treeExpandedKeys="childTreeExpandedKeys[index]"
|
||||
:field-names="treeFieldNames"
|
||||
:load-data="isEditMode ? undefined : onLoadData"
|
||||
:load-data="isFullTree ? undefined : onLoadData"
|
||||
@change="childOrgSelect(positionInfo, 0, index)"
|
||||
/>
|
||||
</a-spin>
|
||||
@@ -333,12 +333,40 @@
|
||||
const formData = ref({})
|
||||
const treeFieldNames = { children: 'children', label: 'name', key: 'id', value: 'id' }
|
||||
|
||||
// 是否为编辑模式(编辑时加载全量树,新增时懒加载)
|
||||
const isEditMode = ref(false)
|
||||
// 是否加载了全量树(有orgId时加载全量树以便展开到选中节点,否则懒加载)
|
||||
const isFullTree = ref(false)
|
||||
// 加载全量树(用于需要展开到指定节点的场景)
|
||||
const loadFullTree = () => {
|
||||
return userApi.userOrgTreeSelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 加载懒加载树(无需展开到指定节点时使用)
|
||||
const loadLazyTree = () => {
|
||||
return userApi.userOrgTreeSelector().then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 打开抽屉
|
||||
const onOpen = (record, orgId) => {
|
||||
visible.value = true
|
||||
isEditMode.value = !!record
|
||||
formData.value = {
|
||||
gender: '男',
|
||||
positionJson: []
|
||||
@@ -351,18 +379,11 @@
|
||||
})
|
||||
}
|
||||
nextTick(() => {
|
||||
if (isEditMode.value) {
|
||||
// 编辑模式:加载全量树 + 详情,等都完成后展开到选中节点
|
||||
if (record) {
|
||||
// 编辑模式:加载全量树 + 详情,展开到选中节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
const treePromise = userApi.userOrgTreeLazySelector({ searchKey: '' }).then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
const treePromise = loadFullTree()
|
||||
const detailPromise = convertFormData(record)
|
||||
Promise.all([treePromise, detailPromise])
|
||||
.then(() => {
|
||||
@@ -371,22 +392,21 @@
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else if (orgId) {
|
||||
// 新增模式且有orgId:加载全量树,展开到orgId节点
|
||||
isFullTree.value = true
|
||||
treeLoading.value = true
|
||||
loadFullTree()
|
||||
.then(() => {
|
||||
expandToSelectedOrgs()
|
||||
})
|
||||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
} else {
|
||||
// 新增模式:懒加载树
|
||||
userApi.userOrgTreeLazySelector().then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
isLeaf: item.isLeaf === undefined ? false : item.isLeaf
|
||||
}
|
||||
})
|
||||
// 只有一个根节点时才自动展开
|
||||
if (treeData.value.length === 1) {
|
||||
treeDefaultExpandedKeys.value.push(treeData.value[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
// 新增模式无orgId:懒加载树
|
||||
isFullTree.value = false
|
||||
loadLazyTree()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -398,7 +418,7 @@
|
||||
return
|
||||
}
|
||||
userApi
|
||||
.userOrgTreeLazySelector({
|
||||
.userOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
<Form ref="formRef" @successful="tableRef.refresh()" />
|
||||
<xn-role-selector
|
||||
ref="RoleSelectorPlusRef"
|
||||
:org-tree-lazy-api="selectorApiFunction.orgTreeLazyApi"
|
||||
:org-tree-api="selectorApiFunction.orgTreeApi"
|
||||
:role-page-api="selectorApiFunction.rolePageApi"
|
||||
:add-show="false"
|
||||
:show="false"
|
||||
@@ -339,7 +339,7 @@
|
||||
const loadTreeData = () => {
|
||||
treeLoading.value = true
|
||||
orgApi
|
||||
.orgTreeLazy()
|
||||
.orgTree()
|
||||
.then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
@@ -369,7 +369,7 @@
|
||||
return
|
||||
}
|
||||
orgApi
|
||||
.orgTreeLazy({
|
||||
.orgTree({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
@@ -522,8 +522,8 @@
|
||||
}
|
||||
// 传递设计器需要的API
|
||||
const selectorApiFunction = {
|
||||
orgTreeLazyApi: (param) => {
|
||||
return userApi.userOrgTreeLazySelector(param).then((data) => {
|
||||
orgTreeApi: (param) => {
|
||||
return userApi.userOrgTreeSelector(param).then((data) => {
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
visible.value = true
|
||||
resultDataModel.dataScopeId = id
|
||||
// const treeData = data.data;
|
||||
userApi.userOrgTreeLazySelector().then((res) => {
|
||||
userApi.userOrgTreeSelector().then((res) => {
|
||||
if (res !== null) {
|
||||
treeData.value = res.map((item) => {
|
||||
return {
|
||||
@@ -93,7 +93,7 @@
|
||||
return
|
||||
}
|
||||
userApi
|
||||
.userOrgTreeLazySelector({
|
||||
.userOrgTreeSelector({
|
||||
parentId: treeNode.dataRef.id
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -26,21 +26,13 @@ import java.util.List;
|
||||
**/
|
||||
public interface BizOrgApi {
|
||||
|
||||
/**
|
||||
* 获取组织树选择器
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2024/11/1 18:27:51
|
||||
**/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取组织树选择器(懒加载)
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2024/11/1 18:27:51
|
||||
**/
|
||||
List<JSONObject> orgTreeLazySelector(String parentId);
|
||||
List<JSONObject> orgTreeSelector(String parentId);
|
||||
|
||||
/**
|
||||
* 获取组织列表选择器
|
||||
|
||||
@@ -43,20 +43,12 @@ public interface SysOrgApi {
|
||||
String getSupervisorIdByOrgId(String orgId);
|
||||
|
||||
/**
|
||||
* 获取组织树
|
||||
* 获取组织树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/7/22 14:46
|
||||
**/
|
||||
List<Tree<String>> orgTree();
|
||||
|
||||
/**
|
||||
* 获取组织树(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/7/22 14:46
|
||||
**/
|
||||
List<JSONObject> orgTreeLazy(String parentId);
|
||||
List<JSONObject> orgTreeSelector(String parentId);
|
||||
|
||||
/**
|
||||
* 获取组织列表选择器
|
||||
|
||||
@@ -18,7 +18,7 @@ import cn.dev33.satoken.stp.StpInterface;
|
||||
import cn.dev33.satoken.stp.StpLogic;
|
||||
import cn.dev33.satoken.strategy.SaAnnotationStrategy;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -31,8 +31,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import vip.xiaonuo.auth.core.enums.SaClientTypeEnum;
|
||||
import vip.xiaonuo.auth.core.util.StpClientLoginUserUtil;
|
||||
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
||||
import vip.xiaonuo.common.cache.CommonCacheOperator;
|
||||
import vip.xiaonuo.common.consts.CacheConstant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -93,26 +91,24 @@ public class AuthConfigure implements WebMvcConfigurer {
|
||||
@Component
|
||||
public static class StpInterfaceImpl implements StpInterface {
|
||||
|
||||
@Resource
|
||||
private CommonCacheOperator commonCacheOperator;
|
||||
|
||||
/**
|
||||
* 返回一个账号所拥有的权限码集合
|
||||
* 返回一个账号所拥有的权限码集合,直接从TokenSession读取
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||
Object permissionListObject;
|
||||
if (SaClientTypeEnum.B.getValue().equals(loginType)) {
|
||||
permissionListObject = commonCacheOperator.get(CacheConstant.AUTH_B_PERMISSION_LIST_CACHE_KEY + loginId);
|
||||
Object loginUser = StpLoginUserUtil.getLoginUser();
|
||||
if(ObjectUtil.isEmpty(loginUser)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
return StpLoginUserUtil.getLoginUser().getPermissionCodeList();
|
||||
} else {
|
||||
permissionListObject = commonCacheOperator.get(CacheConstant.AUTH_C_PERMISSION_LIST_CACHE_KEY + loginId);
|
||||
Object clientLoginUser = StpClientLoginUserUtil.getClientLoginUser();
|
||||
if(ObjectUtil.isEmpty(clientLoginUser)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
return StpClientLoginUserUtil.getClientLoginUser().getPermissionCodeList();
|
||||
}
|
||||
// 转为字符串
|
||||
String permissionListString = permissionListObject.toString();
|
||||
// 去除首尾的方括号
|
||||
String trimmedStr = StrUtil.sub(permissionListString, 1, -1);
|
||||
// 使用逗号和空格分割字符串,并转换为列表
|
||||
return CollectionUtil.newArrayList(StrUtil.split(trimmedStr, ", "));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,6 @@ import vip.xiaonuo.auth.modular.login.result.AuthPicValidCodeResult;
|
||||
import vip.xiaonuo.auth.modular.login.service.AuthService;
|
||||
import vip.xiaonuo.client.ClientUserApi;
|
||||
import vip.xiaonuo.common.cache.CommonCacheOperator;
|
||||
import vip.xiaonuo.common.consts.CacheConstant;
|
||||
import vip.xiaonuo.common.exception.CommonException;
|
||||
import vip.xiaonuo.common.util.CommonCryptogramUtil;
|
||||
import vip.xiaonuo.common.util.CommonEmailUtil;
|
||||
@@ -59,6 +58,7 @@ import vip.xiaonuo.sys.api.SysUserApi;
|
||||
import vip.xiaonuo.auth.modular.login.prop.AuthThirdClientProperties;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -701,7 +701,7 @@ public class AuthServiceImpl implements AuthService {
|
||||
* @date 2024/7/22 22:00
|
||||
*/
|
||||
private void fillSaBaseLoginUserAndUpdateCache(SaBaseLoginUser saBaseLoginUser) {
|
||||
// 角色集合
|
||||
// 角色集合(后续查询依赖角色ID,必须先执行)
|
||||
List<JSONObject> roleList = loginUserApi.getRoleListByUserId(saBaseLoginUser.getId());
|
||||
// 角色id集合
|
||||
List<String> roleIdList = roleList.stream().map(jsonObject -> jsonObject.getStr("id")).collect(Collectors.toList());
|
||||
@@ -709,20 +709,27 @@ public class AuthServiceImpl implements AuthService {
|
||||
List<String> roleCodeList = roleList.stream().map(jsonObject -> jsonObject.getStr("code")).collect(Collectors.toList());
|
||||
// 角色id和用户id集合
|
||||
List<String> userAndRoleIdList = CollectionUtil.unionAll(roleIdList, CollectionUtil.newArrayList(saBaseLoginUser.getId()));
|
||||
// 以下三个查询互不依赖,并行执行
|
||||
CompletableFuture<List<String>> buttonCodeFuture = CompletableFuture.supplyAsync(() ->
|
||||
loginUserApi.getButtonCodeListListByUserAndRoleIdList(userAndRoleIdList));
|
||||
CompletableFuture<List<String>> mobileButtonCodeFuture = CompletableFuture.supplyAsync(() ->
|
||||
loginUserApi.getMobileButtonCodeListListByUserIdAndRoleIdList(userAndRoleIdList));
|
||||
CompletableFuture<List<SaBaseLoginUser.DataScope>> dataScopeFuture = CompletableFuture.supplyAsync(() ->
|
||||
Convert.toList(SaBaseLoginUser.DataScope.class,
|
||||
loginUserApi.getPermissionListByUserIdAndRoleIdList(userAndRoleIdList, saBaseLoginUser.getOrgId())));
|
||||
// 等待所有查询完成
|
||||
CompletableFuture.allOf(buttonCodeFuture, mobileButtonCodeFuture, dataScopeFuture).join();
|
||||
// 获取按钮码
|
||||
saBaseLoginUser.setButtonCodeList(loginUserApi.getButtonCodeListListByUserAndRoleIdList(userAndRoleIdList));
|
||||
saBaseLoginUser.setButtonCodeList(buttonCodeFuture.join());
|
||||
// 获取移动端按钮码
|
||||
saBaseLoginUser.setMobileButtonCodeList(loginUserApi.getMobileButtonCodeListListByUserIdAndRoleIdList(userAndRoleIdList));
|
||||
saBaseLoginUser.setMobileButtonCodeList(mobileButtonCodeFuture.join());
|
||||
// 获取数据范围
|
||||
saBaseLoginUser.setDataScopeList(Convert.toList(SaBaseLoginUser.DataScope.class,
|
||||
loginUserApi.getPermissionListByUserIdAndRoleIdList(userAndRoleIdList, saBaseLoginUser.getOrgId())));
|
||||
saBaseLoginUser.setDataScopeList(dataScopeFuture.join());
|
||||
// 获取权限码
|
||||
List<String> permissionCodeList = saBaseLoginUser.getDataScopeList().stream()
|
||||
.map(SaBaseLoginUser.DataScope::getApiUrl).collect(Collectors.toList());
|
||||
// 设置权限码
|
||||
saBaseLoginUser.setPermissionCodeList(permissionCodeList);
|
||||
// 权限码列表存入缓存
|
||||
commonCacheOperator.put(CacheConstant.AUTH_B_PERMISSION_LIST_CACHE_KEY + saBaseLoginUser.getId(),permissionCodeList);
|
||||
// 获取角色码
|
||||
saBaseLoginUser.setRoleCodeList(roleCodeList);
|
||||
// 缓存用户信息,此处使用TokenSession为了指定时间内无操作则自动下线
|
||||
@@ -757,7 +764,7 @@ public class AuthServiceImpl implements AuthService {
|
||||
* @date 2024/7/22 22:00
|
||||
*/
|
||||
private void fillSaBaseClientLoginUserAndUpdateCache(SaBaseClientLoginUser saBaseClientLoginUser) {
|
||||
// 角色集合
|
||||
// 角色集合(后续查询依赖角色ID,必须先执行)
|
||||
List<JSONObject> roleList = clientLoginUserApi.getRoleListByUserId(saBaseClientLoginUser.getId());
|
||||
// 角色id集合
|
||||
List<String> roleIdList = roleList.stream().map(jsonObject -> jsonObject.getStr("id")).collect(Collectors.toList());
|
||||
@@ -765,20 +772,27 @@ public class AuthServiceImpl implements AuthService {
|
||||
List<String> roleCodeList = roleList.stream().map(jsonObject -> jsonObject.getStr("code")).collect(Collectors.toList());
|
||||
// 角色id和用户id集合
|
||||
List<String> userAndRoleIdList = CollectionUtil.unionAll(roleIdList, CollectionUtil.newArrayList(saBaseClientLoginUser.getId()));
|
||||
// 以下三个查询互不依赖,并行执行
|
||||
CompletableFuture<List<String>> buttonCodeFuture = CompletableFuture.supplyAsync(() ->
|
||||
clientLoginUserApi.getButtonCodeListListByUserAndRoleIdList(userAndRoleIdList));
|
||||
CompletableFuture<List<String>> mobileButtonCodeFuture = CompletableFuture.supplyAsync(() ->
|
||||
clientLoginUserApi.getMobileButtonCodeListListByUserIdAndRoleIdList(userAndRoleIdList));
|
||||
CompletableFuture<List<SaBaseClientLoginUser.DataScope>> dataScopeFuture = CompletableFuture.supplyAsync(() ->
|
||||
Convert.toList(SaBaseClientLoginUser.DataScope.class,
|
||||
clientLoginUserApi.getPermissionListByUserIdAndRoleIdList(userAndRoleIdList, null)));
|
||||
// 等待所有查询完成
|
||||
CompletableFuture.allOf(buttonCodeFuture, mobileButtonCodeFuture, dataScopeFuture).join();
|
||||
// 获取按钮码
|
||||
saBaseClientLoginUser.setButtonCodeList(clientLoginUserApi.getButtonCodeListListByUserAndRoleIdList(userAndRoleIdList));
|
||||
saBaseClientLoginUser.setButtonCodeList(buttonCodeFuture.join());
|
||||
// 获取移动端按钮码
|
||||
saBaseClientLoginUser.setMobileButtonCodeList(clientLoginUserApi.getMobileButtonCodeListListByUserIdAndRoleIdList(userAndRoleIdList));
|
||||
saBaseClientLoginUser.setMobileButtonCodeList(mobileButtonCodeFuture.join());
|
||||
// 获取数据范围
|
||||
saBaseClientLoginUser.setDataScopeList(Convert.toList(SaBaseClientLoginUser.DataScope.class,
|
||||
clientLoginUserApi.getPermissionListByUserIdAndRoleIdList(userAndRoleIdList, null)));
|
||||
saBaseClientLoginUser.setDataScopeList(dataScopeFuture.join());
|
||||
// 获取权限码
|
||||
List<String> permissionCodeList = saBaseClientLoginUser.getDataScopeList().stream()
|
||||
.map(SaBaseClientLoginUser.DataScope::getApiUrl).collect(Collectors.toList());
|
||||
// 设置权限码
|
||||
saBaseClientLoginUser.setPermissionCodeList(permissionCodeList);
|
||||
// 权限码列表存入缓存
|
||||
commonCacheOperator.put(CacheConstant.AUTH_C_PERMISSION_LIST_CACHE_KEY + saBaseClientLoginUser.getId(),permissionCodeList);
|
||||
// 获取角色码
|
||||
saBaseClientLoginUser.setRoleCodeList(roleCodeList);
|
||||
// 缓存用户信息,此处使用TokenSession为了指定时间内无操作则自动下线
|
||||
@@ -793,20 +807,23 @@ public class AuthServiceImpl implements AuthService {
|
||||
**/
|
||||
@Override
|
||||
public SaBaseLoginUser getLoginUser() {
|
||||
// 获取当前缓存的用户信息
|
||||
// 直接从TokenSession获取缓存的用户信息
|
||||
SaBaseLoginUser saBaseLoginUser = StpLoginUserUtil.getLoginUser();
|
||||
// 获取B端用户信息
|
||||
saBaseLoginUser = loginUserApi.getUserById(saBaseLoginUser.getId());
|
||||
// 填充B端用户信息并更新缓存
|
||||
fillSaBaseLoginUserAndUpdateCache(saBaseLoginUser);
|
||||
// 如果缓存中没有用户信息(如旧session),回退到查DB+填充缓存
|
||||
if(ObjectUtil.isEmpty(saBaseLoginUser)) {
|
||||
saBaseLoginUser = loginUserApi.getUserById(StpUtil.getLoginIdAsString());
|
||||
fillSaBaseLoginUserAndUpdateCache(saBaseLoginUser);
|
||||
}
|
||||
// 通过JSON序列化深拷贝,避免修改缓存中的对象
|
||||
SaBaseLoginUser result = JSONUtil.toBean(JSONUtil.toJsonStr(saBaseLoginUser), saBaseLoginUser.getClass());
|
||||
// 去掉密码
|
||||
saBaseLoginUser.setPassword("******");
|
||||
result.setPassword("******");
|
||||
// 去掉权限码
|
||||
saBaseLoginUser.setPermissionCodeList(CollectionUtil.newArrayList());
|
||||
result.setPermissionCodeList(CollectionUtil.newArrayList());
|
||||
// 去掉数据范围
|
||||
saBaseLoginUser.setDataScopeList(CollectionUtil.newArrayList());
|
||||
result.setDataScopeList(CollectionUtil.newArrayList());
|
||||
// 返回
|
||||
return saBaseLoginUser;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -817,20 +834,23 @@ public class AuthServiceImpl implements AuthService {
|
||||
**/
|
||||
@Override
|
||||
public SaBaseClientLoginUser getClientLoginUser() {
|
||||
// 获取当前缓存的用户信息
|
||||
// 直接从TokenSession获取缓存的用户信息
|
||||
SaBaseClientLoginUser saBaseClientLoginUser = StpClientLoginUserUtil.getClientLoginUser();
|
||||
// 获取C端用户信息
|
||||
saBaseClientLoginUser = clientLoginUserApi.getClientUserById(saBaseClientLoginUser.getId());
|
||||
// 填充C端用户信息并更新缓存
|
||||
fillSaBaseClientLoginUserAndUpdateCache(saBaseClientLoginUser);
|
||||
// 如果缓存中没有用户信息(如旧session),回退到查DB+填充缓存
|
||||
if(ObjectUtil.isEmpty(saBaseClientLoginUser)) {
|
||||
saBaseClientLoginUser = clientLoginUserApi.getClientUserById(StpClientUtil.getLoginIdAsString());
|
||||
fillSaBaseClientLoginUserAndUpdateCache(saBaseClientLoginUser);
|
||||
}
|
||||
// 通过JSON序列化深拷贝,避免修改缓存中的对象
|
||||
SaBaseClientLoginUser result = JSONUtil.toBean(JSONUtil.toJsonStr(saBaseClientLoginUser), saBaseClientLoginUser.getClass());
|
||||
// 去掉密码
|
||||
saBaseClientLoginUser.setPassword("******");
|
||||
result.setPassword("******");
|
||||
// 去掉权限码
|
||||
saBaseClientLoginUser.setPermissionCodeList(CollectionUtil.newArrayList());
|
||||
result.setPermissionCodeList(CollectionUtil.newArrayList());
|
||||
// 去掉数据范围
|
||||
saBaseClientLoginUser.setDataScopeList(CollectionUtil.newArrayList());
|
||||
result.setDataScopeList(CollectionUtil.newArrayList());
|
||||
// 返回
|
||||
return saBaseClientLoginUser;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
package vip.xiaonuo.biz.modular.group.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -29,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.biz.modular.group.entity.BizGroup;
|
||||
import vip.xiaonuo.biz.modular.group.param.*;
|
||||
import vip.xiaonuo.biz.modular.group.service.BizGroupService;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.user.entity.BizUser;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
@@ -144,8 +143,8 @@ public class BizGroupController {
|
||||
@Operation(summary = "获取组织树选择器")
|
||||
@SaCheckPermission("/biz/group/orgTreeSelector")
|
||||
@GetMapping("/biz/group/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return CommonResult.data(bizGroupService.orgTreeLazySelector(bizOrgTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return CommonResult.data(bizGroupService.orgTreeSelector(bizOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
*/
|
||||
package vip.xiaonuo.biz.modular.group.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import vip.xiaonuo.biz.modular.group.entity.BizGroup;
|
||||
import vip.xiaonuo.biz.modular.group.param.*;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.user.entity.BizUser;
|
||||
|
||||
import java.util.List;
|
||||
@@ -87,21 +86,13 @@ public interface BizGroupService extends IService<BizGroup> {
|
||||
*/
|
||||
List<String> ownUser(BizGroupIdParam sysGroupIdParam);
|
||||
|
||||
/**
|
||||
* 获取机构树选择器
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2024/12/21 01:25
|
||||
*/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取机构树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:00
|
||||
*/
|
||||
List<JSONObject> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam);
|
||||
List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取用户选择器
|
||||
|
||||
@@ -14,10 +14,6 @@ package vip.xiaonuo.biz.modular.group.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
@@ -35,7 +31,7 @@ import vip.xiaonuo.biz.modular.group.mapper.BizGroupMapper;
|
||||
import vip.xiaonuo.biz.modular.group.param.*;
|
||||
import vip.xiaonuo.biz.modular.group.service.BizGroupService;
|
||||
import vip.xiaonuo.biz.modular.org.entity.BizOrg;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.org.service.BizOrgService;
|
||||
import vip.xiaonuo.biz.modular.user.entity.BizUser;
|
||||
import vip.xiaonuo.biz.modular.user.enums.BizUserStatusEnum;
|
||||
@@ -48,8 +44,6 @@ import vip.xiaonuo.common.page.CommonPageRequest;
|
||||
import vip.xiaonuo.sys.api.SysGroupApi;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户组Service接口实现类
|
||||
@@ -134,34 +128,8 @@ public class BizGroupServiceImpl extends ServiceImpl<BizGroupMapper, BizGroup> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
// 获取所有机构
|
||||
List<BizOrg> allOrgList = bizOrgService.list();
|
||||
// 校验数据范围
|
||||
List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
|
||||
// 确定用于构建树的机构集合
|
||||
List<BizOrg> resultOrgList;
|
||||
if(loginUserDataScope != null && loginUserDataScope.isEmpty()) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
if(loginUserDataScope == null) {
|
||||
// SCOPE_ALL:使用全部机构
|
||||
resultOrgList = allOrgList;
|
||||
} else {
|
||||
Set<BizOrg> bizOrgSet = CollectionUtil.newHashSet();
|
||||
loginUserDataScope.forEach(orgId -> bizOrgSet.addAll(bizOrgService.getParentListById(allOrgList, orgId, true)));
|
||||
resultOrgList = CollectionUtil.newArrayList(bizOrgSet);
|
||||
}
|
||||
List<TreeNode<String>> treeNodeList = resultOrgList.stream().map(bizOrg ->
|
||||
new TreeNode<>(bizOrg.getId(), bizOrg.getParentId(),
|
||||
bizOrg.getName(), bizOrg.getSortCode()).setExtra(JSONUtil.parseObj(bizOrg)))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return bizOrgService.treeLazy(bizOrgTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return bizOrgService.orgTreeSelector(bizOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
package vip.xiaonuo.biz.modular.org.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xingfudeshi.knife4j.annotations.ApiOperationSupport;
|
||||
@@ -77,8 +76,8 @@ public class BizOrgController {
|
||||
@Operation(summary = "获取机构树(懒加载)")
|
||||
@SaCheckPermission("/biz/org/tree")
|
||||
@GetMapping("/biz/org/tree")
|
||||
public CommonResult<List<JSONObject>> treeLazy(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return CommonResult.data(bizOrgService.treeLazy(bizOrgTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> tree(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return CommonResult.data(bizOrgService.orgTreeSelector(bizOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,8 +171,8 @@ public class BizOrgController {
|
||||
@Operation(summary = "获取机构树选择器(懒加载)")
|
||||
@SaCheckPermission("/biz/org/orgTreeSelector")
|
||||
@GetMapping("/biz/org/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return CommonResult.data(bizOrgService.treeLazy(bizOrgTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return CommonResult.data(bizOrgService.orgTreeSelector(bizOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@ import lombok.Setter;
|
||||
**/
|
||||
@Getter
|
||||
@Setter
|
||||
public class BizOrgTreeLazyParam {
|
||||
public class BizOrgSelectorTreeParam {
|
||||
|
||||
/** 父id */
|
||||
@Schema(description = "父id")
|
||||
@@ -20,7 +20,7 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import vip.xiaonuo.biz.api.BizOrgApi;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorOrgListParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.org.service.BizOrgService;
|
||||
|
||||
import java.util.List;
|
||||
@@ -38,15 +38,10 @@ public class BizOrgApiProvider implements BizOrgApi {
|
||||
private BizOrgService bizOrgService;
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
return bizOrgService.tree();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(String parentId) {
|
||||
BizOrgTreeLazyParam bizOrgTreeLazyParam = new BizOrgTreeLazyParam();
|
||||
bizOrgTreeLazyParam.setParentId(parentId);
|
||||
return bizOrgService.treeLazy(bizOrgTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(String parentId) {
|
||||
BizOrgSelectorTreeParam bizOrgSelectorTreeParam = new BizOrgSelectorTreeParam();
|
||||
bizOrgSelectorTreeParam.setParentId(parentId);
|
||||
return bizOrgService.orgTreeSelector(bizOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
package vip.xiaonuo.biz.modular.org.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -38,22 +37,6 @@ public interface BizOrgService extends IService<BizOrg> {
|
||||
*/
|
||||
Page<BizOrg> page(BizOrgPageParam bizOrgPageParam);
|
||||
|
||||
/**
|
||||
* 获取机构树
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<Tree<String>> tree();
|
||||
|
||||
/**
|
||||
* 获取机构树(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<JSONObject> treeLazy(BizOrgTreeLazyParam bizOrgTreeLazyParam);
|
||||
|
||||
/**
|
||||
* 添加机构
|
||||
*
|
||||
@@ -158,6 +141,14 @@ public interface BizOrgService extends IService<BizOrg> {
|
||||
**/
|
||||
BizOrg getChildById(List<BizOrg> originDataList, String id);
|
||||
|
||||
/**
|
||||
* 获取机构树(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取机构列表选择器
|
||||
*
|
||||
|
||||
@@ -128,56 +128,6 @@ public class BizOrgServiceImpl extends ServiceImpl<BizOrgMapper, BizOrg> impleme
|
||||
return this.page(CommonPageRequest.defaultPage(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> tree() {
|
||||
LambdaQueryWrapper<BizOrg> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// 校验数据范围
|
||||
List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
|
||||
// 定义机构集合
|
||||
Set<BizOrg> bizOrgSet = CollectionUtil.newHashSet();
|
||||
if(loginUserDataScope != null && loginUserDataScope.isEmpty()) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
if(loginUserDataScope == null) {
|
||||
// SCOPE_ALL:不做过滤,查询全部机构
|
||||
} else {
|
||||
// 获取所有机构
|
||||
List<BizOrg> allOrgList = this.getAllOrgList();
|
||||
loginUserDataScope.forEach(orgId -> bizOrgSet.addAll(this.getParentListById(allOrgList, orgId, true)));
|
||||
List<String> loginUserDataScopeFullList = bizOrgSet.stream().map(BizOrg::getId).collect(Collectors.toList());
|
||||
CommonSqlUtil.safeIn(lambdaQueryWrapper, BizOrg::getId, loginUserDataScopeFullList);
|
||||
}
|
||||
lambdaQueryWrapper.orderByAsc(BizOrg::getSortCode);
|
||||
List<BizOrg> bizOrgList = this.list(lambdaQueryWrapper);
|
||||
List<TreeNode<String>> treeNodeList = bizOrgList.stream().map(bizOrg ->
|
||||
new TreeNode<>(bizOrg.getId(), bizOrg.getParentId(), bizOrg.getName(), bizOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> treeLazy(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
// searchKey不为null时,走全量搜索模式,返回嵌套树结构
|
||||
if (bizOrgTreeLazyParam.getSearchKey() != null) {
|
||||
return this.treeSearch(bizOrgTreeLazyParam.getSearchKey());
|
||||
}
|
||||
String parentId = ObjectUtil.isNotEmpty(bizOrgTreeLazyParam.getParentId()) ? bizOrgTreeLazyParam.getParentId() : "0";
|
||||
// 校验数据范围
|
||||
List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
|
||||
if (loginUserDataScope != null && ObjectUtil.isEmpty(loginUserDataScope)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
// loginUserDataScope == null 时为 SCOPE_ALL,不做数据范围过滤;否则取可见机构ID集合
|
||||
Set<String> visibleOrgIds = null;
|
||||
if (loginUserDataScope != null) {
|
||||
visibleOrgIds = this.getVisibleOrgIds(loginUserDataScope);
|
||||
if (ObjectUtil.isEmpty(visibleOrgIds)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
}
|
||||
return this.fetchChildrenWithLeafFlag(parentId, visibleOrgIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定父节点下的直接子机构列表,并为每个子机构设置 isLeaf 标志。
|
||||
* visibleOrgIds 为 null 时表示 SCOPE_ALL,不做数据范围过滤(与 SysOrg 行为一致);
|
||||
@@ -522,6 +472,29 @@ public class BizOrgServiceImpl extends ServiceImpl<BizOrgMapper, BizOrg> impleme
|
||||
|
||||
/* ====机构部分所需要用到的选择器==== */
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
// searchKey不为null时,走全量搜索模式,返回嵌套树结构
|
||||
if (bizOrgSelectorTreeParam.getSearchKey() != null) {
|
||||
return this.treeSearch(bizOrgSelectorTreeParam.getSearchKey());
|
||||
}
|
||||
String parentId = ObjectUtil.isNotEmpty(bizOrgSelectorTreeParam.getParentId()) ? bizOrgSelectorTreeParam.getParentId() : "0";
|
||||
// 校验数据范围
|
||||
List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
|
||||
if (loginUserDataScope != null && ObjectUtil.isEmpty(loginUserDataScope)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
// loginUserDataScope == null 时为 SCOPE_ALL,不做数据范围过滤;否则取可见机构ID集合
|
||||
Set<String> visibleOrgIds = null;
|
||||
if (loginUserDataScope != null) {
|
||||
visibleOrgIds = this.getVisibleOrgIds(loginUserDataScope);
|
||||
if (ObjectUtil.isEmpty(visibleOrgIds)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
}
|
||||
return this.fetchChildrenWithLeafFlag(parentId, visibleOrgIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<BizOrg> orgListSelector(BizOrgSelectorOrgListParam bizOrgSelectorOrgListParam) {
|
||||
QueryWrapper<BizOrg> queryWrapper = new QueryWrapper<BizOrg>().checkSqlInjection();
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
package vip.xiaonuo.biz.modular.position.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xingfudeshi.knife4j.annotations.ApiOperationSupport;
|
||||
@@ -32,7 +31,7 @@ import vip.xiaonuo.biz.modular.position.param.*;
|
||||
import vip.xiaonuo.biz.modular.position.service.BizPositionService;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@@ -141,8 +140,8 @@ public class BizPositionController {
|
||||
@Operation(summary = "获取组织树选择器(懒加载)")
|
||||
@SaCheckPermission("/biz/position/orgTreeSelector")
|
||||
@GetMapping("/biz/position/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return CommonResult.data(bizPositionService.orgTreeLazySelector(bizOrgTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return CommonResult.data(bizPositionService.orgTreeSelector(bizOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
*/
|
||||
package vip.xiaonuo.biz.modular.position.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import vip.xiaonuo.biz.modular.position.entity.BizPosition;
|
||||
import vip.xiaonuo.biz.modular.position.param.*;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -88,21 +87,13 @@ public interface BizPositionService extends IService<BizPosition> {
|
||||
|
||||
/* ====岗位部分所需要用到的选择器==== */
|
||||
|
||||
/**
|
||||
* 获取机构树选择器
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取机构树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<JSONObject> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam);
|
||||
List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取岗位选择器
|
||||
|
||||
@@ -16,9 +16,6 @@ import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -32,8 +29,7 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
||||
import vip.xiaonuo.biz.modular.org.entity.BizOrg;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.org.service.BizOrgService;
|
||||
import vip.xiaonuo.biz.modular.position.entity.BizPosition;
|
||||
import vip.xiaonuo.biz.modular.position.enums.BizPositionCategoryEnum;
|
||||
@@ -221,33 +217,8 @@ public class BizPositionServiceImpl extends ServiceImpl<BizPositionMapper, BizPo
|
||||
/* ====岗位部分所需要用到的选择器==== */
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
LambdaQueryWrapper<BizOrg> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// 校验数据范围
|
||||
List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
|
||||
// 定义机构集合
|
||||
Set<BizOrg> bizOrgSet = CollectionUtil.newHashSet();
|
||||
if(loginUserDataScope != null && loginUserDataScope.isEmpty()) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(loginUserDataScope)) {
|
||||
// 获取所有机构
|
||||
List<BizOrg> allOrgList = bizOrgService.list();
|
||||
loginUserDataScope.forEach(orgId -> bizOrgSet.addAll(bizOrgService.getParentListById(allOrgList, orgId, true)));
|
||||
List<String> loginUserDataScopeFullList = bizOrgSet.stream().map(BizOrg::getId).collect(Collectors.toList());
|
||||
CommonSqlUtil.safeIn(lambdaQueryWrapper, BizOrg::getId, loginUserDataScopeFullList);
|
||||
}
|
||||
lambdaQueryWrapper.orderByAsc(BizOrg::getSortCode);
|
||||
List<BizOrg> bizOrgList = bizOrgService.list(lambdaQueryWrapper);
|
||||
List<TreeNode<String>> treeNodeList = bizOrgList.stream().map(bizOrg ->
|
||||
new TreeNode<>(bizOrg.getId(), bizOrg.getParentId(), bizOrg.getName(), bizOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return bizOrgService.treeLazy(bizOrgTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return bizOrgService.orgTreeSelector(bizOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
package vip.xiaonuo.biz.modular.user.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xingfudeshi.knife4j.annotations.ApiOperationSupport;
|
||||
@@ -31,7 +30,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.biz.modular.org.entity.BizOrg;
|
||||
import vip.xiaonuo.biz.modular.position.entity.BizPosition;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.user.entity.BizUser;
|
||||
import vip.xiaonuo.biz.modular.user.enums.BizUserSourceFromTypeEnum;
|
||||
import vip.xiaonuo.biz.modular.user.param.*;
|
||||
@@ -256,8 +255,8 @@ public class BizUserController {
|
||||
@Operation(summary = "获取机构树选择器(懒加载)")
|
||||
@SaCheckPermission("/biz/user/orgTreeSelector")
|
||||
@GetMapping("/biz/user/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return CommonResult.data(bizUserService.orgTreeLazySelector(bizOrgTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return CommonResult.data(bizUserService.orgTreeSelector(bizOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
*/
|
||||
package vip.xiaonuo.biz.modular.user.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import vip.xiaonuo.biz.modular.org.entity.BizOrg;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.position.entity.BizPosition;
|
||||
import vip.xiaonuo.biz.modular.user.entity.BizUser;
|
||||
import vip.xiaonuo.biz.modular.user.param.*;
|
||||
@@ -141,21 +140,13 @@ public interface BizUserService extends IService<BizUser> {
|
||||
|
||||
/* ====人员部分所需要用到的选择器==== */
|
||||
|
||||
/**
|
||||
* 获取机构树选择器
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/5/13 21:00
|
||||
*/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取机构树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/5/13 21:00
|
||||
*/
|
||||
List<JSONObject> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam);
|
||||
List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取机构列表选择器
|
||||
|
||||
@@ -24,9 +24,6 @@ import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.img.ImgUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -57,7 +54,7 @@ import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
||||
import vip.xiaonuo.biz.core.enums.BizBuildInEnum;
|
||||
import vip.xiaonuo.biz.core.enums.BizDataTypeEnum;
|
||||
import vip.xiaonuo.biz.modular.org.entity.BizOrg;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgTreeLazyParam;
|
||||
import vip.xiaonuo.biz.modular.org.param.BizOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.biz.modular.org.service.BizOrgService;
|
||||
import vip.xiaonuo.biz.modular.position.entity.BizPosition;
|
||||
import vip.xiaonuo.biz.modular.position.service.BizPositionService;
|
||||
@@ -619,33 +616,8 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
|
||||
/* ====人员部分所需要用到的选择器==== */
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
LambdaQueryWrapper<BizOrg> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// 校验数据范围
|
||||
List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
|
||||
// 定义机构集合
|
||||
Set<BizOrg> bizOrgSet = CollectionUtil.newHashSet();
|
||||
if(loginUserDataScope != null && loginUserDataScope.isEmpty()) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(loginUserDataScope)) {
|
||||
// 获取所有机构
|
||||
List<BizOrg> allOrgList = bizOrgService.list();
|
||||
loginUserDataScope.forEach(orgId -> bizOrgSet.addAll(bizOrgService.getParentListById(allOrgList, orgId, true)));
|
||||
List<String> loginUserDataScopeFullList = bizOrgSet.stream().map(BizOrg::getId).collect(Collectors.toList());
|
||||
CommonSqlUtil.safeIn(lambdaQueryWrapper, BizOrg::getId, loginUserDataScopeFullList);
|
||||
}
|
||||
lambdaQueryWrapper.orderByAsc(BizOrg::getSortCode);
|
||||
List<BizOrg> bizOrgList = bizOrgService.list(lambdaQueryWrapper);
|
||||
List<TreeNode<String>> treeNodeList = bizOrgList.stream().map(bizOrg ->
|
||||
new TreeNode<>(bizOrg.getId(), bizOrg.getParentId(), bizOrg.getName(), bizOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(BizOrgTreeLazyParam bizOrgTreeLazyParam) {
|
||||
return bizOrgService.treeLazy(bizOrgTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(BizOrgSelectorTreeParam bizOrgSelectorTreeParam) {
|
||||
return bizOrgService.orgTreeSelector(bizOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
package vip.xiaonuo.dev.modular.config.controller;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xingfudeshi.knife4j.annotations.ApiOperationSupport;
|
||||
@@ -190,27 +189,15 @@ public class DevConfigController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构选树
|
||||
* 获取组织树选择器(懒加载)
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2025/4/23 20:00
|
||||
*/
|
||||
@Operation(summary = "获取机构选树")
|
||||
@GetMapping("/dev/config/orgTree")
|
||||
public CommonResult<List<Tree<String>>> orgTree() {
|
||||
return CommonResult.data(sysOrgApi.orgTree());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构选树(懒加载)
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2025/4/23 20:00
|
||||
*/
|
||||
@Operation(summary = "获取机构选树(懒加载)")
|
||||
@GetMapping("/dev/config/orgTreeLazy")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazy(String parentId) {
|
||||
return CommonResult.data(sysOrgApi.orgTreeLazy(parentId));
|
||||
@Operation(summary = "获取组织树选择器(懒加载)")
|
||||
@GetMapping("/dev/config/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(DevConfigSelectorOrgTreeParam devConfigSelectorOrgTreeParam) {
|
||||
return CommonResult.data(sysOrgApi.orgTreeSelector(devConfigSelectorOrgTreeParam.getParentId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@ import lombok.Setter;
|
||||
**/
|
||||
@Getter
|
||||
@Setter
|
||||
public class DevConfigSelectorOrgTreeLazyParam {
|
||||
public class DevConfigSelectorOrgTreeParam {
|
||||
|
||||
/** 父id */
|
||||
@Schema(description = "父id")
|
||||
@@ -36,7 +36,6 @@ import vip.xiaonuo.dev.modular.config.mapper.DevConfigMapper;
|
||||
import vip.xiaonuo.dev.modular.config.param.*;
|
||||
import vip.xiaonuo.dev.modular.config.service.DevConfigService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package vip.xiaonuo.dev.modular.message.websocket;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import jakarta.annotation.PreDestroy;
|
||||
import jakarta.websocket.*;
|
||||
|
||||
@@ -22,7 +22,6 @@ import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sms4j.aliyun.config.AlibabaConfig;
|
||||
import org.dromara.sms4j.api.SmsBlend;
|
||||
import org.dromara.sms4j.api.dao.SmsDaoDefaultImpl;
|
||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||
import org.dromara.sms4j.javase.config.SEInitializer;
|
||||
|
||||
@@ -29,7 +29,7 @@ import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.sys.modular.group.entity.SysGroup;
|
||||
import vip.xiaonuo.sys.modular.group.param.*;
|
||||
import vip.xiaonuo.sys.modular.group.service.SysGroupService;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.user.entity.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
@@ -135,8 +135,8 @@ public class SysGroupController {
|
||||
*/
|
||||
@Operation(summary = "获取组织树选择器")
|
||||
@GetMapping("/sys/group/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return CommonResult.data(sysGroupService.orgTreeLazySelector(sysOrgSelectorTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return CommonResult.data(sysGroupService.orgTreeSelector(sysOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
*/
|
||||
package vip.xiaonuo.sys.modular.group.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import vip.xiaonuo.sys.modular.group.entity.SysGroup;
|
||||
import vip.xiaonuo.sys.modular.group.param.*;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.user.entity.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
@@ -87,21 +86,13 @@ public interface SysGroupService extends IService<SysGroup> {
|
||||
*/
|
||||
List<String> ownUser(SysGroupIdParam sysGroupIdParam);
|
||||
|
||||
/**
|
||||
* 获取组织树选择器
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2024/12/21 01:25
|
||||
*/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取组织树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:00
|
||||
*/
|
||||
List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam);
|
||||
List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取用户选择器
|
||||
|
||||
@@ -14,9 +14,6 @@ package vip.xiaonuo.sys.modular.group.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
@@ -38,7 +35,7 @@ import vip.xiaonuo.sys.modular.group.mapper.SysGroupMapper;
|
||||
import vip.xiaonuo.sys.modular.group.param.*;
|
||||
import vip.xiaonuo.sys.modular.group.service.SysGroupService;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.org.service.SysOrgService;
|
||||
import vip.xiaonuo.sys.modular.relation.entity.SysRelation;
|
||||
import vip.xiaonuo.sys.modular.relation.enums.SysRelationCategoryEnum;
|
||||
@@ -137,17 +134,8 @@ public class SysGroupServiceImpl extends ServiceImpl<SysGroupMapper, SysGroup> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
List<SysOrg> sysOrgList = sysOrgService.getAllOrgList();
|
||||
List<TreeNode<String>> treeNodeList = sysOrgList.stream().map(sysOrg ->
|
||||
new TreeNode<>(sysOrg.getId(), sysOrg.getParentId(), sysOrg.getName(), sysOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return sysOrgService.treeLazy(sysOrgSelectorTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return sysOrgService.orgTreeSelector(sysOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.sys.modular.index.param.*;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
package vip.xiaonuo.sys.modular.index.service;
|
||||
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
import vip.xiaonuo.sys.modular.index.param.*;
|
||||
import vip.xiaonuo.sys.modular.index.result.*;
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ import vip.xiaonuo.sys.modular.role.service.SysRoleService;
|
||||
import vip.xiaonuo.sys.modular.user.service.SysUserService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,8 +73,8 @@ public class SysOrgController {
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "获取组织树(懒加载)")
|
||||
@GetMapping("/sys/org/tree")
|
||||
public CommonResult<List<JSONObject>> treeLazy(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return CommonResult.data(sysOrgService.treeLazy(sysOrgSelectorTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> tree(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return CommonResult.data(sysOrgService.orgTreeSelector(sysOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,8 +162,8 @@ public class SysOrgController {
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "获取组织树选择器(懒加载)")
|
||||
@GetMapping("/sys/org/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return CommonResult.data(sysOrgService.treeLazy(sysOrgSelectorTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return CommonResult.data(sysOrgService.orgTreeSelector(sysOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@ import lombok.Setter;
|
||||
**/
|
||||
@Getter
|
||||
@Setter
|
||||
public class SysOrgSelectorTreeLazyParam {
|
||||
public class SysOrgSelectorTreeParam {
|
||||
|
||||
/** 父id */
|
||||
@Schema(description = "父id")
|
||||
@@ -13,7 +13,6 @@
|
||||
package vip.xiaonuo.sys.modular.org.provider;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@@ -23,7 +22,7 @@ import org.springframework.stereotype.Service;
|
||||
import vip.xiaonuo.sys.api.SysOrgApi;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorOrgListParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.org.service.SysOrgService;
|
||||
|
||||
import java.util.List;
|
||||
@@ -56,15 +55,10 @@ public class SysOrgApiProvider implements SysOrgApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTree() {
|
||||
return sysOrgService.tree();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazy(String parentId) {
|
||||
SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam = new SysOrgSelectorTreeLazyParam();
|
||||
sysOrgSelectorTreeLazyParam.setParentId(parentId);
|
||||
return sysOrgService.treeLazy(sysOrgSelectorTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(String parentId) {
|
||||
SysOrgSelectorTreeParam sysOrgSelectorTreeParam = new SysOrgSelectorTreeParam();
|
||||
sysOrgSelectorTreeParam.setParentId(parentId);
|
||||
return sysOrgService.orgTreeSelector(sysOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
package vip.xiaonuo.sys.modular.org.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -38,22 +37,6 @@ public interface SysOrgService extends IService<SysOrg> {
|
||||
*/
|
||||
Page<SysOrg> page(SysOrgPageParam sysOrgPageParam);
|
||||
|
||||
/**
|
||||
* 获取组织树
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<Tree<String>> tree();
|
||||
|
||||
/**
|
||||
* 获取机构树(懒加载),支持搜索
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/21 16:13
|
||||
**/
|
||||
List<JSONObject> treeLazy(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam);
|
||||
|
||||
/**
|
||||
* 添加组织
|
||||
*
|
||||
@@ -174,6 +157,14 @@ public interface SysOrgService extends IService<SysOrg> {
|
||||
**/
|
||||
SysOrg getChildById(List<SysOrg> originDataList, String id);
|
||||
|
||||
/**
|
||||
* 获取组织树选择器(懒加载),支持搜索,搜索为空字符串走全量
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/21 16:13
|
||||
**/
|
||||
List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取组织列表选择器
|
||||
*
|
||||
|
||||
@@ -111,69 +111,6 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
||||
return this.page(CommonPageRequest.defaultPage(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> tree() {
|
||||
List<SysOrg> sysOrgList = this.getAllOrgList();
|
||||
List<TreeNode<String>> treeNodeList = sysOrgList.stream().map(sysOrg ->
|
||||
new TreeNode<>(sysOrg.getId(), sysOrg.getParentId(), sysOrg.getName(), sysOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> treeLazy(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
// searchKey不为null时,走全量搜索模式,返回嵌套树结构
|
||||
if (sysOrgSelectorTreeLazyParam.getSearchKey() != null) {
|
||||
return this.treeSearch(sysOrgSelectorTreeLazyParam.getSearchKey());
|
||||
}
|
||||
String parentId = ObjectUtil.isNotEmpty(sysOrgSelectorTreeLazyParam.getParentId()) ? sysOrgSelectorTreeLazyParam.getParentId() : "0";
|
||||
// 超管接口,无需数据范围过滤,直接SQL查询当前父级下的子机构
|
||||
List<SysOrg> childList = this.list(new LambdaQueryWrapper<SysOrg>()
|
||||
.eq(SysOrg::getParentId, parentId)
|
||||
.orderByAsc(SysOrg::getSortCode)
|
||||
.orderByAsc(SysOrg::getId));
|
||||
if (ObjectUtil.isEmpty(childList)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
// 批量判断哪些子机构还有下级
|
||||
List<String> childIds = childList.stream().map(SysOrg::getId).collect(Collectors.toList());
|
||||
Set<String> hasChildrenParentIds = this.list(new LambdaQueryWrapper<SysOrg>()
|
||||
.select(SysOrg::getParentId)
|
||||
.in(SysOrg::getParentId, childIds))
|
||||
.stream().map(SysOrg::getParentId).collect(Collectors.toSet());
|
||||
return childList.stream().map(sysOrg -> {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(sysOrg);
|
||||
jsonObject.set("isLeaf", !hasChildrenParentIds.contains(sysOrg.getId()));
|
||||
return jsonObject;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 全量搜索模式,返回嵌套树结构的JSONObject列表
|
||||
* searchKey为空字符串时返回全量树,非空时按关键字过滤
|
||||
*/
|
||||
private List<JSONObject> treeSearch(String searchKey) {
|
||||
List<SysOrg> allOrgList = this.getAllOrgList();
|
||||
List<SysOrg> sysOrgList;
|
||||
if (ObjectUtil.isNotEmpty(searchKey)) {
|
||||
Set<SysOrg> filteredSet = CollectionUtil.newLinkedHashSet();
|
||||
allOrgList.stream()
|
||||
.filter(org -> StrUtil.containsIgnoreCase(org.getName(), searchKey))
|
||||
.forEach(org -> filteredSet.addAll(this.getParentListById(allOrgList, org.getId(), true)));
|
||||
sysOrgList = new ArrayList<>(filteredSet);
|
||||
} else {
|
||||
sysOrgList = allOrgList;
|
||||
}
|
||||
sysOrgList.sort(Comparator.comparingInt(SysOrg::getSortCode)
|
||||
.thenComparing(SysOrg::getId));
|
||||
List<TreeNode<String>> treeNodeList = sysOrgList.stream().map(sysOrg ->
|
||||
new TreeNode<>(sysOrg.getId(), sysOrg.getParentId(),
|
||||
sysOrg.getName(), sysOrg.getSortCode()).setExtra(JSONUtil.parseObj(sysOrg)))
|
||||
.collect(Collectors.toList());
|
||||
List<Tree<String>> treeList = TreeUtil.build(treeNodeList, "0");
|
||||
return JSONUtil.toList(JSONUtil.parseArray(treeList), JSONObject.class);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void add(SysOrgAddParam sysOrgAddParam, String sourceFromType) {
|
||||
@@ -437,6 +374,60 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
||||
|
||||
/* ====组织部分所需要用到的选择器==== */
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
// searchKey不为null时,走全量搜索模式,返回嵌套树结构
|
||||
if (sysOrgSelectorTreeParam.getSearchKey() != null) {
|
||||
return this.treeSearch(sysOrgSelectorTreeParam.getSearchKey());
|
||||
}
|
||||
String parentId = ObjectUtil.isNotEmpty(sysOrgSelectorTreeParam.getParentId()) ? sysOrgSelectorTreeParam.getParentId() : "0";
|
||||
// 超管接口,无需数据范围过滤,直接SQL查询当前父级下的子机构
|
||||
List<SysOrg> childList = this.list(new LambdaQueryWrapper<SysOrg>()
|
||||
.eq(SysOrg::getParentId, parentId)
|
||||
.orderByAsc(SysOrg::getSortCode)
|
||||
.orderByAsc(SysOrg::getId));
|
||||
if (ObjectUtil.isEmpty(childList)) {
|
||||
return CollectionUtil.newArrayList();
|
||||
}
|
||||
// 批量判断哪些子机构还有下级
|
||||
List<String> childIds = childList.stream().map(SysOrg::getId).collect(Collectors.toList());
|
||||
Set<String> hasChildrenParentIds = this.list(new LambdaQueryWrapper<SysOrg>()
|
||||
.select(SysOrg::getParentId)
|
||||
.in(SysOrg::getParentId, childIds))
|
||||
.stream().map(SysOrg::getParentId).collect(Collectors.toSet());
|
||||
return childList.stream().map(sysOrg -> {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(sysOrg);
|
||||
jsonObject.set("isLeaf", !hasChildrenParentIds.contains(sysOrg.getId()));
|
||||
return jsonObject;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 全量搜索模式,返回嵌套树结构的JSONObject列表
|
||||
* searchKey为空字符串时返回全量树,非空时按关键字过滤
|
||||
*/
|
||||
private List<JSONObject> treeSearch(String searchKey) {
|
||||
List<SysOrg> allOrgList = this.getAllOrgList();
|
||||
List<SysOrg> sysOrgList;
|
||||
if (ObjectUtil.isNotEmpty(searchKey)) {
|
||||
Set<SysOrg> filteredSet = CollectionUtil.newLinkedHashSet();
|
||||
allOrgList.stream()
|
||||
.filter(org -> StrUtil.containsIgnoreCase(org.getName(), searchKey))
|
||||
.forEach(org -> filteredSet.addAll(this.getParentListById(allOrgList, org.getId(), true)));
|
||||
sysOrgList = new ArrayList<>(filteredSet);
|
||||
} else {
|
||||
sysOrgList = allOrgList;
|
||||
}
|
||||
sysOrgList.sort(Comparator.comparingInt(SysOrg::getSortCode)
|
||||
.thenComparing(SysOrg::getId));
|
||||
List<TreeNode<String>> treeNodeList = sysOrgList.stream().map(sysOrg ->
|
||||
new TreeNode<>(sysOrg.getId(), sysOrg.getParentId(),
|
||||
sysOrg.getName(), sysOrg.getSortCode()).setExtra(JSONUtil.parseObj(sysOrg)))
|
||||
.collect(Collectors.toList());
|
||||
List<Tree<String>> treeList = TreeUtil.build(treeNodeList, "0");
|
||||
return JSONUtil.toList(JSONUtil.parseArray(treeList), JSONObject.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysOrg> orgListSelector(SysOrgSelectorOrgListParam sysOrgSelectorOrgListParam) {
|
||||
QueryWrapper<SysOrg> queryWrapper = new QueryWrapper<SysOrg>().checkSqlInjection();
|
||||
|
||||
@@ -23,8 +23,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import vip.xiaonuo.auth.core.pojo.SaBaseLoginUser;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysUserDataScope;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysUserDataScopeMap;
|
||||
import vip.xiaonuo.sys.modular.org.mapper.SysUserDataScopeMapper;
|
||||
import vip.xiaonuo.sys.modular.org.mapper.SysUserDataScopeMapMapper;
|
||||
import vip.xiaonuo.sys.modular.org.mapper.SysUserDataScopeMapper;
|
||||
import vip.xiaonuo.sys.modular.org.service.SysUserDataScopeService;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.position.entity.SysPosition;
|
||||
import vip.xiaonuo.sys.modular.position.param.*;
|
||||
import vip.xiaonuo.sys.modular.position.service.SysPositionService;
|
||||
@@ -133,8 +133,8 @@ public class SysPositionController {
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "获取组织树选择器(懒加载)")
|
||||
@GetMapping("/sys/position/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return CommonResult.data(sysPositionService.orgTreeLazySelector(sysOrgSelectorTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return CommonResult.data(sysPositionService.orgTreeSelector(sysOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
*/
|
||||
package vip.xiaonuo.sys.modular.position.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.position.entity.SysPosition;
|
||||
import vip.xiaonuo.sys.modular.position.param.*;
|
||||
|
||||
@@ -96,21 +95,13 @@ public interface SysPositionService extends IService<SysPosition> {
|
||||
|
||||
/* ====职位部分所需要用到的选择器==== */
|
||||
|
||||
/**
|
||||
* 获取组织树选择器
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取组织树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/22 15:53
|
||||
**/
|
||||
List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam);
|
||||
List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取职位选择器
|
||||
|
||||
@@ -15,9 +15,6 @@ package vip.xiaonuo.sys.modular.position.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -35,8 +32,7 @@ import vip.xiaonuo.common.exception.CommonException;
|
||||
import vip.xiaonuo.common.listener.CommonDataChangeEventCenter;
|
||||
import vip.xiaonuo.common.page.CommonPageRequest;
|
||||
import vip.xiaonuo.sys.core.enums.SysDataTypeEnum;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.org.service.SysOrgService;
|
||||
import vip.xiaonuo.sys.modular.position.entity.SysPosition;
|
||||
import vip.xiaonuo.sys.modular.position.enums.SysPositionCategoryEnum;
|
||||
@@ -193,17 +189,8 @@ public class SysPositionServiceImpl extends ServiceImpl<SysPositionMapper, SysPo
|
||||
/* ====职位部分所需要用到的选择器==== */
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
List<SysOrg> sysOrgList = sysOrgService.getAllOrgList();
|
||||
List<TreeNode<String>> treeNodeList = sysOrgList.stream().map(sysOrg ->
|
||||
new TreeNode<>(sysOrg.getId(), sysOrg.getParentId(), sysOrg.getName(), sysOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return sysOrgService.treeLazy(sysOrgSelectorTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return sysOrgService.orgTreeSelector(sysOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.role.entity.SysRole;
|
||||
import vip.xiaonuo.sys.modular.role.param.*;
|
||||
import vip.xiaonuo.sys.modular.role.result.*;
|
||||
@@ -248,8 +248,8 @@ public class SysRoleController {
|
||||
@ApiOperationSupport(order = 15)
|
||||
@Operation(summary = "获取组织树选择器(懒加载)")
|
||||
@GetMapping("/sys/role/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return CommonResult.data(sysRoleService.orgTreeLazySelector(sysOrgSelectorTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return CommonResult.data(sysRoleService.orgTreeSelector(sysOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
*/
|
||||
package vip.xiaonuo.sys.modular.role.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.resource.entity.SysMenu;
|
||||
import vip.xiaonuo.sys.modular.role.entity.SysRole;
|
||||
import vip.xiaonuo.sys.modular.role.param.*;
|
||||
@@ -147,21 +146,13 @@ public interface SysRoleService extends IService<SysRole> {
|
||||
|
||||
/* ====角色部分所需要用到的选择器==== */
|
||||
|
||||
/**
|
||||
* 获取组织树选择器
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:08
|
||||
*/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取组织树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/4/24 20:00
|
||||
*/
|
||||
List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam);
|
||||
List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取资源授权树
|
||||
|
||||
@@ -41,7 +41,7 @@ import vip.xiaonuo.mobile.api.MobileMenuApi;
|
||||
import vip.xiaonuo.sys.core.enums.SysBuildInEnum;
|
||||
import vip.xiaonuo.sys.core.enums.SysDataTypeEnum;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.org.service.SysOrgService;
|
||||
import vip.xiaonuo.sys.modular.relation.entity.SysRelation;
|
||||
import vip.xiaonuo.sys.modular.relation.enums.SysRelationCategoryEnum;
|
||||
@@ -350,17 +350,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
/* ====角色部分所需要用到的选择器==== */
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
List<SysOrg> sysOrgList = sysOrgService.getAllOrgList();
|
||||
List<TreeNode<String>> treeNodeList = sysOrgList.stream().map(sysOrg ->
|
||||
new TreeNode<>(sysOrg.getId(), sysOrg.getParentId(), sysOrg.getName(), sysOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return sysOrgService.treeLazy(sysOrgSelectorTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return sysOrgService.orgTreeSelector(sysOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,9 +28,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.position.entity.SysPosition;
|
||||
import vip.xiaonuo.sys.modular.role.entity.SysRole;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.user.entity.SysUser;
|
||||
import vip.xiaonuo.sys.modular.user.enums.SysUserSourceFromTypeEnum;
|
||||
import vip.xiaonuo.sys.modular.user.param.*;
|
||||
@@ -325,8 +325,8 @@ public class SysUserController {
|
||||
@ApiOperationSupport(order = 19)
|
||||
@Operation(summary = "获取组织树选择器(懒加载)")
|
||||
@GetMapping("/sys/user/orgTreeSelector")
|
||||
public CommonResult<List<JSONObject>> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return CommonResult.data(sysUserService.orgTreeLazySelector(sysOrgSelectorTreeLazyParam));
|
||||
public CommonResult<List<JSONObject>> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return CommonResult.data(sysUserService.orgTreeSelector(sysOrgSelectorTreeParam));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,9 +20,9 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import vip.xiaonuo.sys.modular.group.entity.SysGroup;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.position.entity.SysPosition;
|
||||
import vip.xiaonuo.sys.modular.role.entity.SysRole;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.user.entity.SysUser;
|
||||
import vip.xiaonuo.sys.modular.user.entity.SysUserExt;
|
||||
import vip.xiaonuo.sys.modular.user.param.*;
|
||||
@@ -473,21 +473,13 @@ public interface SysUserService extends IService<SysUser> {
|
||||
|
||||
/* ====用户部分所需要用到的选择器==== */
|
||||
|
||||
/**
|
||||
* 获取组织树选择器
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/5/13 21:00
|
||||
*/
|
||||
List<Tree<String>> orgTreeSelector();
|
||||
|
||||
/**
|
||||
* 获取组织树选择器(懒加载)
|
||||
*
|
||||
* @author xuyuxiang
|
||||
* @date 2022/5/13 21:00
|
||||
*/
|
||||
List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam);
|
||||
List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam);
|
||||
|
||||
/**
|
||||
* 获取组织列表选择器
|
||||
|
||||
@@ -88,7 +88,7 @@ import vip.xiaonuo.sys.core.util.SysPasswordUtl;
|
||||
import vip.xiaonuo.sys.modular.group.entity.SysGroup;
|
||||
import vip.xiaonuo.sys.modular.group.service.SysGroupService;
|
||||
import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeLazyParam;
|
||||
import vip.xiaonuo.sys.modular.org.param.SysOrgSelectorTreeParam;
|
||||
import vip.xiaonuo.sys.modular.org.service.SysOrgService;
|
||||
import vip.xiaonuo.sys.modular.position.entity.SysPosition;
|
||||
import vip.xiaonuo.sys.modular.position.service.SysPositionService;
|
||||
@@ -2001,17 +2001,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
/* ====用户部分所需要用到的选择器==== */
|
||||
|
||||
@Override
|
||||
public List<Tree<String>> orgTreeSelector() {
|
||||
List<SysOrg> sysOrgList = sysOrgService.getAllOrgList();
|
||||
List<TreeNode<String>> treeNodeList = sysOrgList.stream().map(sysOrg ->
|
||||
new TreeNode<>(sysOrg.getId(), sysOrg.getParentId(), sysOrg.getName(), sysOrg.getSortCode()))
|
||||
.collect(Collectors.toList());
|
||||
return TreeUtil.build(treeNodeList, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> orgTreeLazySelector(SysOrgSelectorTreeLazyParam sysOrgSelectorTreeLazyParam) {
|
||||
return sysOrgService.treeLazy(sysOrgSelectorTreeLazyParam);
|
||||
public List<JSONObject> orgTreeSelector(SysOrgSelectorTreeParam sysOrgSelectorTreeParam) {
|
||||
return sysOrgService.orgTreeSelector(sysOrgSelectorTreeParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user