From 8f86d0a825962a17634cb5a4fcdab1ceecea1a5a Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期五, 21 五月 2021 14:27:48 +0800 Subject: [PATCH] 事件声音列表获取字段由data.list改为data --- src/pages/cameraAccess/components/SceneRule.vue | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/pages/cameraAccess/components/SceneRule.vue b/src/pages/cameraAccess/components/SceneRule.vue index 188db95..ba4bc75 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> @@ -237,10 +242,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) @@ -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