import {request} from '@/utils/request.js'

/**
 * 根据Id获取Checklist Score Record Data
 * @param recordId
 * @param checklistId
 * @returns
 */
export function getChecklistHazardRecordViewById(recordId, checklistId) {
  return request({
    url: `/checklist/hazard/record/view/${recordId}/${checklistId}`,
    method: 'GET'
  })
}

/**
 * 初始化
 * @returns
 * @param data
 */
export function initChecklistHazardRecord(data) {
  return request({
    url: `/checklist/hazard/record/init`,
    method: 'POST',
    data
  })
}

/**
 * 根据Id获取Checklist Score Record Data
 * @param recordId
 * @param checklistId
 * @returns
 */
export function completeChecklistDoing(recordId) {
  return request({
    url: `/checklist/hazard/record/complete/${recordId}`,
    method: 'PUT'
  })
}

/**
 * 根据Id获取Checklist Score Record Data
 * @param recordId
 * @returns
 */
export function cancelChecklistDoing(recordId) {
  return request({
    url: `/checklist/point/record/complete/${recordId}`,
    method: 'PUT'
  })
}

/**
 * 更新CheckTaskDoing Item
 * @param data
 * @returns
 */
export function updateChecklistHazardRecordDoing(data) {
  return request({
    url: `/checklist/hazard/record/doing/update`,
    method: 'PUT',
    data
  })
}

/**
 * 批量更新CheckTaskDoing Item
 * @returns
 * @param recordId
 * @param checkResult
 */
export function batchUpdateChecklistHazardRecordDoing(recordId, checkResult) {
  return request({
    url: `/checklist/hazard/record/doing/batchUpdate/${recordId}/${checkResult}`,
    method: 'PUT'
  })
}

