dept.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import request from '@/utils/request'
  2. // 获取部门精简信息列表(角色菜单的部门选择框使用)
  3. export function listSimpleDeptsRole() {
  4. return request({
  5. url: '/system/dept/get-all-simple-list',
  6. method: 'get'
  7. })
  8. }
  9. // 查询部门列表
  10. export function listDept(query) {
  11. return request({
  12. url: '/system/dept/list',
  13. method: 'get',
  14. params: query
  15. })
  16. }
  17. // 查询部门列表(排除节点)
  18. export function listDeptExcludeChild(deptId) {
  19. return request({
  20. url: '/system/dept/list/exclude/' + deptId,
  21. method: 'get'
  22. })
  23. }
  24. // 查询部门详细
  25. export function getDept(deptId) {
  26. return request({
  27. url: '/system/dept/get?id=' + deptId,
  28. method: 'get'
  29. })
  30. }
  31. // 获取部门精简信息列表
  32. export function listSimpleDepts() {
  33. return request({
  34. url: '/system/dept/list-all-simple',
  35. method: 'get'
  36. })
  37. }
  38. // 新增部门
  39. export function addDept(data) {
  40. return request({
  41. url: '/system/dept/create',
  42. method: 'post',
  43. data: data
  44. })
  45. }
  46. // 修改部门
  47. export function updateDept(data) {
  48. return request({
  49. url: '/system/dept/update',
  50. method: 'put',
  51. data: data
  52. })
  53. }
  54. // 删除部门
  55. export function delDept(id) {
  56. return request({
  57. url: '/system/dept/delete?id=' + id,
  58. method: 'delete'
  59. })
  60. }