From c930d4fd5ee7ca03d315ed6369dac73335449d18 Mon Sep 17 00:00:00 2001 From: admin <417727563@qq.com> Date: Sat, 13 Jul 2024 16:53:30 +0800 Subject: [PATCH] 13 --- .../service/impl/ExpertServiceImpl.java | 1 + .../controller/SysDepartController.java | 23 +- .../system/service/ISysDepartService.java | 6 + .../service/impl/SysDepartServiceImpl.java | 51 +++ .../depart/components/DepartLeftTree.vue | 4 +- .../src/views/system/depart/depart.data.ts | 14 +- .../components/DepartDataRuleDrawer.vue | 78 ++++ .../components/DepartFormModal.vue | 92 +++++ .../departselect/components/DepartFormTab.vue | 135 +++++++ .../components/DepartLeftTree.vue | 332 ++++++++++++++++++ .../departselect/components/DepartRuleTab.vue | 170 +++++++++ .../views/system/departselect/depart.api.ts | 129 +++++++ .../views/system/departselect/depart.data.ts | 83 +++++ .../src/views/system/departselect/index.less | 14 + .../src/views/system/departselect/index.vue | 52 +++ .../src/views/system/user/index.vue | 4 +- .../src/views/system/user/user.data.js | 13 +- .../src/views/system/user/user.data.ts | 18 +- .../src/views/system/userZJ/user.data.ts | 6 +- .../src/views/system/userdep/userYX.data.ts | 2 +- .../src/views/system/userdep/userZJ.data.ts | 2 +- 21 files changed, 1197 insertions(+), 32 deletions(-) create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/components/DepartDataRuleDrawer.vue create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/components/DepartFormModal.vue create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/components/DepartFormTab.vue create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/components/DepartLeftTree.vue create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/components/DepartRuleTab.vue create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/depart.api.ts create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/depart.data.ts create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/index.less create mode 100644 jeecgboot-vue3-master/src/views/system/departselect/index.vue diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java index 911513f8..b6b63e71 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java @@ -82,3 +82,4 @@ public class ExpertServiceImpl extends ServiceImpl impleme } } } + diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java index 8ff7db31..36ac1382 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java @@ -132,15 +132,36 @@ public class SysDepartController { public Result> queryDepartTreeSync(@RequestParam(name = "pid", required = false) String parentId,@RequestParam(name = "ids", required = false) String ids, @RequestParam(name = "primaryKey", required = false) String primaryKey) { Result> result = new Result<>(); try { - List list = sysDepartService.queryTreeListByPid(parentId,ids, primaryKey); + List list = sysDepartService.queryTreeListByPid(parentId, ids, primaryKey); result.setResult(list); result.setSuccess(true); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + return result; + } + + + /** + * 异步查询当前用户部门 + * @return + */ + @RequestMapping(value = "/queryDepartSync", method = RequestMethod.GET) + public Result queryDepartSync() { + Result result = new Result<>(); + try { + List list = sysDepartService.queryUserDep(); + result.setResult(list.get(0)); + result.setSuccess(true); } catch (Exception e) { log.error(e.getMessage(),e); } return result; + } + + /** * 获取某个部门的所有父级部门的ID * diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java index 6973dd33..8c35521b 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java @@ -198,4 +198,10 @@ public interface ISysDepartService extends IService{ * @return */ IPage getMaxCodeDepart(Page page, String parentId); + + /** + * 异步查询当前用户部门 + * @return + */ + List queryUserDep(); } diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java index cc378b9c..1e5a88d1 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java @@ -602,6 +602,57 @@ public class SysDepartServiceImpl extends ServiceImpl queryUserDep() { +/* Consumer> square = i -> { + if (oConvertUtils.isNotEmpty(ids)) { + if (CommonConstant.DEPART_KEY_ORG_CODE.equals(primaryKey)) { + i.in(SysDepart::getOrgCode, ids.split(SymbolConstant.COMMA)); + } else { + i.in(SysDepart::getId, ids.split(SymbolConstant.COMMA)); + } + } else { + if(oConvertUtils.isEmpty(parentId)){ + i.and(q->q.isNull(true,SysDepart::getParentId).or().eq(true,SysDepart::getParentId,"")); + }else{ + i.eq(true,SysDepart::getParentId,parentId); + } + } + };*/ + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + LambdaQueryWrapper lqw=new LambdaQueryWrapper<>(); + //------------------------------------------------------------------------------------------------ + //是否开启系统管理模块的 SASS 控制 + if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){ + lqw.eq(SysDepart::getTenantId, oConvertUtils.getInt(TenantContext.getTenant(), 0)); + } + lqw.eq(SysDepart::getOrgCode, sysUser.getOrgCode()); + //------------------------------------------------------------------------------------------------ + lqw.eq(true,SysDepart::getDelFlag,CommonConstant.DEL_FLAG_0.toString()); + //lqw.func(square); + //update-begin---author:wangshuai ---date:20220527 for:[VUEN-1143]排序不对,vue3和2应该都有问题,应该按照升序排------------ + lqw.orderByAsc(SysDepart::getDepartOrder); + //update-end---author:wangshuai ---date:20220527 for:[VUEN-1143]排序不对,vue3和2应该都有问题,应该按照升序排-------------- + List list = list(lqw); + //update-begin---author:wangshuai ---date:20220316 for:[JTC-119]在部门管理菜单下设置部门负责人 创建用户的时候不需要处理 + //设置用户id,让前台显示 + this.setUserIdsByDepList(list); + //update-end---author:wangshuai ---date:20220316 for:[JTC-119]在部门管理菜单下设置部门负责人 创建用户的时候不需要处理 + List records = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + SysDepart depart = list.get(i); + SysDepartTreeModel treeModel = new SysDepartTreeModel(depart); + //TODO 异步树加载key拼接__+时间戳,以便于每次展开节点会刷新数据 + //treeModel.setKey(treeModel.getKey()+"__"+System.currentTimeMillis()); + records.add(treeModel); + } + return records; + } + @Override public JSONObject queryAllParentIdByDepartId(String departId) { JSONObject result = new JSONObject(); diff --git a/jeecgboot-vue3-master/src/views/system/depart/components/DepartLeftTree.vue b/jeecgboot-vue3-master/src/views/system/depart/components/DepartLeftTree.vue index cb313e9a..8830ea96 100644 --- a/jeecgboot-vue3-master/src/views/system/depart/components/DepartLeftTree.vue +++ b/jeecgboot-vue3-master/src/views/system/depart/components/DepartLeftTree.vue @@ -7,8 +7,8 @@ 导入 导出 - 同步企微? - 同步钉钉? +