index.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import request from '@/config/axios'
  2. export interface PostVO {
  3. id?: number
  4. name: string
  5. code: string
  6. sort: number
  7. status: number
  8. remark: string
  9. createTime?: Date
  10. }
  11. export interface PostPageReqVO extends PageParam {
  12. code?: string
  13. name?: string
  14. status?: number
  15. }
  16. export interface PostExportReqVO {
  17. code?: string
  18. name?: string
  19. status?: number
  20. }
  21. // 查询岗位列表
  22. export const getPostPageApi = async (params: PostPageReqVO) => {
  23. return await request.get({ url: '/system/post/page', params })
  24. }
  25. // 获取岗位精简信息列表
  26. export const listSimplePostsApi = async () => {
  27. return await request.get({ url: '/system/post/list-all-simple' })
  28. }
  29. // 查询岗位详情
  30. export const getPostApi = async (id: number) => {
  31. return await request.get({ url: '/system/post/get?id=' + id })
  32. }
  33. // 新增岗位
  34. export const createPostApi = async (data: PostVO) => {
  35. return await request.post({ url: '/system/post/create', data })
  36. }
  37. // 修改岗位
  38. export const updatePostApi = async (data: PostVO) => {
  39. return await request.put({ url: '/system/post/update', data })
  40. }
  41. // 删除岗位
  42. export const deletePostApi = async (id: number) => {
  43. return await request.delete({ url: '/system/post/delete?id=' + id })
  44. }
  45. // 导出岗位
  46. export const exportPostApi = async (params: PostExportReqVO) => {
  47. return await request.download({ url: '/system/post/export', params })
  48. }