index.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { useAxios } from '@/hooks/web/useAxios'
  2. import type { PostVO, PostPageReqVO, PostExportReqVO } from './types'
  3. const request = useAxios()
  4. // 查询岗位列表
  5. export const getPostPageApi = async (params: PostPageReqVO) => {
  6. return await request.get({ url: '/system/post/page', params })
  7. }
  8. // 获取岗位精简信息列表
  9. export const listSimplePostsApi = async () => {
  10. return await request.get({ url: '/system/post/list-all-simple' })
  11. }
  12. // 查询岗位详情
  13. export const getPostApi = async (id: number) => {
  14. return await request.get({ url: '/system/post/get?id=' + id })
  15. }
  16. // 新增岗位
  17. export const createPostApi = async (data: PostVO) => {
  18. return await request.post({ url: '/system/post/create', data })
  19. }
  20. // 修改岗位
  21. export const updatePostApi = async (data: PostVO) => {
  22. return await request.put({ url: '/system/post/update', data })
  23. }
  24. // 删除岗位
  25. export const deletePostApi = async (id: number) => {
  26. return await request.delete({ url: '/system/post/delete?id=' + id })
  27. }
  28. // 导出岗位
  29. export const exportPostApi = async (params: PostExportReqVO) => {
  30. return await request.download({ url: '/system/post/export', params })
  31. }