From 9f16b5c553b479ea12fe368a7ecc748872ea8b98 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 12 六月 2025 11:11:27 +0800
Subject: [PATCH] 修改配置文件

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

diff --git a/web_src/src/components/GBRecordDetail.vue b/web_src/src/components/GBRecordDetail.vue
old mode 100644
new mode 100755
index 89a26af..37ec377
--- 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({
@@ -258,6 +261,7 @@
               this.mediaServerId = this.streamInfo.mediaServerId;
               this.ssrc = this.streamInfo.ssrc;
               this.videoUrl = this.getUrlByStreamInfo();
+              this.hasAudio = this.streamInfo.tracks && this.streamInfo.tracks.length > 1
             }else {
               this.$message({
                 showClose: true,
@@ -337,14 +341,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 +430,14 @@
         return hStr + ":" + mStr + ":" + sStr
       },
       goBack(){
+        // 濡傛灉姝e湪杩涜褰曞儚鍥炴斁鍒欙紝鍙戦�佸仠姝�
+        if (this.streamId !== "") {
+          this.stopPlayRecord(()=> {
+            this.streamId = "";
+          })
+        }
         window.history.go(-1);
-      }
+      },
 		}
 	};
 </script>

--
Gitblit v1.8.0