import { http as requestClient } from '@/http/http'

enum Api {
  base = '/taskCheckItem/item',
  childBase = '/taskCheckSubItem/item',
  handle = '/taskCheck/check/handle',
}
// 查询任务检查项列表
export function getChecktItemsByTaskId(params: any) {
  return requestClient.get(`${Api.base}/list`, params)
}

// 查询任务检查子项列表
export function getCheckSubItemsByTaskId(params: any) {
  return requestClient.get(`${Api.childBase}/list`, params)
}

// 提交任务检查子项日志
export function submitCheckLogs(checkId: number, params: any) {
  return requestClient.put(`${Api.childBase}/handle/${checkId}`, params)
}

// 处理任务检查项
export function handleCheckTask(checkId: number) {
  return requestClient.put(`${Api.handle}/${checkId}`)
}
