zhangwencui
昨天 3f17ec33d0d58a632bfc0251e2dd7c6cd246044d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace SystemPostApi {
  /** 岗位信息 */
  export interface Post {
    id?: number;
    name: string;
    code: string;
    sort: number;
    status: number;
    remark: string;
    createTime?: Date;
  }
}
 
/** 查询岗位列表 */
export function getPostPage(params: PageParam) {
  return requestClient.get<PageResult<SystemPostApi.Post>>(
    '/system/post/page',
    {
      params,
    },
  );
}
 
/** 获取岗位精简信息列表 */
export function getSimplePostList() {
  return requestClient.get<SystemPostApi.Post[]>('/system/post/simple-list');
}
 
/** 查询岗位详情 */
export function getPost(id: number) {
  return requestClient.get<SystemPostApi.Post>(`/system/post/get?id=${id}`);
}
 
/** 新增岗位 */
export function createPost(data: SystemPostApi.Post) {
  return requestClient.post('/system/post/create', data);
}
 
/** 修改岗位 */
export function updatePost(data: SystemPostApi.Post) {
  return requestClient.put('/system/post/update', data);
}
 
/** 删除岗位 */
export function deletePost(id: number) {
  return requestClient.delete(`/system/post/delete?id=${id}`);
}
 
/** 批量删除岗位 */
export function deletePostList(ids: number[]) {
  return requestClient.delete(`/system/post/delete-list?ids=${ids.join(',')}`);
}
 
/** 导出岗位 */
export function exportPost(params: any) {
  return requestClient.download('/system/post/export-excel', {
    params,
  });
}