index.ts 911 B

1234567891011121314151617181920212223242526272829303132
  1. import { defHttp } from '@/config/axios'
  2. import type { DeptVO } from './types'
  3. // 查询部门(精简)列表
  4. export const listSimpleDeptApi = () => {
  5. return defHttp.get({ url: '/system/dept/list-all-simple' })
  6. }
  7. // 查询部门列表
  8. export const getDeptPageApi = ({ params }) => {
  9. return defHttp.get<PageResult<DeptVO>>({ url: '/system/dept/list', params })
  10. }
  11. // 查询部门详情
  12. export const getDeptApi = (id: number) => {
  13. return defHttp.get<DeptVO>({ url: '/system/dept/get?id=' + id })
  14. }
  15. // 新增部门
  16. export const createDeptApi = (params: DeptVO) => {
  17. return defHttp.post({ url: '/system/dept/create', data: params })
  18. }
  19. // 修改部门
  20. export const updateDeptApi = (params: DeptVO) => {
  21. return defHttp.put({ url: '/system/dept/update', data: params })
  22. }
  23. // 删除部门
  24. export const deleteDeptApi = (id: number) => {
  25. return defHttp.delete({ url: '/system/dept/delete?id=' + id })
  26. }