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

const BASE = 'quality_control/xqc/inspection_standard/'

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

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

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

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

