riku
2025-07-03 e895212fa4215c50ce79ce4b448e064caf394776
src/constant/radio-options.js
@@ -1,6 +1,14 @@
import { TYPE0, TYPE1, TYPE2 } from '@/constant/device-type';
import { option1, option2 } from '@/constant/radio-options/options';
import { option1 as option1Jingan } from '@/constant/radio-options/options-jingan';
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) {
@@ -21,74 +29,22 @@
  }
}
// const option1 = [
//   {
//     label: 'NO2',
//     name: 'NO2',
//     value: '1'
//   },
//   {
//     label: 'CO',
//     name: 'CO',
//     value: '2'
//   },
//   {
//     label: 'H2S',
//     name: 'H2S',
//     value: '3'
//   },
//   {
//     label: 'SO2',
//     name: 'SO2',
//     value: '4'
//   },
//   {
//     label: 'O3',
//     name: 'O3',
//     value: '5'
//   },
//   {
//     label: 'PM2.5',
//     name: 'PM25',
//     value: '6'
//   },
//   {
//     label: 'PM10',
//     name: 'PM10',
//     value: '7'
//   },
//   {
//     label: 'TVOC',
//     name: 'VOC',
//     value: '10'
//   }
// ];
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;
    }
  }
}
// const option2 = [
//   {
//     label: '温度',
//     name: 'TMP',
//     value: '1'
//   },
//   {
//     label: '电导率',
//     name: 'spC',
//     value: '2'
//   },
//   {
//     label: '浊度',
//     name: 'tur',
//     value: '3'
//   },
//   {
//     label: '溶解氧',
//     name: 'DO',
//     value: '4'
//   },
//   {
//     label: 'PH',
//     name: 'PH',
//     value: '5'
//   }
// ];
export { radioOptions };
export { radioOptions, defaultOptions };