From f3acb8ce787f3df0eda633031473be4e6a9ff448 Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期四, 12 十月 2023 16:56:28 +0800
Subject: [PATCH] 油烟 更新了实时监控页面

---
 src/sfc/ShopNameAndID.vue |   37 +++++++++++++++++++++++--------------
 1 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/src/sfc/ShopNameAndID.vue b/src/sfc/ShopNameAndID.vue
index 62efda0..fef27ec 100644
--- a/src/sfc/ShopNameAndID.vue
+++ b/src/sfc/ShopNameAndID.vue
@@ -2,17 +2,19 @@
     灏嗛�夋嫨鐨勮澶囩紪鍙疯繑鍥炵粰鐖剁粍浠�
  -->
 <script>
-import axiosInstance from '../utils/request.js'
+import axiosInstanceInstance from '../utils/request.js'
 export default {
   // 榛樿閫夋嫨涓�涓�
-  // props:{
-  //   devId:{
-  //     type: Array,
-  //     default: ['鍏ㄩ儴','鍏ㄩ儴'],
-  //   }
+  props:{
+    devId:{
+      type: Array,
+      default(){
+        return ['鍏ㄩ儴','鍏ㄩ儴']
+      }
+    }
      
-  // }
-  props:['devId'],
+  },
+  // props:['devId'],
   emits: ['submitId'],
   data() {
     return {
@@ -36,7 +38,7 @@
   methods: {
     getDeviceInfo() {
       // 绾ц仈涓嬫媺妗嗘暟鎹� 浠庢帴鍙d腑鍔ㄦ�佽幏鍙�
-        axiosInstance.get('/fume/device').then((result) => {
+        axiosInstanceInstance.get('/fume/device').then((result) => {
           this.deviceInfo = result.data.data;
           this.deviceInfo.forEach((item) => {
             this.optionsShop[this.optionsShop.length] = {
@@ -50,12 +52,19 @@
               ]
             };
           });
-          console.log(this.optionsShop);
         });
         
         // 鎵撳紑鏃堕粯璁ゅ睍绀轰竴涓簵閾�
       this.deviceId = this.devId
-    }
+    },
+    changeDev(){
+      if(this.deviceId == null){
+        this.deviceId = ['','']
+        this.$emit('submitId', this.deviceId[1])
+      }else{
+      this.$emit('submitId', this.deviceId[1])
+      }
+    },
   }
 };
 </script>
@@ -67,11 +76,11 @@
         v-model="deviceId"
         :options="optionsShop"
         :props="{ expandTrigger: 'hover' }"
-      
-        @change="$emit('submitId', deviceId[1])"
+        @change="changeDev"
         placeholder="鍏ㄩ儴"
+        clearable
       />
-      <!--   @visible-change="getDeviceInfo" -->
+      <!--   @change="$emit('submitId', deviceId[1])"  @change="changeDev"-->
     </span>
   </div>
 </template>

--
Gitblit v1.9.3