From e8d850f8559ccd386689576961676fc924bc5421 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期五, 25 六月 2021 14:13:10 +0800
Subject: [PATCH] 添加关注bug

---
 src/pages/maintain/views/generalSettings.vue |   48 +++++++++++++++++++++++++++++-------------------
 1 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/src/pages/maintain/views/generalSettings.vue b/src/pages/maintain/views/generalSettings.vue
index 7507fbc..66de6c1 100644
--- a/src/pages/maintain/views/generalSettings.vue
+++ b/src/pages/maintain/views/generalSettings.vue
@@ -94,7 +94,7 @@
             class="upload-demo"
             drag
             action="https://jsonplaceholder.typicode.com/posts/"
-            multiple
+              :http-request="uploadSound"
             v-show="showUpload"
           >
             <i class="el-icon-upload"></i>
@@ -118,7 +118,7 @@
 
 <script>
 import { saveAlarmConfig } from "@/api/system";
-
+import { uploadSound,getSoundList } from "@/api/event";
 import cloudNode from "../components/CloudNode";
 import ipInput from "@/components/subComponents/IPInput";
 import { isIPv4 } from "@/scripts/validate";
@@ -165,8 +165,7 @@
         { name: "鑻辨枃", desc: "fesF" },
         { name: "绻佷綋涓枃锛堥娓級", desc: "fesF" },
       ],
-      soundList: [{ name: "2.mp3" }, { name: "3.mp3" }],
-
+      soundList: [],
       wireFormRules: {},
       activePage: "basic",
       rules: {
@@ -174,20 +173,6 @@
           { required: true, message: "璇疯緭鍏ヨ澶囧悕绉�", trigger: "change" },
         ],
       },
-      ipv4Form: {},
-      ipv6Form: {},
-      ipv4FormRules: {},
-      ipv6FormRules: {},
-      options: [
-        {
-          value: "閫夐」1",
-          label: "鎵嬪姩",
-        },
-        {
-          value: "閫夐」2",
-          label: "鑷姩",
-        },
-      ],
       value: "",
     };
   },
@@ -196,12 +181,37 @@
     ipInput,
     switchBar,
   },
-  mounted() {},
+  mounted() {
+    debugger  
+    // this.getSounds()
+  },
   beforeDestroy() {},
   props: ["barName"],
   methods: {
+    getSounds() {
+      getSoundList().then(res => {
+        if (res.success) {
+          this.soundList = res.data.list
+          debugger
+        }
+      }).catch(
+        e => console.log(e)
+      )
+    },
+    uploadSound(params){
+
+      let param = new FormData();
+      param.append("file", params.file);
+      uploadSound(param).then((res) => {
+        console.log(res.data); 
+      });
+    },
     openRight(typ) {
       this.activePage = typ;
+      debugger
+      if (typ=="sound") {
+        this.getSounds()
+      }
     },
     wifiControl(val) {},
     checkWifi() {

--
Gitblit v1.8.0