From eb3c38e9450b8bcf7ca8e0df65757162ba18251f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 29 四月 2024 14:04:42 +0800
Subject: [PATCH] 监测因子单选框

---
 src/views/historymode/HistoryMode.vue  |    2 
 src/components/monitor/FactorRadio.vue |   16 ++++++--
 src/constant/radio-options.js          |   73 ++++++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+), 5 deletions(-)

diff --git a/src/components/monitor/FactorRadio.vue b/src/components/monitor/FactorRadio.vue
index 3245049..f77cf2f 100644
--- a/src/components/monitor/FactorRadio.vue
+++ b/src/components/monitor/FactorRadio.vue
@@ -2,9 +2,9 @@
   <BaseCard>
     <template #content>
       <el-radio-group v-model="radio">
-        <el-radio :value="3">Option A</el-radio>
-        <el-radio :value="6">Option B</el-radio>
-        <el-radio :value="9">Option C</el-radio>
+        <el-radio v-for="(item, i) in options" :key="i" :value="item.value">{{
+          item.label
+        }}</el-radio>
       </el-radio-group>
     </template>
   </BaseCard>
@@ -12,5 +12,13 @@
 
 <script>
 // 鐩戞祴鍥犲瓙鍗曢�夋
-export default {};
+import { radioOptions } from '@/constant/radio-options';
+export default {
+  data() {
+    return {
+      radio: radioOptions.type0[0].value,
+      options: radioOptions.type0
+    };
+  }
+};
 </script>
diff --git a/src/constant/radio-options.js b/src/constant/radio-options.js
index 2a0067d..3e5b2d8 100644
--- a/src/constant/radio-options.js
+++ b/src/constant/radio-options.js
@@ -1 +1,74 @@
 // 鐩戞祴鍥犲瓙鍗曢�夋閫夐」
+export const radioOptions = {
+  type0: [
+    //鏃犱汉鏈�
+    {
+      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: 'NO2',
+      value: '5'
+    },
+    {
+      label: 'PM2.5',
+      name: 'PM25',
+      value: '6'
+    },
+    {
+      label: 'PM10',
+      name: 'PM10',
+      value: '7'
+    },
+    {
+      label: 'TVOC',
+      name: 'VOC',
+      value: '10'
+    }
+  ],
+  type1: [
+    //鏃犱汉鑸�
+    {
+      label: '娓╁害',
+      name: '娓╁害',
+      value: '1'
+    },
+    {
+      label: '鐢靛鐜�',
+      name: '鐢靛鐜�',
+      value: '2'
+    },
+    {
+      label: '娴婂害',
+      name: '娴婂害',
+      value: '3'
+    },
+    {
+      label: '婧惰В姘�',
+      name: '婧惰В姘�',
+      value: '4'
+    },
+    {
+      label: 'PH',
+      name: 'PH',
+      value: '5'
+    }
+  ]
+};
diff --git a/src/views/historymode/HistoryMode.vue b/src/views/historymode/HistoryMode.vue
index c5c53bb..b718675 100644
--- a/src/views/historymode/HistoryMode.vue
+++ b/src/views/historymode/HistoryMode.vue
@@ -4,6 +4,6 @@
 
 <script>
 export default {
-  name: 'HistoryPage',
+  name: 'HistoryPage'
 };
 </script>

--
Gitblit v1.9.3