index.ts 1.1 KB

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