From 72c1b36d6d2ece497e032c8434641d6576590f9d Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期日, 03 七月 2022 00:44:36 +0800
Subject: [PATCH] 优化对讲逻辑

---
 web_src/src/components/channelList.vue |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue
index f0194ee..d27e62b 100644
--- a/web_src/src/components/channelList.vue
+++ b/web_src/src/components/channelList.vue
@@ -3,7 +3,9 @@
     <div class="page-header">
       <div class="page-title">
         <el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="showDevice" ></el-button>
-        閫氶亾鍒楄〃</div>
+        <el-divider direction="vertical"></el-divider>
+        閫氶亾鍒楄〃
+      </div>
       <div class="page-header-btn">
       鎼滅储:
       <el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="鍏抽敭瀛�"
@@ -36,11 +38,11 @@
     <el-table-column prop="name" label="閫氶亾鍚嶇О" min-width="200">
     </el-table-column>
     <el-table-column label="蹇収" min-width="120">
-      <template slot-scope="scope">
+      <template v-slot:default="scope">
         <el-image
           :src="getSnap(scope.row)"
           :preview-src-list="getBigSnap(scope.row)"
-          @error="getSnapErrorEvent(scope.row.deviceId, cope.row.channelId)"
+          @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)"
           :fit="'contain'"
           style="width: 60px">
           <div slot="error" class="image-slot">
@@ -69,8 +71,8 @@
     <el-table-column label="鐘舵��" min-width="120">
       <template slot-scope="scope">
         <div slot="reference" class="name-wrapper">
-          <el-tag size="medium" v-if="scope.row.status == 1">鍦ㄧ嚎</el-tag>
-          <el-tag size="medium" type="info" v-if="scope.row.status == 0">绂荤嚎</el-tag>
+          <el-tag size="medium" v-if="scope.row.status === 1">鍦ㄧ嚎</el-tag>
+          <el-tag size="medium" type="info" v-if="scope.row.status === 0">绂荤嚎</el-tag>
         </div>
       </template>
     </el-table-column>
@@ -110,6 +112,8 @@
 import devicePlayer from './dialog/devicePlayer.vue'
 import uiHeader from '../layout/UiHeader.vue'
 import moment from "moment";
+import DviceService from "./service/DeviceService";
+import DeviceService from "./service/DeviceService";
 
 export default {
   name: 'channelList',
@@ -119,6 +123,8 @@
   },
   data() {
     return {
+      deviceService: new DeviceService(),
+      device: null,
       deviceId: this.$route.params.deviceId,
       parentChannelId: this.$route.params.parentChannelId,
       deviceChannelList: [],
@@ -139,7 +145,17 @@
   },
 
   mounted() {
+    if (this.deviceId) {
+      this.deviceService.getDevice(this.deviceId, (result)=>{
+          this.device = result;
+
+      }, (error)=>{
+        console.log("鑾峰彇璁惧淇℃伅澶辫触")
+        console.error(error)
+      })
+    }
     this.initData();
+
   },
   destroyed() {
     this.$destroy('videojs');

--
Gitblit v1.8.0