riku
2025-09-19 58c0f11fe2f23a1be2dec768f9ac02107301a634
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
const dustDeviceType = [
  {
    label: '非道',
    value: '1',
    children: [
      { label: '挖掘机', value: '1' },
      { label: '叉车', value: '2' },
      { label: '履带吊', value: '3' },
      { label: '铲车', value: '4' },
      { label: '发动机', value: '5' },
    ],
  },
];
 
const fumeDeviceType = [
  {
    label: '厨具',
    value: '1',
    children: [{ label: '厨具', value: '1' }],
  },
];
 
const vocDeviceType = [
  {
    label: 'VOC',
    value: '1',
    children: [{ label: 'VOC', value: '1' }],
  },
];
 
// 生产设备类型
function productionDevices(sceneType) {
  switch (parseInt(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 = op.children;
    }
  });
  return labelArr;
}
 
export default { productionDevices, toLabel };