ZZJ
2022-03-22 81c9b1f75b80fade52653243b914ccb2677b4a8f
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;'
      }
    }