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


/**
 * 清单初始化
 * ocId
 * targetId ，targetType，targetTitle，targetGroupId,，targetGroupName
 * checklistId
 */
export function checklistInit(data) {
  return request({
    url: "/checklist/point/record/init",
    method: 'POST',
	data
  })
}

export function updateChecklistPoint(data) {
  return request({
    url: "/checklist/point/record/doing/update",
    method: 'PUT',
    data
  })
}
export function getchecklistRecord(checklistId,recordId) {
  return request({
    url: `/checklist/point/record/view/${recordId}/${checklistId}`,
    method: 'GET'
  })
}
export function getchecklistByPage(data) {
  return request({
    url: "/checklist/record/page",
    method: 'GET',
	data
  })
}
// 巡检完成
export function checklistComplete(recordId) {
  return request({
    url: `/checklist/point/record/complete/${recordId}`,
    method: 'PUT'
  })
}
// 巡检放弃
export function checklistCancel(recordId) {
  return request({
    url: `/checklist/point/record/cancel/${recordId}`,
    method: 'PUT'
  })
}
// 批量操作
export function checklistBatchUpdate(recordId,checkResult) {
  return request({
    url: `/checklist/point/record/doing/batchUpdate/${recordId}/${checkResult}`,
    method: 'PUT'
  })
} 

// 批量操作
export function getDoingPoint(checklistId,itemId,recordId,pointId) {
  return request({
    url: `/checklist/point/record/doing/${recordId}/${checklistId}/${itemId}/${pointId}`,
  })
} 
export function getPoint(checklistId,itemId,recordId,pointId) {
  return request({
    url: `/checklist/point/record/${recordId}/${checklistId}/${itemId}/${pointId}`,
  })
} 