
import request from '@/utils/request'

// 查询我的客户
export function getRegionList(query) {
  return request({
    url: '/region/list',
    method: 'get',
    params: query
  })
}

export function getRegionCoord(query) {
  return request({
    url: '/region/coordinate',
    method: 'get',
    params: query
  })
}

export function getRegionCoordQuery(query) {
  return request({
    url: '/region/coordinate',
    method: 'post',
    data: query
  })
}

export function getGridRegionCoord(query) {
  return request({
    url: '/region/grid',
    method: 'post',
    data: query
  })
}


export function getRegionRemark(query) {
  return request({
    url: '/region/remark',
    method: 'get',
    params: query
  })
}

export function updateRegionRemark(query) {
  return request({
    url: '/region/remark/update',
    method: 'post',
    data: query
  })
}

export function getCustList(code, params) {
  return request({
    url: `/region/cust/list?code=${code}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&custType=${params.custType}`,
    method: 'get',
  })
}

// 以下特色区域接口
// 查看特色区域/获取图层列表
export function queryAreas(query) {
  return request({
    url: '/draw/layer/list',
    method: 'get',
    params: query
  })
}
// 新增特色区域/创建图层
export function addAreas(query) {
  return request({
    url: '/draw/layer/add',
    method: 'post',
    data: query
  })
}
// 修改特色区域/编辑图层信息
export function updateAreas(query) {
  return request({
    url: '/draw/layer/edit/info',
    method: 'post',
    data: query
  })
}
// 删除特色区域/批量删除图层
export function removeAreas(query) {
  return request({
    url: '/draw/layer/delete',
    method: 'post',
    data: query
  })
}
// 查看指定区域覆盖物/获取图层内图形列表
export function lookAreasMap(query) {
  return request({
    url: '/draw/shape/list',
    method: 'get',
    params: query
  })
}
// 校验图形wkt重叠
export function checkWkt(query) {
  return request({
    url: '/draw/shape/check/wkt',
    method: 'post',
    data: query
  })
}
// 新增特色区域详情/创建图形
export function addAreasInfo(query) {
  return request({
    url: '/draw/shape/add',
    method: 'post',
    data: query
  })
}
// 修改特色区域详情/编辑图形信息
export function updateAreasInfo(query) {
  return request({
    url: '/draw/shape/edit/info',
    method: 'post',
    data: query
  })
}
// 删除特色区域详情/批量删除图形
export function removeAreasInfo(query) {
  return request({
    url: '/draw/shape/delete',
    method: 'post',
    data: query
  })
}
// 调整图形边界
export function drawAreaShape(query) {
  return request({
    url: '/draw/shape/edit/wkt',
    method: 'post',
    data: query
  })
}
// 判断是否有编辑权限
export function checkEdit(query) {
  return request({
    url: '/draw/shape/edit/check',
    method: 'get',
    params: query
  })
}
// 获取图形内客户列表
export function shapeCustList(shapeId, params) {
  return request({
    url: `/draw/shape/cust/list?shapeId=${shapeId}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&custType=${params.custType}`,
    method: 'get'
  })
}
// 获取图层内可选图形列表
export function getAreaShapeAvailableApi(query) {
  return request({
    url: '/draw/shape/list/available',
    method: 'get',
    params: query
  })
}
// 虚拟网格分配规则反显图层名称
export function getRuleShape(query) {
  return request({
    url: '/draw/layer/rule',
    method: 'get',
    params: query
  })
}

// 虚拟网格分配规则
export function getRuleVirtual(query) {
  return request({
    url: '/grid/virtual/rule/search',
    method: 'get',
    params: query
  })
}

// 区域重新申请
export function approveAgainApi(query) {
  return request({
    url: '/draw/shape/reAudit',
    method: 'post',
    data: query
  })
}

// 区域审批通过/拒绝
export function approveApi(query) {
  return request({
    url: '/draw/audit/pass',
    method: 'post',
    data: query
  })
}

// 获取区域审核数量
export function getDrawCountApi(query) {
  return request({
    url: '/draw/audit/count',
    method: 'get',
    params: query
  })
}

// 查看特色网格-网格类型
export function queryAreasSpe(query) {
  return request({
    url: '/draw/layer/valid/list',
    method: 'get',
    params: query
  })
}


// 特色区域地质解析
export function queryAddressList(query) {
  return request({
    url: '/address/analyse/placeSearch',
    method: 'get',
    params: query
  })
}

// 
export function getCustCount(query) {
  return request({
    url: '/draw/layer/map/cust/count',
    method: 'get',
    params: query
  })
}