riku
2025-09-02 adc9abd145c24f2d3e7033bb738e1e8641eaf4cf
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
import { TYPE0, TYPE1, TYPE2 } from '@/constant/device-type';
import {
  option1,
  default1,
  option2,
  default2
} from '@/constant/radio-options/options';
import {
  option1 as option1Jingan,
  default1 as default1Jingan
} from '@/constant/radio-options/options-jingan';
 
// 监测因子单选框选项
function radioOptions(deviceType) {
  if (import.meta.env.VITE_DATA_MODE == 'jingan') {
    if (TYPE0 == deviceType) {
      return option1Jingan;
    } else {
      return [];
    }
  } else {
    if ([TYPE0, TYPE1].includes(deviceType)) {
      return option1;
    } else if (deviceType == TYPE2) {
      return option2;
    } else {
      return [];
    }
  }
}
 
function defaultOptions(deviceType) {
  if (import.meta.env.VITE_DATA_MODE == 'jingan') {
    if (TYPE0 == deviceType) {
      return default1Jingan;
    } else {
      return undefined;
    }
  } else {
    if ([TYPE0, TYPE1].includes(deviceType)) {
      return default1;
    } else if (deviceType == TYPE2) {
      return default2;
    } else {
      return undefined;
    }
  }
}
 
export { radioOptions, defaultOptions };