import request from '@/config/axios'

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

// 设备保养班组 API
export const MaintenanceTeamApi = {
  // 查询设备保养班组分页
  getMaintenanceTeamPage: async (params: any) => {
    return await request.get({ url: `/device/maintenance-team/page`, params })
  },

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

  // 新增设备保养班组
  createMaintenanceTeam: async (data: MaintenanceTeamVO) => {
    return await request.post({ url: `/device/maintenance-team/create`, data })
  },

  // 修改设备保养班组
  updateMaintenanceTeam: async (data: MaintenanceTeamVO) => {
    return await request.put({ url: `/device/maintenance-team/update`, data })
  },

  // 删除设备保养班组
  deleteMaintenanceTeam: async (id: number) => {
    return await request.delete({ url: `/device/maintenance-team/delete?id=` + id })
  },

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

  // 导出设备保养班组 Excel
  exportMaintenanceTeam: async (params) => {
    return await request.download({ url: `/device/maintenance-team/export-excel`, params })
  },
}
