post.ts 1.5 KB

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