team.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { ApiInstance } from '../type'
  2. export interface AddTeamProps {
  3. name: string,
  4. deptId: number,
  5. managerId: number,
  6. systemCode: string,
  7. attribute: number, // 1 团队 2 渠道 3 电销
  8. describeInformation?: string
  9. }
  10. interface SearchTeamProps {
  11. attribute: number, // 1 团队 2 渠道 3 电销
  12. param?: string,
  13. }
  14. export interface EditTeamProps extends AddTeamProps {
  15. id:string
  16. }
  17. interface GetTeamUserProps {
  18. id: string,
  19. [key: string]: any
  20. }
  21. interface DeleteAssociatedUsers {
  22. id: string,
  23. userIds: string[]
  24. }
  25. interface SetResponsiblePersonProps {
  26. id: string,
  27. managerId: string
  28. }
  29. const teamApi = (axiosInstance: ApiInstance) => ({
  30. teamList: (data: SearchTeamProps) => axiosInstance.post('/sysOrganization/leftList', data), // 查询(不分页)
  31. addTeam: (data: AddTeamProps) => axiosInstance.post('/sysOrganization/save', data), // 新增
  32. queryPageList: (data: any) => axiosInstance.post('/sysOrganization/queryPageList', data), // 查询(分页)
  33. deleteById: (data: string) => axiosInstance.get(`/sysOrganization/deleteById?id=${data}`, ), // 删除团队
  34. updateTeam: (data: EditTeamProps) => axiosInstance.post('/sysOrganization/update', data), // 编辑团队
  35. getTeamUser: (data: GetTeamUserProps) => axiosInstance.post('/sysOrganization/getTeamUserPage', data), // 获取团队成员
  36. deleteAssociatedUsers: (data: DeleteAssociatedUsers) => axiosInstance.post('/sysOrganization/deleteAssociatedUsers', data), // 删除人员
  37. setResponsiblePerson: (data: SetResponsiblePersonProps) => axiosInstance.post('/sysOrganization/setResponsiblePerson', data), // 设置负责人
  38. })
  39. export default teamApi