dept.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. // 查询部门下拉树结构(全部)
  32. export function treeselectAll() {
  33. return request({
  34. url: '/system/dept/treeselectAll',
  35. method: 'get'
  36. })
  37. }
  38. // 根据角色ID查询部门树结构
  39. export function roleDeptTreeselect(roleId) {
  40. return request({
  41. url: '/system/dept/roleDeptTreeselect/' + roleId,
  42. method: 'get'
  43. })
  44. }
  45. // 新增部门
  46. export function addDept(data) {
  47. return request({
  48. url: '/system/dept',
  49. method: 'post',
  50. data: data
  51. })
  52. }
  53. // 修改部门
  54. export function updateDept(data) {
  55. return request({
  56. url: '/system/dept',
  57. method: 'put',
  58. data: data
  59. })
  60. }
  61. // 删除部门
  62. export function delDept(deptId) {
  63. return request({
  64. url: '/system/dept/' + deptId,
  65. method: 'delete'
  66. })
  67. }