Browse Source

修改bug

qukaidi 2 years ago
parent
commit
668911f0bb

+ 1 - 1
src/views/monitor/alrtmList/index.vue

@@ -84,7 +84,7 @@
     </el-table>
     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
       @pagination="getList" />
-    <el-dialog title="预警图片" v-dialogDrag :visible.sync="dialogImg" @closed="imgClosed">
+    <el-dialog title="预警图片" v-dialogDrag :visible.sync="dialogImg" @closed="imgClosed" :close-on-click-modal="false">
       <div style="width:100%; height:60vh;">
         <img ref="img" :src="imgUrl" style="width: 100%;height:100%;" alt="">
       </div>

+ 5 - 13
src/views/monitor/alrtmList/js/index.js

@@ -8,19 +8,19 @@ export const tableOption = [{
 },
 {
   surface: "2",
-  label: "companyName",
-  name: "客户名称",
+  label: "dNickName",
+  name: "设备名",
   align: "center",
   checked: 0,
   width: 100,
 },
 {
   surface: "3",
-  label: "dNickName",
-  name: "设备名",
+  label: "alarmPicUrl",
+  name: "预警图片",
   align: "center",
   checked: 0,
-  width: 100,
+  width: 200,
 },
 {
   surface: "4",
@@ -101,13 +101,5 @@ export const tableOption = [{
   align: "center",
   checked: 0,
   width: 120,
-},
-{
-  surface: "14",
-  label: "alarmPicUrl",
-  name: "预警图片",
-  align: "center",
-  checked: 0,
-  width: 200,
 }
 ]

+ 26 - 8
src/views/monitor/monitorList/index.vue

@@ -57,8 +57,10 @@
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
-    <el-dialog :title="title" :visible.sync="dialogVisible" width="30%" @closed="handleClose">
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+    <el-dialog :title="title" :visible.sync="dialogVisible" width="30%" @closed="handleClose"
+      :close-on-click-modal="false">
       <span>
         <el-form :model="form" :rules="rules" ref="queryForm" label-width="100px">
           <el-form-item label="仓库" prop="fWarehouseId">
@@ -90,9 +92,9 @@
         <el-button type="primary" @click="submit(title)">{{  title == '添加' ? '保 存' : '修 改'  }}</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="查看监控" v-dialogDrag :visible.sync="dialogVideo">
+    <el-dialog title="查看监控" v-dialogDrag :visible.sync="dialogVideo" :close-on-click-modal="false" @closed="videoClose">
       <div style="width:100%; height:80vh;">
-        <iframe :src="iframeSrc" width="100%" height="100%" frameborder="0" scrolling="no">
+        <iframe v-if="dialogVideo" :src="iframeSrc" width="100%" height="100%" frameborder="0" scrolling="no">
         </iframe>
       </div>
     </el-dialog>
@@ -147,7 +149,8 @@ export default {
         code: [
           { required: true, message: ' ', trigger: 'blur' }
         ]
-      }
+      },
+      timer: null
     };
   },
   created() {
@@ -230,12 +233,12 @@ export default {
 
     },
     rowView(row) {
-      Axios.post("/dev-api/api/LiveBroadcast/getAccessToken").then(res => {
-        Axios.post(`/dev-api/api/LiveBroadcast/getToken?productCode=1640070936703286&token=${res.data.data.access_token}`).then(res2 => {
+      Axios.post("/prod-api/api/LiveBroadcast/getAccessToken").then(res => {
+        Axios.post(`/prod-api/api/LiveBroadcast/getToken?productCode=1640070936703286&token=${res.data.data.access_token}`).then(res2 => {
           console.log(res2)
           Axios({
             method: 'POST',
-            url: '/dev-api/api/LiveBroadcast/videoWeb',
+            url: '/prod-api/api/LiveBroadcast/videoWeb',
             params: {
               deviceSerial: row.deviceSerial,
               projectId: row.projectId,
@@ -247,6 +250,7 @@ export default {
             .then(response => {
               this.dialogVideo = true
               this.iframeSrc = response.data.data.data.previewUrl
+              this.start()
             });
         })
       })
@@ -259,6 +263,20 @@ export default {
     handleClose() {
       this.form = this.$options.data().form;
       this.dialogVisible = false;
+    },
+    videoClose() {
+      this.iframeSrc = this.$options.data().iframeSrc;
+      this.end()
+    },
+    start() {
+      // 将定时器名字赋值到变量中
+      this.timer = setTimeout(() => {
+        this.dialogVideo = false;
+      }, 60000);
+    },
+    end() {
+      clearInterval(this.timer);
+      this.timer = null
     }
   }
 };