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

const BASE = 'quality_control/xqc/aql_config/'

function apiParams (data = {}, method = 'quality_control_xqc_aql_config_list', platform = 'background') {
  return { method, platform, ...data }
}
export function fetchAqlStandardsList (data = {}) {
  return request({
    url: BASE + 'list',
    method: 'get',
    params: apiParams(data, 'quality_control_xqc_aql_config_list', 'background')
  })
}

export function createAqlStandards (data = {}) {
  return request({
    url: BASE + 'create',
    method: 'post',
    data: apiParams(data, 'quality_control_xqc_aql_config_create', 'api')
  })
}

export function editAqlStandards (data = {}) {
  return request({
    url: BASE + 'edit',
    method: 'post',
    data: apiParams(data, 'quality_control_xqc_aql_config_edit', 'api')
  })
}

export function deleteAqlStandards (data = {}) {
  return request({
    url: BASE + 'delete',
    method: 'post',
    data: apiParams(data, 'quality_control_xqc_aql_config_delete', 'api')
  })
}

