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

const BASE = 'planning_production/production_batch_management/batch_tray/'

function apiParams (method, data = {}) {
  return {
    method: `planning_production_production_batch_management_batch_tray_${method}`,
    platform: 'background',
    ...data
  }
}

export function getBatchTrayList (data) {
  return request({
    url: BASE + 'list',
    method: 'get',
    params: apiParams('list', data)
  })
}

export function trayUnbinding (data) {
  return request({
    url: BASE + 'unbinding',
    method: 'get',
    params: apiParams('unbinding', data)
  })
}

export function trayInactivity (data) {
  return request({
    url: BASE + 'inactivity',
    method: 'get',
    params: apiParams('inactivity', data)
  })
}

export function getBatteryParam (data) {
  return request({
    url: BASE + 'get_battery_param',
    method: 'get',
    params: apiParams('get_battery_param', data)
  })
}
