riku
2024-08-14 f2a0ea849099f49a3d2a9c7e5c44d033df22468f
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
const dustDeviceType = [
  {
    label: '技防',
    value: '1',
    children: [
      { label: '环保洒水车(大型非电动)', value: '1' },
      { label: '电动雾炮车', value: '2' },
      { label: '电动洒水车(小型)', value: '3' },
      { label: '雾炮车(固定或轮式)', value: '4' },
      { label: '自动冲洗装置(封闭式)', value: '5' },
      { label: '高效洗轮机', value: '6' },
      { label: '高压水枪', value: '7' },
      { label: '普通水管或消防栓', value: '8' },
      { label: '塔吊喷淋', value: '9' },
      { label: '围墙喷淋', value: '10' },
      { label: '扬尘监测与喷淋联动', value: '11' },
      { label: '堆场喷淋', value: '12' },
      { label: '生产区喷淋', value: '13' },
    ],
  },
];
 
const fumeDeviceType = [
  {
    label: '净化',
    value: '1',
    children: [{ label: '油烟净化', value: '1' }],
  },
];
 
const vocDeviceType = [
  {
    label: '净化',
    value: '1',
    children: [{ label: '固废净化', value: '1' }],
  },
];
 
// 治理设备类型
function treatmentDevices(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 = treatmentDevices(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 { treatmentDevices, toLabel };