import request from '@/utils/request'
import qs from 'qs'

const baseUrl = '/api/upcloud-base-wh-control-mysql-eistest/sxcardirection'

export const api = {
  queryList: baseUrl + '/get-sxcardirection-page',

  addItem: baseUrl + '/save',
  updateItem: baseUrl + '/update',

  deleteList: baseUrl + '/deleted',
}

// export function queryItem(parameter) {
//     return request({
//         method: 'get',
//         url: api.queryItem,
//         params: parameter,
//     })
// }

export function addItem(parameter) {
  return request({
    method: 'post',
    url: api.addItem,
    data: parameter,
  })
}

export function uploadItem(parameter) {
  return request({
    method: 'post',
    url: api.updateItem,
    data: parameter,
  })
}

export function deleteList(parameter) {
  return request({
    method: 'post',
    url: api.deleteList,
    //data: {'ids': qs.stringify({1})},
    data: qs.stringify(parameter),
    // headers: {
    //     'content-type': 'application/x-www-form-urlencoded'
    // }
  })
}

export function getAllStoreArea() {
  return request({
    method: 'get',
    url: '/api/upcloud-base-wh-dev-mysql-eistest/storeArea/getAll-storeArea?pageNum=1&pageSize=1000',
  })
}
