Files
ipms-sjy/yudao-ui-admin-vue3/src/api/system/dept/index.ts

47 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-11-03 16:55:01 +08:00
import request from '@/config/axios'
2022-11-17 20:20:09 +08:00
export type DeptVO = {
2022-11-18 11:20:29 +08:00
id?: number
2022-11-17 20:20:09 +08:00
name: string
parentId: number
status: number
sort: number
leaderUserId: number
phone: string
email: string
}
export interface DeptPageReqVO {
name?: string
status?: number
}
2022-07-18 19:06:37 +08:00
// 查询部门(精简)列表
2022-11-17 20:20:09 +08:00
export const listSimpleDeptApi = async () => {
return await request.get({ url: '/system/dept/list-all-simple' })
2022-07-18 19:06:37 +08:00
}
// 查询部门列表
2022-11-17 20:20:09 +08:00
export const getDeptPageApi = async (params: DeptPageReqVO) => {
return await request.get({ url: '/system/dept/list', params })
2022-07-18 19:06:37 +08:00
}
// 查询部门详情
2022-11-17 20:20:09 +08:00
export const getDeptApi = async (id: number) => {
return await request.get({ url: '/system/dept/get?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 新增部门
2022-11-17 20:20:09 +08:00
export const createDeptApi = async (data: DeptVO) => {
return await request.post({ url: '/system/dept/create', data: data })
2022-07-18 19:06:37 +08:00
}
// 修改部门
2022-11-17 20:20:09 +08:00
export const updateDeptApi = async (params: DeptVO) => {
return await request.put({ url: '/system/dept/update', data: params })
2022-07-18 19:06:37 +08:00
}
// 删除部门
2022-11-17 20:20:09 +08:00
export const deleteDeptApi = async (id: number) => {
return await request.delete({ url: '/system/dept/delete?id=' + id })
2022-07-18 19:06:37 +08:00
}