import qs from 'qs'
import request from '../index'

// 列表
export function getLabelList(params: object) {
  return request({
    url: '/system/rfid/listPage',
    method: 'get',
    params,
  })
}

// 删除
export function delLabel(data: object) {
  return request({
    url: '/system/rfid/remove',
    method: 'post',
    data,
  })
}
// 导出
export function importLabel(data: object) {
  return request({
    url: '/system/rfid/export',
    method: 'post',
    params: data,
    responseType: 'blob',
    // paramsSerializer: () => qs.stringify(params, { arrayFormat: 'repeat' }),
    // paramsSerializer: (params) => {
    // 	return qs.stringify(params, { indices: false })
    // },
    paramsSerializer: {
      serialize: params => qs.stringify(params, { arrayFormat: 'repeat' }),
    },
  })
}
// 批量导入

export function batchImportLabel(data: object) {
  return request({
    url: '/system/rfid/importRfid',
    method: 'post',
    data,
  })
}
