diff --git a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java index daf98f1796..0a1052f787 100644 --- a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java +++ b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java @@ -5,6 +5,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.dataease.auth.api.dto.CurrentUserDto; +import io.dataease.base.domain.SysRole; import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.PageUtils; import io.dataease.commons.utils.Pager; @@ -116,4 +117,14 @@ public class SysUserController { public List all(){ return sysRoleService.allRoles(); } + + + + @ApiOperation("查询角色") + @PostMapping("/roleGrid/{goPage}/{pageSize}") + public Pager> roleGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseGridRequest request) { + Page page = PageHelper.startPage(goPage, pageSize, true); + Pager> listPager = PageUtils.setPageInfo(page, sysRoleService.query(request)); + return listPager; + } } diff --git a/backend/src/main/java/io/dataease/service/sys/SysRoleService.java b/backend/src/main/java/io/dataease/service/sys/SysRoleService.java index 558c0b7f96..3747055c9c 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysRoleService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysRoleService.java @@ -5,9 +5,11 @@ package io.dataease.service.sys; import io.dataease.base.domain.SysUsersRolesExample; import io.dataease.base.mapper.SysRoleMapper; import io.dataease.base.mapper.SysUsersRolesMapper;*/ +import io.dataease.base.domain.SysRole; import io.dataease.base.mapper.ext.ExtSysRoleMapper; /*import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.request.RoleMenusRequest;*/ +import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.response.RoleUserItem; import org.springframework.stereotype.Service; /*import org.springframework.transaction.annotation.Transactional;*/ @@ -55,12 +57,13 @@ public class SysRoleService { return mapper.deleteByPrimaryKey(roleId); } - + */ public List query(BaseGridRequest request){ List result = extSysRoleMapper.query(request.convertExample()); return result; } + /* public List menuIds(Long roleId){ return extSysRoleMapper.menuIds(roleId); diff --git a/frontend/src/api/system/user.js b/frontend/src/api/system/user.js index f3db990e04..47cfc04581 100644 --- a/frontend/src/api/system/user.js +++ b/frontend/src/api/system/user.js @@ -89,4 +89,13 @@ export const allRoles = () => { }) } -export default { editPassword, delUser, editUser, addUser, userLists, editStatus, persionInfo, updatePerson, updatePersonPwd, allRoles } +export function roleGrid(pageIndex, pageSize, data) { + return request({ + url: '/api/user/roleGrid/' + pageIndex + '/' + pageSize, + method: 'post', + data, + loading: true + }) +} + +export default { editPassword, delUser, editUser, addUser, userLists, editStatus, persionInfo, updatePerson, updatePersonPwd, allRoles, roleGrid } diff --git a/frontend/src/views/panel/GrantAuth/dept/index.vue b/frontend/src/views/panel/GrantAuth/dept/index.vue index 9f2cf29f6b..7221702ea4 100644 --- a/frontend/src/views/panel/GrantAuth/dept/index.vue +++ b/frontend/src/views/panel/GrantAuth/dept/index.vue @@ -1,30 +1,42 @@