dept.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import http from '@/api'
  2. /**
  3. * @name 查询部门列表
  4. * @param query 参数
  5. * @returns 返回列表
  6. */
  7. export const listDeptApi = (query: any) => {
  8. return http.get<any>('/system/dept/list', query, { loading: true })
  9. }
  10. /**
  11. * @name 查询部门详细
  12. * @param deptId deptId
  13. * @returns returns
  14. */
  15. export const getDeptApi = (deptId: any) => {
  16. return http.get<any>(`/system/dept/${deptId}`)
  17. }
  18. /**
  19. * @name 新增部门
  20. * @param data data
  21. * @returns returns
  22. */
  23. export const addDeptApi = (data: any) => {
  24. return http.post<any>('/system/dept', data, { loading: false })
  25. }
  26. /**
  27. * @name 修改部门
  28. * @param data data
  29. * @returns returns
  30. */
  31. export const updateDeptApi = (data: any) => {
  32. return http.put<any>('/system/dept', data, { loading: false })
  33. }
  34. /**
  35. * @name 删除部门
  36. * @param deptId deptId
  37. * @returns returns
  38. */
  39. export const delDeptApi = (deptId: any) => {
  40. return http.delete<any>(`/system/dept/${deptId}`)
  41. }
  42. /**
  43. * @name 下载模板
  44. * @returns returns
  45. */
  46. export const importTemplateApi = () => {
  47. return http.downloadPost('/system/dept/importTemplate', {})
  48. }
  49. /**
  50. * @name 导入数据
  51. * @returns returns
  52. */
  53. export const importDataApi = (data: any) => {
  54. return http.post('/system/dept/importData', data)
  55. }
  56. /**
  57. * @name 导出数据
  58. * @returns returns
  59. */
  60. export const exportApi = (data: any) => {
  61. return http.downloadPost('/system/dept/export', data)
  62. }