Browse Source

设备更新逻辑修改

xiaohaizhao 1 year ago
parent
commit
8581a0b774
2 changed files with 9 additions and 7 deletions
  1. 3 4
      pages/facility/detail.vue
  2. 6 3
      pages/facility/modules/control.vue

+ 3 - 4
pages/facility/detail.vue

@@ -29,7 +29,7 @@
             <view class="ceiling" :style="{ top: tovw(CustomBar + tabsTop) }">
                 <tabs :tabs="tabs" @changeTab="changeTab" />
             </view>
-            <control ref="设备控制" :detail="detail" />
+            <control ref="设备控制" :detail="detail" @onUpdate="getDetail" />
             <daily-record ref="设备日志" :w_deviceid="w_deviceid" />
             <preview ref="详情信息" :detail="detail" />
             <alerts ref="告警记录" :w_deviceid="w_deviceid" />
@@ -82,6 +82,7 @@ export default {
             this.$Http.basic({
                 "id": 20230615103902,
                 "content": {
+                    nocache: true,
                     "w_deviceid": this.w_deviceid
                 }
             }).then(res => {
@@ -110,7 +111,7 @@ export default {
                 }
 
                 this.detail = res.data;
-                
+
                 if (init) {
                     this.$refs.hd.getList(this.w_deviceid, res.data.prodnum).then(num => this.tabsTop = num)
                     setTimeout(() => { this.changeTab({ name: this.showTab }, true) }, 100)
@@ -177,8 +178,6 @@ export default {
         font-size: 12px;
         color: #666666;
         margin-bottom: 5px;
-
-
     }
 }
 </style>

+ 6 - 3
pages/facility/modules/control.vue

@@ -16,7 +16,8 @@ let monitoring = null;
 export default {
     name: "control",
     props: {
-        detail: Object
+        detail: Object,
+		onUpdate:Function
     },
     data() {
         return {
@@ -72,8 +73,10 @@ export default {
                             content: '设备控制参数已更新',
                             showCancel: false,
                         }) */
-                        this.getControl(true);
-                    }
+						this.$emit("onUpdate",true)
+                    }else{
+						console.log("设备未更新")
+					}
                 })
             }, 5000);
         }