import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DataForm,DataVO,DataQuery } from './types';

/**
 * 客户属性分析-客户区域分析汇总
 * @param query
 * @returns {*}
 */

export const countryAnalytics = (query?: DataQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/customer/attribute/customer-country-analytics-total',
      method: 'post',
      data: query
    });
  };

/**
 * 客户属性分析-客户等级分析汇总
 * @param query
 * @returns {*}
 */

export const levelAnalytics = (query?: DataQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/customer/attribute/customer-level-analytics-total',
      method: 'post',
      data: query
    });
  };

/**
 * 客户属性分析-客户来源分析汇总
 * @param query
 * @returns {*}
 */

export const sourceAnalytics = (query?: DataQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/customer/attribute/customer-source-analytics-total',
      method: 'post',
      data: query
    });
  };

  /**
 * 客户属性分析-客户状态分析汇总
 * @param query
 * @returns {*}
 */

export const statusAnalytics = (query?: DataQuery & PageQuery): AxiosPromise => {
    return request({
      url: '/customer/attribute/customer-status-analytics-total',
      method: 'post',
      data: query
    });
  };

    /**
 * top10
 * @param query
 * @returns {*}
 */

export const getSalesDealRankTop = (query?: DataQuery & PageQuery): AxiosPromise => {
  return request({
    url: '/process/analysis/get_sales_deal_rank_top',
    method: 'post',
    data: query
  });
};

    /**
 * 区域排名
 * @param query
 * @returns {*}
 */

export const getSalesSpreadSummaryTotal = (query?: DataQuery & PageQuery): AxiosPromise => {
  return request({
    url: '/process/analysis/get_sales_area_spread_summary_total',
    method: 'post',
    data: query
  });
};
