index.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. // 查询岗位列表
  12. export const getPostPage = async (params: PageParam) => {
  13. return await request.get({ url: '/system/post/page', params })
  14. }
  15. // 获取岗位精简信息列表
  16. export const getSimplePostList = async (): Promise<PostVO[]> => {
  17. return await request.get({ url: '/system/post/list-all-simple' })
  18. }
  19. // 查询岗位详情
  20. export const getPost = async (id: number) => {
  21. return await request.get({ url: '/system/post/get?id=' + id })
  22. }
  23. // 新增岗位
  24. export const createPost = async (data: PostVO) => {
  25. return await request.post({ url: '/system/post/create', data })
  26. }
  27. // 修改岗位
  28. export const updatePost = async (data: PostVO) => {
  29. return await request.put({ url: '/system/post/update', data })
  30. }
  31. // 删除岗位
  32. export const deletePost = async (id: number) => {
  33. return await request.delete({ url: '/system/post/delete?id=' + id })
  34. }
  35. // 导出岗位
  36. export const exportPost = async (params) => {
  37. return await request.download({ url: '/system/post/export', params })
  38. }