riku
2025-04-27 f46786f11c5c08ead7501a82e5a71430ad69b782
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
import dayjs from 'dayjs';
import { toLabel } from '../common/dataSceneTypes';
 
// 企业历史评估得分
export function getHistoryPoint(data) {
  let year = data.updateDate.substring(0, 4);
  let month = data.updateDate.substring(5, 7);
  return {
    scoreId: data.tPGuid,
    time: `${year}年${month}月`,
    updateTime: dayjs(data.updateDate).format('YYYY-MM-DD hh:mm'),
    score: data.totalPoint,
    rank: data.rank,
    legalIndex: data.level,
    illegalIndex: data.level,
    period: data.period,
    color: data.color,
  };
}
 
// 企业历史评估得分列表
export function getHistoryPointList(dataList) {
  return dataList.map(item => {
    return getHistoryPoint(item);
  });
}
 
// 企业总分及环信码等评估信息
export function getGrade(data, period) {
  if (!data.updateTime) data.updateTime = period
  data.sceneTypeId = data.sceneType;
  data.sceneType = toLabel(data.sceneType);
  return data;
}
 
// 企业总分及环信码等评估信息列表
export function getGradeList(dataList, period) {
  return dataList.map(item => {
    return getGrade(item, period);
  });
}