import request from '@/utils/request'

// 查询运营区列表
export function listArea(query) {
  return request({
    url: '/system/area/list',
    method: 'get',
    params: query
  })
}

// 查询运营区详细
export function getArea(areaId) {
  return request({
    url: '/system/area/' + areaId,
    method: 'get'
  })
}
export function getStatistics(areaId) {
  return request({
    url: '/index/statistics?areaId=' + areaId,
    method: 'get'
  })
}
// 新增运营区
export function addArea(data) {
  return request({
    url: '/system/area',
    method: 'post',
    data: data
  })
}
// 根据token获取运营区
export function getArealist() {
  return request({
    url: '/index/getAreaList',
    method: 'get',

  })
}
// 获取首页统计
export function getAdminStatistics() {
  return request({
    url: '/index/admim/statistics',
    method: 'get',

  })
}
// 修改运营区
export function updateArea(data) {
  return request({
    url: '/system/area',
    method: 'put',
    data: data
  })
}
// 修改导览
export function putguide(data) {
  return request({
    url: '/system/area/guide',
    method: 'put',
    data: data
  })
}
// 修改运营区
export function updateArea2(data) {
  return request({
    url: '/system/area/guide',
    method: 'put',
    data: data
  })
}

// 删除运营区
export function delArea(areaId) {
  return request({
    url: '/system/area/' + areaId,
    method: 'delete'
  })
}

// 获取字典选择框列表
export function optionselect() {
  return request({
    url: '/system/area/optionselect',
    method: 'get'
  })
}

// 根据运营商id获取运营商列表
export function selectAreaListByDeptId(deptId) {
  return request({
    url: '/system/area/selectAreaListByDeptId/'+deptId,
    method: 'get'
  })
}

// 根据运营区id获取运营商
export function selectDeptByAreaId(areaId) {
  return request({
    url: '/system/area/selectDeptByAreaId/'+areaId,
    method: 'get'
  })
}
