index.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import request from '@/config/axios'
  2. export interface DeptVO {
  3. id?: number
  4. name: string
  5. parentId: number
  6. status: number
  7. sort: number
  8. leaderUserId: number
  9. phone: string
  10. email: string
  11. }
  12. export interface DeptPageReqVO {
  13. name?: string
  14. status?: number
  15. }
  16. // 查询部门(精简)列表
  17. export const listSimpleDeptApi = async () => {
  18. return await request.get({ url: '/system/dept/list-all-simple' })
  19. }
  20. // 查询部门列表
  21. export const getDeptPageApi = async (params: DeptPageReqVO) => {
  22. return await request.get({ url: '/system/dept/list', params })
  23. }
  24. // 查询部门详情
  25. export const getDeptApi = async (id: number) => {
  26. return await request.get({ url: '/system/dept/get?id=' + id })
  27. }
  28. // 新增部门
  29. export const createDeptApi = async (data: DeptVO) => {
  30. return await request.post({ url: '/system/dept/create', data: data })
  31. }
  32. // 修改部门
  33. export const updateDeptApi = async (params: DeptVO) => {
  34. return await request.put({ url: '/system/dept/update', data: params })
  35. }
  36. // 删除部门
  37. export const deleteDeptApi = async (id: number) => {
  38. return await request.delete({ url: '/system/dept/delete?id=' + id })
  39. }