From fa44bcc2861fe56e8af50fbd8f56065250a2ece3 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期四, 06 一月 2022 10:08:07 +0800
Subject: [PATCH] 报错处理

---
 src/pages/cameraAccess/components/SceneRule.vue |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/pages/cameraAccess/components/SceneRule.vue b/src/pages/cameraAccess/components/SceneRule.vue
index 188db95..3126c17 100644
--- a/src/pages/cameraAccess/components/SceneRule.vue
+++ b/src/pages/cameraAccess/components/SceneRule.vue
@@ -108,12 +108,17 @@
             </template>
           </el-table-column>
           <el-table-column label="鏃堕棿娈�" prop="time_name" align="center"></el-table-column>
-          <el-table-column label="鎻忚堪" prop="desc" align="center" min-width="150"></el-table-column>
+          <el-table-column label="鎻忚堪" prop="desc" align="center" min-width="120"></el-table-column>
           <!-- <el-table-column label="鐘舵��" align="center" width="90">
             <template slot-scope="scope">
               <el-switch v-model="scope.row.defence_state" @change="updateDefence(scope.row)"></el-switch>
             </template>
           </el-table-column>-->
+          <el-table-column label="浜嬩欢澹伴煶" align="center">
+            <template slot-scope="scope">
+              <span>{{ getSoundById(scope.row.voiceId) }}</span>
+            </template>
+          </el-table-column>
           <el-table-column label="浜嬩欢绛夌骇" align="center">
             <template slot-scope="scope">
               <span>{{scope.row.alarm_level | alarmLevel }}</span>
@@ -151,7 +156,6 @@
 <script>
 import {
   saveCameraScene,
-  getCameraSceneRule,
   deleteCameraScene
 } from '@/api/scene'
 import RuleEditor from "@/components/subComponents/RuleEditor";
@@ -237,10 +241,20 @@
     }
   },
   methods: {
+    getSoundById(id) {
+      if (id) {
+        let sound = this.soundList.find(item => item.id == id);
+        return sound.name
+      } else {
+        return ''
+      }
+    },
     getSounds() {
+      let _this = this;
       getSoundList().then(res => {
         if (res.success) {
-          this.soundList = [{ id: "", name: "绌�", path: "" }].concat(res.data.list)
+          //_this.soundList = [{ id: "", name: "绌�", path: "" }].concat(res.data.list)
+          _this.soundList = [{ id: "", name: "绌�", path: "" }].concat(res.data)
         }
       }).catch(
         e => console.log(e)
@@ -262,6 +276,7 @@
         })
         return false;
       }
+      debugger
       this.eventAudio.src = this.soundPath;
       if (this.togglePlay) {
         this.eventAudio.play();
@@ -426,7 +441,7 @@
         .catch(() => { });
     },
     cellStyle(obj) {
-      if (obj.column.label == '绛栫暐') {
+      if (obj.column.label == '绛栫暐' || obj.column.label == '浜嬩欢澹伴煶') {
         return 'text-align:left;padding-left:8px;'
       }
     }

--
Gitblit v1.8.0