From 9e0df95ffda0ef9f2339f7caf413b357640aea28 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 06 五月 2024 08:45:14 +0800
Subject: [PATCH] 完成历史轨迹展示

---
 src/components/monitor/FactorRadio.vue |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/src/components/monitor/FactorRadio.vue b/src/components/monitor/FactorRadio.vue
index a5ebb94..5282125 100644
--- a/src/components/monitor/FactorRadio.vue
+++ b/src/components/monitor/FactorRadio.vue
@@ -13,17 +13,37 @@
 <script>
 // 鐩戞祴鍥犲瓙鍗曢�夋
 import { radioOptions } from '@/constant/radio-options';
+import { TYPE0 } from '@/constant/device-type';
+
 export default {
-  emits:['change'],
+  props: {
+    deviceType: {
+      type: String,
+      // type0: 杞﹁浇鎴栨棤浜烘満; type1:鏃犱汉鑸�
+      default: TYPE0
+    }
+  },
+  emits: ['change'],
   data() {
     return {
-      radio: radioOptions.type0[0].value,
-      options: radioOptions.type0
+      radio: radioOptions(TYPE0)[0].value
     };
   },
-  method:{
+  computed: {
+    options() {
+      return radioOptions(this.deviceType);
+    }
+  },
+  watch: {
+    deviceType(nV, oV) {
+      if (nV != oV) {
+        this.radio = this.options[0].value;
+      }
+    }
+  },
+  method: {
     handleChange(value) {
-      this.$emit('change', value)
+      this.$emit('change', value);
       // todo 鍦板浘3d鍥惧儚鍒囨崲灞曠ず鐩戞祴鍥犲瓙
     }
   }

--
Gitblit v1.9.3