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

// 获取列表数据  atcompany/query/{pageNo}/{pageSize}
export const getTenantsList = params => {
  const url = `/atcompany/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'POST'
  })
}

// 删除
export const tenantsDelete = params => {
  return axios({
    url: `/atcompany/delete/${params.id}`,
    data: {},
    method: 'get'
  })
}
// 查详情
export const tenantsDetail = params => {
  return axios({
    url: `/atcompany/findById/${params.id}`,
    data: {},
    method: 'get'
  })
}

// 保存
export const tenantsSave = params => {
  return axios({
    url: '/atcompany/save',
    data: params,
    method: 'POST'
  })
}
// 查询省
export const getProvince = () => {
  return axios({
    url: `/area/PROVINCE`,
    headers: {
      'USER-TERM-TYPE': 'pc',
      'App-Type': 9
    },
    method: 'get'
  })
}
// 查询市
export const getCityByPro = params => {
  return axios({
    url: `/area/CITY/${params.id}`,
    headers: {
      'USER-TERM-TYPE': 'pc',
      'App-Type': 9
    },
    method: 'get'
  })
}
// 查询区
export const getDistrictByCity = params => {
  return axios({
    url: `/area/DISTRICT/${params.id}`,
    headers: {
      'USER-TERM-TYPE': 'pc',
      'App-Type': 9
    },
    method: 'get'
  })
}
