dept.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import request from '@/utils/request'
  2. // 查询部门列表
  3. export function listDept(query) {
  4. return request({
  5. url: '/system/dept/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询部门列表(排除节点)
  11. export function listDeptExcludeChild(deptId) {
  12. return request({
  13. url: '/system/dept/list/exclude/' + deptId,
  14. method: 'get'
  15. })
  16. }
  17. // 查询部门详细
  18. export function getDept(deptId) {
  19. return request({
  20. url: '/system/dept/' + deptId,
  21. method: 'get'
  22. })
  23. }
  24. // 查询部门下拉树结构
  25. export function treeselect() {
  26. return request({
  27. url: '/system/dept/treeselect',
  28. method: 'get'
  29. })
  30. }
  31. // 根据角色ID查询部门树结构
  32. export function roleDeptTreeselect(roleId) {
  33. return request({
  34. url: '/system/dept/roleDeptTreeselect/' + roleId,
  35. method: 'get'
  36. })
  37. }
  38. // 新增部门
  39. export function addDept(data) {
  40. return request({
  41. url: '/system/dept',
  42. method: 'post',
  43. data: data
  44. })
  45. }
  46. // 修改部门
  47. export function updateDept(data) {
  48. return request({
  49. url: '/system/dept',
  50. method: 'put',
  51. data: data
  52. })
  53. }
  54. // 删除部门
  55. export function delDept(deptId) {
  56. return request({
  57. url: '/system/dept/' + deptId,
  58. method: 'delete'
  59. })
  60. }