import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/grid/grid-sys/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getAgencysByAreaCode = (params) => {
  return request({
    url: '/api/grid/grid-community/getAgencysByAreaCode',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getAgencyListForCustom = (params) => {
  return request({
    url: '/api/grid/grid-community/getAgencyListForCustom',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getDetail = (params) => {
  return request({
    url: '/api/grid/grid-sys/detail',
    method: 'get',
    params: params
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/grid/grid-sys/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/grid/grid-sys/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/grid/grid-sys/submit',
    method: 'post',
    data: row
  })
}
export const getStaticData = (params) => {
  return request({
    url: '/api/grid/grid-sys/static',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const smartDeviceStatic = (params) => {
  return request({
    url: '/api/grid/grid-sys/smartDeviceStatic',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const houseuserList = (gridId,current, size, params) => {
  return request({
    url: '/api/grid/grid-sys/houseuserList',
    method: 'get',
    params: {
      gridId,
      ...params,
      current,
      size,
    }
  })
}
export const smartDeviceList = (gridId,current, size, params) => {
  return request({
    url: '/api/grid/grid-sys/smartDeviceList',
    method: 'get',
    params: {
      gridId,
      ...params,
      current,
      size,
    }
  })
}
export const getLoadJson = () => {
  return request({
    url: 'http://139.9.103.171/mapData/zhengzhou/load.geojson',
    method: 'get',
    params: {}
  })
}
