From 0ac27b03ffd13370e2beec83ce7cb394091ae889 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 12 六月 2024 11:10:10 +0800
Subject: [PATCH] 增加设备上线判断双逻辑,兼容大华注册后不再发送注册的设备
---
web_src/src/components/CloudRecordDetail.vue | 70 +++++++++++++++++++++++++++--------
1 files changed, 54 insertions(+), 16 deletions(-)
diff --git a/web_src/src/components/CloudRecordDetail.vue b/web_src/src/components/CloudRecordDetail.vue
index 207fbef..27a2235 100755
--- a/web_src/src/components/CloudRecordDetail.vue
+++ b/web_src/src/components/CloudRecordDetail.vue
@@ -45,8 +45,7 @@
<i class="el-icon-video-camera" ></i>
{{ getFileShowName(item) }}
</el-tag>
- <a class="el-icon-download" style="color: #409EFF;font-weight: 600;margin-left: 10px;"
- :href="`${getFileBasePath(item)}/download.html?url=download/${app}/${stream}/${chooseDate}/${item.fileName}`"
+ <a class="el-icon-download" @click="downloadFile(item)" style="color: #409EFF;font-weight: 600;margin-left: 10px;"
target="_blank"/>
</li>
</ul>
@@ -135,7 +134,7 @@
<script>
// TODO 鏍规嵁鏌ヨ鐨勬椂闂村垪琛ㄨ缃粦杞ㄧ殑鏈�澶у�间笌鏈�灏忓�硷紝
import uiHeader from '../layout/UiHeader.vue'
- import player from './dialog/easyPlayer.vue'
+ import player from './common/easyPlayer.vue'
import moment from 'moment'
import axios from "axios";
export default {
@@ -230,9 +229,6 @@
mounted() {
this.recordListStyle.height = this.winHeight + "px";
this.playerStyle["height"] = this.winHeight + "px";
- console.log(this.app)
- console.log(this.stream)
- console.log(this.mediaServerId)
// 鏌ヨ褰撳勾鏈夎棰戠殑鏃ユ湡
this.getDateInYear(()=>{
if (Object.values(this.dateFilesObj).length > 0){
@@ -314,21 +310,61 @@
});
},
chooseFile(file){
+ console.log(file)
if (file == null) {
this.videoUrl = "";
this.choosedFile = "";
}else {
this.choosedFile = file.fileName;
- this.videoUrl = `${this.getFileBasePath(file)}/download/${this.app}/${this.stream}/${this.chooseDate}/${file.fileName}`
- console.log(this.videoUrl)
+ this.$axios({
+ method: 'get',
+ url: `/api/cloud/record/play/path`,
+ params: {
+ recordId: file.id,
+ }
+ }).then((res) => {
+ console.log(res)
+ if (res.data.code === 0) {
+ if (location.protocol === "https:") {
+ this.videoUrl = res.data.data.httpsPath;
+ }else {
+ this.videoUrl = res.data.data.httpPath;
+ }
+ }
+ }).catch((error) => {
+ console.log(error);
+ });
}
-
+ },
+ downloadFile(file){
+ console.log(file)
+ this.$axios({
+ method: 'get',
+ url: `/api/cloud/record/play/path`,
+ params: {
+ recordId: file.id,
+ }
+ }).then((res) => {
+ console.log(res)
+ const link = document.createElement('a');
+ link.target = "_blank";
+ if (res.data.code === 0) {
+ if (location.protocol === "https:") {
+ link.href = res.data.data.httpsPath + "&save_name=" + file.fileName;
+ }else {
+ link.href = res.data.data.httpPath + "&save_name=" + file.fileName;
+ }
+ link.click();
+ }
+ }).catch((error) => {
+ console.log(error);
+ });
},
backToList() {
this.$router.back()
},
getFileShowName(item) {
- return moment.unix(item.startTime).format('HH:mm:ss') + "-" + moment.unix(item.endTime).format('HH:mm:ss')
+ return moment(item.startTime).format('HH:mm:ss') + "-" + moment(item.endTime).format('HH:mm:ss')
},
chooseMediaChange() {
@@ -480,12 +516,13 @@
let that = this;
this.$axios({
method: 'get',
- url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`,
+ url:`/api/cloud/record/task/add`,
params: {
- app: that.app,
- stream: that.stream,
- startTime: moment(this.taskTimeRange[0]).format('YYYY-MM-DD HH:mm:ss'),
- endTime: moment(this.taskTimeRange[1]).format('YYYY-MM-DD HH:mm:ss'),
+ app: this.app,
+ stream: this.stream,
+ mediaServerId: this.mediaServerId,
+ startTime: moment(this.taskTimeRange[0]).format('YYYY-MM-DD HH:mm:ss'),
+ endTime: moment(this.taskTimeRange[1]).format('YYYY-MM-DD HH:mm:ss'),
}
}).then(function (res) {
if (res.data.code === 0 ) {
@@ -505,8 +542,9 @@
let that = this;
this.$axios({
method: 'get',
- url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`,
+ url:`/api/cloud/record/task/list`,
params: {
+ mediaServerId: this.mediaServerId,
isEnd: isEnd,
}
}).then(function (res) {
--
Gitblit v1.8.0