39 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-07-19 22:33:54 +08:00
import { useAxios } from '@/hooks/web/useAxios'
2022-07-18 19:06:37 +08:00
import type { PostVO } from './types'
2022-07-19 22:33:54 +08:00
const request = useAxios()
2022-07-18 19:06:37 +08:00
// 查询岗位列表
2022-07-19 22:33:54 +08:00
export const getPostPageApi = async (params) => {
return await request.get({ url: '/system/post/page', params })
2022-07-18 19:06:37 +08:00
}
// 获取岗位精简信息列表
2022-07-19 22:33:54 +08:00
export const listSimplePostsApi = async () => {
return await request.get({ url: '/system/post/list-all-simple' })
2022-07-18 19:06:37 +08:00
}
// 查询岗位详情
2022-07-19 22:33:54 +08:00
export const getPostApi = async (id: number) => {
return await request.get({ url: '/system/post/get?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 新增岗位
2022-07-19 22:33:54 +08:00
export const createPostApi = async (data: PostVO) => {
return await request.post({ url: '/system/post/create', data })
2022-07-18 19:06:37 +08:00
}
// 修改岗位
2022-07-19 22:33:54 +08:00
export const updatePostApi = async (data: PostVO) => {
return await request.put({ url: '/system/post/update', data })
2022-07-18 19:06:37 +08:00
}
// 删除岗位
2022-07-19 22:33:54 +08:00
export const deletePostApi = async (id: number) => {
return await request.delete({ url: '/system/post/delete?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 导出岗位
2022-07-19 22:33:54 +08:00
export const exportPostApi = async (params) => {
return await request.get({ url: '/system/post/export', params, responseType: 'blob' })
2022-07-18 19:06:37 +08:00
}