riku
2025-04-25 b515fae43490ab20977d559e19d4e5f63a4fd96d
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
/**
 * 线索统计
 */
export function getClueStatistic(dataList) {
  let total = dataList.length,
    finished = 0,
    unfinished = 0;
 
  dataList.forEach(d => {
    d.finished ? finished++ : unfinished++;
  });
 
  const p1 = Math.round((finished / total) * 1000) / 10;
  const p2 = Math.round((unfinished / total) * 1000) / 10;
  return [
    {
      name: '总计',
      value: total,
      diff: '',
      clickable: false,
    },
    {
      name: '已完成',
      value: finished,
      diff: total == 0 ? '0%' : `${p1}%`,
      clickable: false,
    },
    {
      name: '待完成',
      value: unfinished,
      diff: total == 0 ? '0%' : `${p2}%`,
      clickable: false,
    },
  ];
}