import { request } from '@/api/_service'

const BASE = 'quality_control/xqc/inspection_item/'

function apiParams (data = {}, method = 'get.quality.inspection_item.list', platform = 'api') {
  return { method, platform, ...data }
}
export function fetchInspectionItemsList (data = {}) {
  return request({
    url: BASE + 'list',
    method: 'post',
    data: apiParams(data, 'get.quality.inspection_item.list', 'api')
  })
}

export function createInspectionItems (data = {}) {
  return request({
    url: BASE + 'add',
    method: 'post',
    data: apiParams(data, 'add.quality.inspection_item.add', 'api')
  })
}

export function editInspectionItems (data = {}) {
  return request({
    url: BASE + 'set',
    method: 'post',
    data: apiParams(data, 'set.quality.inspection_item.set', 'api')
  })
}

export function deleteInspectionItems (data = {}) {
  return request({
    url: BASE + 'del',
    method: 'post',
    data: apiParams(data, 'del.quality.inspection_item.del', 'api')
  })
}

