import request from '@/config/axios'

// 设备巡检班组 VO
export interface InspectionTeamVO {
  id: number // 主键ID
  teamName: string // 班组名称
  teamStaffIds: string // 班组成员ID，逗号分隔
  teamStaffNames: string // 班组成员名称，逗号分隔
  state: number // 状态
  sort: number // 排序
}

// 设备巡检班组 API
export const InspectionTeamApi = {
  // 查询设备巡检班组分页
  getInspectionTeamPage: async (params: any) => {
    return await request.get({ url: `/device/inspection-team/page`, params })
  },

  // 查询设备巡检班组详情
  getInspectionTeam: async (id: number) => {
    return await request.get({ url: `/device/inspection-team/get?id=` + id })
  },

  // 新增设备巡检班组
  createInspectionTeam: async (data: InspectionTeamVO) => {
    return await request.post({ url: `/device/inspection-team/create`, data })
  },

  // 修改设备巡检班组
  updateInspectionTeam: async (data: InspectionTeamVO) => {
    return await request.put({ url: `/device/inspection-team/update`, data })
  },

  // 删除设备巡检班组
  deleteInspectionTeam: async (id: number) => {
    return await request.delete({ url: `/device/inspection-team/delete?id=` + id })
  },

  // 批量删除设备巡检班组
  deleteInspectionTeamList: async (ids: number[]) => {
    return await request.delete({ url: `/device/inspection-team/delete-list?ids=` + ids  })
  },

  // 导出设备巡检班组 Excel
  exportInspectionTeam: async (params) => {
    return await request.download({ url: `/device/inspection-team/export-excel`, params })
  },
}
