综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

role.js 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import request from '@/utils/request'
  2. // 查询角色列表
  3. export function listRole(query) {
  4. return request({
  5. url: '/system/role/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询角色详细
  11. export function getRole(roleId) {
  12. return request({
  13. url: '/system/role/' + roleId,
  14. method: 'get'
  15. })
  16. }
  17. // 查询角色详细
  18. export function getUserByRole(roleId) {
  19. return request({
  20. url: '/system/role/getUserByRole',
  21. method: 'get',
  22. params: roleId
  23. })
  24. }
  25. // 新增角色
  26. export function addRole(data) {
  27. return request({
  28. url: '/system/role',
  29. method: 'post',
  30. data: data
  31. })
  32. }
  33. // 修改角色
  34. export function updateRole(data) {
  35. return request({
  36. url: '/system/role',
  37. method: 'put',
  38. data: data
  39. })
  40. }
  41. // 角色数据权限
  42. export function dataScope(data) {
  43. return request({
  44. url: '/system/role/dataScope',
  45. method: 'put',
  46. data: data
  47. })
  48. }
  49. // 角色状态修改
  50. export function changeRoleStatus(roleId, status) {
  51. const data = {
  52. roleId,
  53. status
  54. }
  55. return request({
  56. url: '/system/role/changeStatus',
  57. method: 'put',
  58. data: data
  59. })
  60. }
  61. // 删除角色
  62. export function delRole(roleId) {
  63. return request({
  64. url: '/system/role/' + roleId,
  65. method: 'delete'
  66. })
  67. }
  68. // 查询角色已授权用户列表
  69. export function allocatedUserList(query) {
  70. return request({
  71. url: '/system/role/authUser/allocatedList',
  72. method: 'get',
  73. params: query
  74. })
  75. }
  76. // 查询角色未授权用户列表
  77. export function unallocatedUserList(query) {
  78. return request({
  79. url: '/system/role/authUser/unallocatedList',
  80. method: 'get',
  81. params: query
  82. })
  83. }
  84. // 取消用户授权角色
  85. export function authUserCancel(data) {
  86. return request({
  87. url: '/system/role/authUser/cancel',
  88. method: 'put',
  89. data: data
  90. })
  91. }
  92. // 批量取消用户授权角色
  93. export function authUserCancelAll(data) {
  94. return request({
  95. url: '/system/role/authUser/cancelAll',
  96. method: 'put',
  97. params: data
  98. })
  99. }
  100. // 授权用户选择
  101. export function authUserSelectAll(data) {
  102. return request({
  103. url: '/system/role/authUser/selectAll',
  104. method: 'put',
  105. params: data
  106. })
  107. }
  108. // 根据角色ID查询部门树结构
  109. export function deptTreeSelect(roleId) {
  110. return request({
  111. url: '/system/role/deptTree/' + roleId,
  112. method: 'get'
  113. })
  114. }