import request from '@/config/axios'

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

// 设备维修班组 API
export const RepairTeamApi = {
  // 查询设备维修班组分页
  getRepairTeamPage: async (params: any) => {
    return await request.get({ url: `/device/repair-team/page`, params })
  },

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

  // 新增设备维修班组
  createRepairTeam: async (data: RepairTeamVO) => {
    return await request.post({ url: `/device/repair-team/create`, data })
  },

  // 修改设备维修班组
  updateRepairTeam: async (data: RepairTeamVO) => {
    return await request.put({ url: `/device/repair-team/update`, data })
  },

  // 删除设备维修班组
  deleteRepairTeam: async (id: number) => {
    return await request.delete({ url: `/device/repair-team/delete?id=` + id })
  },

  // 导出设备维修班组 Excel
  exportRepairTeam: async (params) => {
    return await request.download({ url: `/device/repair-team/export-excel`, params })
  },
}
