import ajax from './ajax'
import { LOCATION_URL } from '@/config/config'

// 1. 定义基础路径
// const BASE_URL = '/huiqicha'
const BASE_URL = LOCATION_URL
// const BASE_URL = 'https://lhlas-dev.zrubft.com'
// const BASE_URL = 'http://158.226.90.148:10022'
// 行政网格
//查询零售汇总
export const getCollectList1 = (params) => ajax(BASE_URL + 
    `/ibs/GridCount/LsList?town=${params.town}&village=${params.village}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询零售客户明细
export const getColDetailList1 = (params) => ajax(BASE_URL + 
    `/ibs/GridCount/LsCustList?custName=${params.custName}&custIdc=${params.custIdc}&socialCreditCode=${params.socialCreditCode}&regionCode=${params.regionCode}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询公司汇总
export const getCollectList2 = (params) => ajax(BASE_URL + 
    `/ibs/GridCount/GsList?town=${params.town}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询公司客户明细
export const getColDetailList2 = (params) => ajax(BASE_URL + 
    `/ibs/GridCount/GsCustList?custName=${params.custName}&custIdc=${params.custIdc}&socialCreditCode=${params.socialCreditCode}&regionCode=${params.regionCode}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

// 自定义名单统计
//查询零售汇总
export const getCollectListNm1 = (params) => ajax(BASE_URL + 
    `/ibs/gridVirtualCount/lsList?gridName=${params.gridName}&gridType=${params.gridType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询零售客户明细
export const getColDetailListNm1 = (params) => ajax(BASE_URL + 
    `/ibs/gridVirtualCount/lsCustList?custName=${params.custName}&custIdc=${params.custIdc}&socialCreditCode=${params.socialCreditCode}&gridId=${params.gridId}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询公司汇总
export const getCollectListNm2 = (params) => ajax(BASE_URL + 
    `/ibs/gridVirtualCount/gsList?gridName=${params.gridName}&gridType=${params.gridType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询公司客户明细
export const getColDetailListNm2 = (params) => ajax(BASE_URL + 
    `/ibs/gridVirtualCount/gsCustList?custName=${params.custName}&custIdc=${params.custIdc}&socialCreditCode=${params.socialCreditCode}&gridId=${params.gridId}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

// 自定义地图网格报表
//查询零售汇总
export const getCollectListMap1 = (params) => ajax(BASE_URL + 
    `/system/gridShapeCount/lsList?gridName=${params.gridName}&shapeType=${params.shapeType}&shapeName=${params.shapeName}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询零售客户明细
export const getColDetailListMap1 = (params) => ajax(BASE_URL + 
    `/system/gridShapeCount/lsCustList?custName=${params.custName}&custIdc=${params.custIdc}&socialCreditCode=${params.socialCreditCode}&gridId=${params.gridId}&shapeId=${params.shapeId}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询公司汇总
export const getCollectListMap2 = (params) => ajax(BASE_URL + 
    `/system/gridShapeCount/gsList?gridName=${params.gridName}&gridType=${params.gridType}&shapeName=${params.shapeName}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

//查询公司客户明细
export const getColDetailListMap2 = (params) => ajax(BASE_URL + 
    `/system/gridShapeCount/gsCustList?custName=${params.custName}&custIdc=${params.custIdc}&socialCreditCode=${params.socialCreditCode}&shapeId=${params.shapeId}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&dt=${params.dt}`,
     {}, 'GET');

// 查询热力图数据-乡镇
export const searchEchartTownData = (params) => ajax(BASE_URL + 
    `/admin/region/town?itemIdx=${params.itemIdx}&branchName=${params.branchName}&outletName=${params.outletName}&nickName=${params.nickName}&opsDept=${params.opsDept}&dt=${params.dt}`,
     {}, 'GET');

// 查询热力图数据-村
export const searchEchartVillageData = (params) => ajax(BASE_URL + 
    `/admin/region/village?itemIdx=${params.itemIdx}&branchName=${params.branchName}&outletName=${params.outletName}&nickName=${params.nickName}&opsDept=${params.opsDept}&code=${params.code}&dt=${params.dt}`,
     {}, 'GET');

// 查询热力图指标
export const getPerIndcList = (params) => ajax(BASE_URL + 
    `/admin/region/index?opsDept=${params.opsDept}`,
     {}, 'GET');

// 查询热力图详情数据
export const getHotMapInfo = (params) => ajax(BASE_URL + 
    `/admin/region/detail?itemIdx=${params.itemIdx}&opsDept=${params.opsDept}&code=${params.code}`,
     {}, 'GET');

// 查询走访热力图数据-按区间查
export const getPointInfo1 = (params) => ajax(BASE_URL + 
    `/trajectory/list?timeInterval=${params.timeInterval}&headId=${params.headId}&branchId=${params.branchId}&outletId=${params.outletId}&userName=${params.userName}`,
     {}, 'GET');

// 查询走访热力图数据-按日期查
export const getPointInfo2 = (params) => ajax(BASE_URL + 
    `/trajectory/date/list?date=${params.date}&headId=${params.headId}&branchId=${params.branchId}&outletId=${params.outletId}&userName=${params.userName}`,
     {}, 'GET');

 // 区域类型
 export const queryAreas = (params) => ajax(BASE_URL + 
    `/draw/layer/list`,
     {}, 'GET');

// 归属机构
export const getDeptTree = (params) => ajax(BASE_URL + 
    `/system/user/deptTree`,
     {}, 'GET');
export const getDeptTreeAll = (params) => ajax(BASE_URL + 
    `/system/user/deptTreeAll`,
    {}, 'GET');

// 客户经理
export const getUserListByDeptIds = (deptid) => ajax(BASE_URL + 
    `/system/user/treeUser?deptid=${deptid}`,
     {}, 'GET');
export const getUserAllListByDeptIds = (deptid) => ajax(BASE_URL + 
    `/system/user/userAll?deptid=${deptid}`,
     {}, 'GET');


    


