import { get, post, put } from '../../http'

// 模式管理
export const getModeList = async (
  params?: Record<string, any>,
): Promise<any> => {
  return await get<any>('/inspectorMode/list', params)
}

// 模式编辑
export const putMode = async (data: Record<string, any>): Promise<any> => {
  return await put('/inspectorMode', data)
}

// 云督学订单汇总
export const getOrderSummary = async (
  data: Record<string, any>,
): Promise<any> => {
  return await post<any>('/inspectorOrder/collect', data)
}

// 云督学订单列表
export const getOrderList = async (data: Record<string, any>): Promise<any> => {
  return await post<any>('/inspectorOrder/list', data)
}

// 添加督学师
export const addTeacher = async (data: Record<string, any>): Promise<any> => {
  return await post<any>('/inspectorTeacher/add', data)
}

// 编辑督学师
export const editTeacher = async (data: Record<string, any>): Promise<any> => {
  return await post<any>('/inspectorTeacher/update', data)
}

// 删除督学师
export const removeTeacher = async (
  data: Record<string, any>,
): Promise<any> => {
  return await post<any>(`/inspectorTeacher/deleteById?id=${data}`)
}

// 督学师列表查询
export const getTeacherList = async (
  data: Record<string, any>,
): Promise<any> => {
  return await post<any>('/inspectorTeacher/list', data)
}

// 督学师课表信息日期查询
export const getDate = async (data: Record<string, any>): Promise<any> => {
  return await get<any>(`/inspectorTeacher/getCourseTableById?id=${data}`)
}

// 督学师状态切换
export const changeStatus = async (data: Record<string, any>): Promise<any> => {
  return await post(
    `/inspectorTeacher/status_switch?id=${data.id}&state=${data.state}`,
  )
}

// 可分配督学师
export const getUsableTeacherList = async (
  data?: Record<string, any>,
): Promise<any> => {
  return await post<any>('/inspectorTeacherAllocation/getUsableTeacher', data)
}

// 督学师分配列表
export const getAllocationList = async (
  data: Record<string, any>,
): Promise<any> => {
  return await post<any>('/inspectorTeacherAllocation/list', data)
}

// 督学师分配
export const allocation = async (data: Record<string, any>): Promise<any> => {
  return await post<any>('/inspectorTeacherAllocation/allocate', data)
}

// id获取学生课表信息
export const getCourse = async (data: Record<string, any>): Promise<any> => {
  return await get<any>(
    `/inspectorTeacherAllocation/getStuCourseById?id=${data}`,
  )
}

// 通过课表时间查询课表学生
export const getStudent = async (data: Record<string, any>): Promise<any> => {
  return await get(
    `/inspectorTeacher/getCourseTabletStudentVoByTime?id=${data.id}&courseDate=${data.courseDate}`,
  )
}
