import { axios } from '@/utils/request'

// 网点列表
export const stationList = (params) => {
  const url = `/station/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 查网点列表  不分页
export const stationListQuery = (params) => {
  return axios.request({
    url: `/station/queryList`,
    method: 'post',
    data: params
  })
}
// 网点详情
export const stationFind = (params) => {
  return axios.request({
    url: `/station/findById/${params.id}`,
    method: 'get'
  })
}
// 网点保存
export const stationSave = (params) => {
  return axios.request({
    url: '/station/save',
    data: params,
    method: 'post'
  })
}
// 网点删除
export const stationDel = (params) => {
  return axios.request({
    url: `/station/delete/${params.id}`,
    method: 'get'
  })
}
// 设备绑定
export const stationBind = (params) => {
  return axios.request({
    url: `/station/binding`,
    method: 'post',
    data: params
  })
}
// 设备解绑
export const stationUnBind = (params) => {
  return axios.request({
    url: `/station/remBinding`,
    method: 'post',
    data: params
  })
}
// 查询省
export const getProvince = () => {
  return axios.request({
    url: `/area/PROVINCE`,
    method: 'get'
  })
}
// 查询市
export const getCityByPro = params => {
  return axios.request({
    url: `/area/CITY/${params.id}`,
    method: 'get'
  })
}
// 查询区
export const getDistrictByCity = params => {
  return axios.request({
    url: `/area/DISTRICT/${params.id}`,
    method: 'get'
  })
}
