dept.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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(data) {
  26. return request({
  27. url: '/system/dept/treeselect',
  28. method: 'get',
  29. params: data
  30. })
  31. }
  32. // 查询部门下拉树结构
  33. export function treeselect2() {
  34. return request({
  35. url: '/system/dept/treeselect2',
  36. method: 'get'
  37. })
  38. }
  39. // 根据角色ID查询部门树结构
  40. export function roleDeptTreeselect(roleId) {
  41. return request({
  42. url: '/system/dept/roleDeptTreeselect/' + roleId,
  43. method: 'get'
  44. })
  45. }
  46. export function selectLevelAndChild(data) {
  47. return request({
  48. url: '/system/dept/selectLevelAndChild' + `?deptId=${data.deptId}`,
  49. method: 'post',
  50. })
  51. }
  52. // 新增部门
  53. export function addDept(data) {
  54. return request({
  55. url: '/system/dept',
  56. method: 'post',
  57. data: data
  58. })
  59. }
  60. // 修改部门
  61. export function updateDept(data) {
  62. return request({
  63. url: '/system/dept',
  64. method: 'put',
  65. data: data
  66. })
  67. }
  68. // 删除部门
  69. export function delDept(deptId) {
  70. return request({
  71. url: '/system/dept/' + deptId,
  72. method: 'delete'
  73. })
  74. }