Newer
Older
urbanLifeline_YanAn / src / api / system / khdgl.js
@zhangqy zhangqy on 3 Oct 2 KB first commit
  1. import request from '@/utils/request'
  2.  
  3. // 查询角色列表
  4. export function listRole(query) {
  5. return request({
  6. url: '/system/client/list',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11.  
  12. // 查询角色详细
  13. export function getRole(roleId) {
  14. return request({
  15. url: '/system/client/' + roleId,
  16. method: 'get'
  17. })
  18. }
  19.  
  20. // 新增角色
  21. export function addRole(data) {
  22. return request({
  23. url: '/system/client/add',
  24. method: 'post',
  25. data: data
  26. })
  27. }
  28.  
  29. // 修改角色
  30. export function updateRole(data) {
  31. return request({
  32. url: '/system/client/edit',
  33. method: 'put',
  34. data: data
  35. })
  36. }
  37.  
  38. // 角色数据权限
  39. export function dataScope(data) {
  40. return request({
  41. url: '/system/client/dataScope',
  42. method: 'put',
  43. data: data
  44. })
  45. }
  46.  
  47. // 角色状态修改
  48. export function changeRoleStatus(roleId, status) {
  49. const data = {
  50. roleId,
  51. status
  52. }
  53. return request({
  54. url: '/system/client/changeStatus',
  55. method: 'put',
  56. data: data
  57. })
  58. }
  59.  
  60. // 删除角色
  61. export function delRole(roleId) {
  62. return request({
  63. url: '/system/client/' + roleId,
  64. method: 'delete'
  65. })
  66. }
  67.  
  68. // 查询角色已授权用户列表
  69. export function allocatedUserList(query) {
  70. return request({
  71. url: '/system/clientResource/list',
  72. method: 'get',
  73. params: query
  74. })
  75. }
  76.  
  77. // 查询角色未授权用户列表
  78. export function unallocatedUserList(query) {
  79. return request({
  80. url: '/system/client/authUser/unallocatedList',
  81. method: 'get',
  82. params: query
  83. })
  84. }
  85.  
  86. // 取消用户授权角色
  87. export function authUserCancel(data) {
  88. return request({
  89. url: '/system/client/authUser/cancel',
  90. method: 'put',
  91. data: data
  92. })
  93. }
  94.  
  95. // 批量取消用户授权角色
  96. export function authUserCancelAll(data) {
  97. return request({
  98. url: '/system/client/authUser/cancelAll',
  99. method: 'put',
  100. params: data
  101. })
  102. }
  103.  
  104. // 授权用户选择
  105. export function authUserSelectAll(data) {
  106. return request({
  107. url: '/system/client/authUser/selectAll',
  108. method: 'put',
  109. params: data
  110. })
  111. }
  112.  
  113. // 根据角色ID查询部门树结构
  114. export function deptTreeSelect(roleId) {
  115. return request({
  116. url: '/system/client/deptTree/' + roleId,
  117. method: 'get'
  118. })
  119. }
  120.  
  121. export function clientResource(roleId) {
  122. return request({
  123. url: '/system/clientResource/' + roleId,
  124. method: 'get'
  125. })
  126. }
  127. // 修改角色
  128. export function updateClientResource(data) {
  129. return request({
  130. url: '/system/clientResource/edit',
  131. method: 'put',
  132. data: data
  133. })
  134. }
  135.  
  136. export function addClientResource(data) {
  137. return request({
  138. url: '/system/clientResource/add',
  139. method: 'post',
  140. data: data
  141. })
  142. }
  143.  
  144. export function delClientResourcee(roleId) {
  145. return request({
  146. url: '/system/clientResource/' + roleId,
  147. method: 'delete'
  148. })
  149. }