From a2d93fce811acc83ad5ff0b4a93403db22795a10 Mon Sep 17 00:00:00 2001
From: winfed <chinesezwf@gmail.com>
Date: 星期五, 09 六月 2023 15:19:18 +0800
Subject: [PATCH] fix:修复拉流代理配置展示问题:音频、录制、无人观看

---
 web_src/src/components/GBRecordDetail.vue |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/web_src/src/components/GBRecordDetail.vue b/web_src/src/components/GBRecordDetail.vue
index 89a26af..f9fce20 100644
--- a/web_src/src/components/GBRecordDetail.vue
+++ b/web_src/src/components/GBRecordDetail.vue
@@ -181,17 +181,20 @@
       this.recordListStyle.height = this.winHeight + "px";
       this.playerStyle["height"] = this.winHeight + "px";
       this.chooseDate = moment().format('YYYY-MM-DD')
-      this.setTime(this.chooseDate + " 00:00:00", this.chooseDate + " 23:59:59");
       this.dateChange();
+      window.addEventListener('beforeunload', this.stopPlayRecord)
 		},
 		destroyed() {
 			this.$destroy('recordVideoPlayer');
+      window.removeEventListener('beforeunload', this.stopPlayRecord)
 		},
 		methods: {
       dateChange(){
         if (!this.chooseDate) {
           return;
         }
+
+        this.setTime(this.chooseDate + " 00:00:00", this.chooseDate + " 23:59:59");
         this.recordsLoading = true;
         this.detailFiles = [];
         this.$axios({
@@ -337,14 +340,18 @@
         });
       },
       stopPlayRecord: function (callback) {
-        this.$refs["recordVideoPlayer"].pause();
-        this.videoUrl = '';
-        this.$axios({
-          method: 'get',
-          url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId
-        }).then(function (res) {
-          if (callback) callback()
-        });
+        console.log("鍋滄褰曞儚鍥炴斁")
+        if (this.streamId !== "") {
+          this.$refs["recordVideoPlayer"].pause();
+          this.videoUrl = '';
+          this.$axios({
+            method: 'get',
+            url: '/api/playback/stop/' + this.deviceId + "/" + this.channelId + "/" + this.streamId
+          }).then(function (res) {
+            if (callback) callback()
+          });
+        }
+
       },
       getDataWidth(item){
         let timeForFile = this.getTimeForFile(item);
@@ -422,8 +429,14 @@
         return hStr + ":" + mStr + ":" + sStr
       },
       goBack(){
+        // 濡傛灉姝e湪杩涜褰曞儚鍥炴斁鍒欙紝鍙戦�佸仠姝�
+        if (this.streamId !== "") {
+          this.stopPlayRecord(()=> {
+            this.streamId = "";
+          })
+        }
         window.history.go(-1);
-      }
+      },
 		}
 	};
 </script>

--
Gitblit v1.8.0