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
| const dustDeviceType = [
| {
| label: '非道',
| value: '1',
| children: [
| {
| label: '挖掘机',
| value: '1',
| },
| ],
| },
| ];
|
| const fumeDeviceType = [
| {
| label: '厨具',
| value: '1',
| children: [
| {
| label: '厨具',
| value: '1',
| },
| ],
| },
| ];
|
| const vocDeviceType = [
| {
| label: 'VOC',
| value: '1',
| children: [
| {
| label: 'VOC',
| value: '1',
| },
| ],
| },
| ];
|
| // 生产设备类型
| function productionDevices(sceneType) {
| switch (sceneType) {
| // 工地,码头,搅拌站,堆场
| case '1':
| case '2':
| case '3':
| case '14':
| return dustDeviceType;
| // 餐饮
| case '5':
| return fumeDeviceType;
| // 工业企业,汽修
| case '4':
| case '6':
| return vocDeviceType;
| default:
| return dustDeviceType;
| }
| }
|
| function toLabel(sceneType, valueArr) {
| const labelArr = [];
| let options = productionDevices(sceneType);
| valueArr.forEach(v => {
| if (options) {
| const op = options.find(o => {
| return o.value == v;
| });
| labelArr.push(op.label);
| options = options.children;
| }
| });
| return labelArr;
| }
|
| export { productionDevices, toLabel };
|
|