Kaynağa Gözat

Merge branch 'master' of http://code.nyzhwlw.com:10202/yf_lj/bigDataApp

leo 6 gün önce
ebeveyn
işleme
773da3f6ac

+ 21 - 6
pages/deviceDetails/weatherStation/devControl.vue

@@ -18,11 +18,13 @@
           show-value="true"
           :min="1"
           :max="240"
+          @change="changeStorageVal"
           block-color="#57C878"
           activeColor="#57C878"
           step="1"
         />
       </view>
+      <u-button type="success" class="sub-btn" @click="handleControl('STORAGE_INR')">确定</u-button>
       <view class="title date-title">数据传输间隔(min)</view>
       <view class="date-slider">
         <slider
@@ -30,14 +32,13 @@
           show-value="true"
           :min="1"
           :max="240"
+          @change="changeDataInterval"
           block-color="#57C878"
           activeColor="#57C878"
           step="1"
         />
       </view>
-    </view>
-    <view class="footer-board">
-      <u-button type="success" class="sub-btn" @click="handleSubmit()">确定</u-button>
+      <u-button type="success" class="sub-btn" @click="handleControl('INTERVAL')">确定</u-button>
     </view>
   </view>
 </template>
@@ -59,6 +60,14 @@ export default {
     };
   },
   methods: {
+    // 改变本地存储间隔
+    changeStorageVal(e) {
+      this.storageVal = e.detail.value
+    },
+    // 改变数据传输间隔
+    changeDataInterval(e) {
+      this.dataInterval = e.detail.value
+    },
     // 获取设备控制参数信息
     async getDevControlParams() {
       this.loading = true
@@ -86,11 +95,17 @@ export default {
         data: params
       }).then(res => {
         console.log('设备控制参数信息', res)
+         uni.showToast({
+            title: "操作成功",
+            icon: "none",
+          });
       })
     },
-    handleSubmit() {
-      this.handleControl('STORAGE_INR');
-      this.handleControl('INTERVAL');
+    async handleSubmit() {
+      // await this.handleControl('STORAGE_INR');
+      // setTimeout(async ()=>{
+      //   await this.handleControl('INTERVAL');
+      // },500)
       uni.showToast({
         title: "操作成功",
         icon: "none",