From 0611cb8ea1fe07bfb3312aeebad54a95bf425f8f Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期一, 22 十一月 2021 15:44:24 +0800
Subject: [PATCH] 网关接口

---
 src/api/helemt.ts                             |    8 ++++++++
 vue.config.js                                 |    2 +-
 src/pages/settings/components/LoraGateway.vue |    3 +++
 src/pages/settings/components/WifiGateway.vue |    1 +
 src/pages/internetData/views/helemtTable.vue  |   26 +++++++++++++++++++++++---
 5 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/src/api/helemt.ts b/src/api/helemt.ts
index edf546d..5a2d325 100644
--- a/src/api/helemt.ts
+++ b/src/api/helemt.ts
@@ -6,4 +6,12 @@
         method: "post",
         data
     })
+}
+
+export const sendAudio = (id,data: any) => {
+    return request({
+        url: `/temp/iotdata/audio/?sn=${id}`,
+        method: "post",
+        data
+    })
 }
\ No newline at end of file
diff --git a/src/pages/internetData/views/helemtTable.vue b/src/pages/internetData/views/helemtTable.vue
index 011b96e..ee8972e 100644
--- a/src/pages/internetData/views/helemtTable.vue
+++ b/src/pages/internetData/views/helemtTable.vue
@@ -156,7 +156,9 @@
 
 <script>
 import telephoneBox from "@/pages/internetData/components/telephoneBox";
-import { getHelemtData } from "@/api/helemt";
+import { getHelemtData, sendAudio } from "@/api/helemt";
+
+let voiceText = "";
 export default {
   name: "helemtTable",
   data() {
@@ -380,7 +382,25 @@
           done();
         },
       }).then((action) => {
-        target.isSend = false;
+        if (action == "confirm") {
+          if (!voiceText) {
+            this.$message({
+              message: "鎸囦护涓嶈兘涓虹┖",
+              type: "warning",
+            });
+            return;
+          }
+          console.log(voiceText);
+          sendAudio(target.device_sn, voiceText).then((res) => {
+            this.$message({
+              message: "鎸囦护鍙戦�佹垚鍔�",
+              type: "success",
+            });
+          });
+          target.isSend = false;
+        } else {
+          target.isSend = false;
+        }
       });
     },
     telephone(target) {
@@ -403,7 +423,7 @@
     },
     onCommentInputChange() {
       let value = document.querySelector("#commentContent").value;
-      console.log(value);
+      voiceText = value;
       let cont = 20 - value.length;
       document.querySelector(
         "#comment_info"
diff --git a/src/pages/settings/components/LoraGateway.vue b/src/pages/settings/components/LoraGateway.vue
index f6720ed..c4a7643 100644
--- a/src/pages/settings/components/LoraGateway.vue
+++ b/src/pages/settings/components/LoraGateway.vue
@@ -137,6 +137,9 @@
       console.log(res);
     },
     async saveList() {
+      //  this.loraForm.powerRate = `${this.loraForm.powerRate}`;
+      this.loraForm.hz = `${this.loraForm.hz}`;
+      //  this.loraForm.workMode = `${this.loraForm.workMode}`;
       const res = await saveLora(this.loraForm);
       console.log(res);
     },
diff --git a/src/pages/settings/components/WifiGateway.vue b/src/pages/settings/components/WifiGateway.vue
index 13086cf..6c1ec72 100644
--- a/src/pages/settings/components/WifiGateway.vue
+++ b/src/pages/settings/components/WifiGateway.vue
@@ -223,6 +223,7 @@
     },
 
     async saveList() {
+      this.wifiForm.powerRate = `${this.wifiForm.powerRate}`;
       const res = await saveWifi(this.wifiForm);
       console.log(res);
     },
diff --git a/vue.config.js b/vue.config.js
index 3faacbf..c92355a 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -42,7 +42,7 @@
 
 // const serverUrl = "http://58.118.225.79:41243" // 缇婁簲
 const serverUrl = "http://192.168.8.10:7009";
-//const serverUrl = "http://192.168.20.10:9000";
+// const serverUrl = "http://192.168.20.10:9000";
 
 // const cir = require("circular-dependency-plugin");
 

--
Gitblit v1.8.0