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
| import { basePicUrl, baseUrl, baseFileUrl, baseIconUrl } from '../config/index';
| import { toLabel } from '../common/dataSceneTypes';
|
| /**
| * 场景基本信息
| */
| export function getEnterprise(data) {
| return {
| id: data.guid,
| name: data.realname,
| district: data.extension1,
| sceneType: toLabel(data.extension2),
| sceneTypeId: data.extension2,
| avatar: data.headIconUrl && data.headIconUrl != '' ? basePicUrl + data.headIconUrl : '',
| };
| }
|
| export function getEnterpriseList(dataList) {
| return dataList.map(item => {
| return getEnterprise(item);
| });
| }
|
| export function getEnterpriseCount(data) {
| const { first, second, third } = data;
| const p1 = Math.round((second / first) * 1000) / 10;
| const p2 = Math.round((third / first) * 1000) / 10;
| return [
| {
| name: '企业总数',
| value: first,
| // diff: first == 0 ? '0%' : '100%',
| diff: '',
| clickable: false,
| },
| {
| name: '运营中',
| value: second,
| diff: first == 0 ? '0%' : `${p1}%`,
| clickable: false,
| },
| {
| name: '关闭',
| value: third,
| diff: first == 0 ? '0%' : `${p2}%`,
| clickable: false,
| },
| ];
| }
|
|