gaoluyang
2026-06-29 27cd042df9aca0383a49f3514bc21958dd890912
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import type { PageParam } from '../../../packages/effects/request/src';
 
import { requestClient } from '#/api/request';
 
export namespace CrmStatisticsPortraitApi {
  /** 客户基础统计响应 */
  export interface CustomerBaseRespVO {
    customerCount: number;
    dealCount: number;
    dealPortion: number | string;
  }
 
  /** 客户行业统计响应 */
  export interface CustomerIndustryRespVO extends CustomerBaseRespVO {
    industryId: number;
    industryPortion: number | string;
  }
 
  /** 客户来源统计响应 */
  export interface CustomerSourceRespVO extends CustomerBaseRespVO {
    source: number;
    sourcePortion: number | string;
  }
 
  /** 客户级别统计响应 */
  export interface CustomerLevelRespVO extends CustomerBaseRespVO {
    level: number;
    levelPortion: number | string;
  }
 
  /** 客户地区统计响应 */
  export interface CustomerAreaRespVO extends CustomerBaseRespVO {
    areaId: number;
    areaName: string;
    areaPortion: number | string;
  }
}
 
export function getDatas(activeTabName: any, params: any) {
  switch (activeTabName) {
    case 'area': {
      return getCustomerArea(params);
    }
    case 'industry': {
      return getCustomerIndustry(params);
    }
    case 'level': {
      return getCustomerLevel(params);
    }
    case 'source': {
      return getCustomerSource(params);
    }
    default: {
      return [];
    }
  }
}
 
/** 获取客户行业统计数据 */
export function getCustomerIndustry(params: PageParam) {
  return requestClient.get<CrmStatisticsPortraitApi.CustomerIndustryRespVO[]>(
    '/crm/statistics-portrait/get-customer-industry-summary',
    { params },
  );
}
 
/** 获取客户来源统计数据 */
export function getCustomerSource(params: PageParam) {
  return requestClient.get<CrmStatisticsPortraitApi.CustomerSourceRespVO[]>(
    '/crm/statistics-portrait/get-customer-source-summary',
    { params },
  );
}
 
/** 获取客户级别统计数据 */
export function getCustomerLevel(params: PageParam) {
  return requestClient.get<CrmStatisticsPortraitApi.CustomerLevelRespVO[]>(
    '/crm/statistics-portrait/get-customer-level-summary',
    { params },
  );
}
 
/** 获取客户地区统计数据 */
export function getCustomerArea(params: PageParam) {
  return requestClient.get<CrmStatisticsPortraitApi.CustomerAreaRespVO[]>(
    '/crm/statistics-portrait/get-customer-area-summary',
    { params },
  );
}