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

35 lines
910 B
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 { DeptVO } from './types'
2022-07-19 22:33:54 +08:00
const request = useAxios()
2022-07-18 19:06:37 +08:00
// 查询部门(精简)列表
export const listSimpleDeptApi = () => {
2022-07-19 22:33:54 +08:00
return request.get({ url: '/system/dept/list-all-simple' })
2022-07-18 19:06:37 +08:00
}
// 查询部门列表
2022-07-19 22:33:54 +08:00
export const getDeptPageApi = (params) => {
return request.get({ url: '/system/dept/list', params })
2022-07-18 19:06:37 +08:00
}
// 查询部门详情
export const getDeptApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.get({ url: '/system/dept/get?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 新增部门
2022-07-19 22:33:54 +08:00
export const createDeptApi = (data: DeptVO) => {
return request.post({ url: '/system/dept/create', data: data })
2022-07-18 19:06:37 +08:00
}
// 修改部门
export const updateDeptApi = (params: DeptVO) => {
2022-07-19 22:33:54 +08:00
return request.put({ url: '/system/dept/update', data: params })
2022-07-18 19:06:37 +08:00
}
// 删除部门
export const deleteDeptApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.delete({ url: '/system/dept/delete?id=' + id })
2022-07-18 19:06:37 +08:00
}