Merge branch 'refs/heads/master' into 1078
This commit is contained in:
@@ -74,6 +74,8 @@
|
||||
<template slot-scope="scope">
|
||||
<el-button size="medium" icon="el-icon-video-play" type="text" @click="play(scope.row)">播放
|
||||
</el-button>
|
||||
<el-button size="medium" icon="el-icon-download" type="text" @click="downloadFile(scope.row)">下载
|
||||
</el-button>
|
||||
<!-- <el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c"-->
|
||||
<!-- @click="deleteRecord(scope.row)">删除-->
|
||||
<!-- </el-button>-->
|
||||
@@ -234,15 +236,30 @@ export default {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
getFileBasePath(item) {
|
||||
let basePath = ""
|
||||
if (axios.defaults.baseURL.startsWith("http")) {
|
||||
basePath = `${axios.defaults.baseURL}/record_proxy/${item.mediaServerId}`
|
||||
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 {
|
||||
basePath = `${window.location.origin}${axios.defaults.baseURL}/record_proxy/${item.mediaServerId}`
|
||||
link.href = res.data.data.httpPath + "&save_name=" + file.fileName;
|
||||
}
|
||||
return basePath;
|
||||
},
|
||||
link.click();
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
deleteRecord() {
|
||||
// TODO
|
||||
let that = this;
|
||||
|
||||
@@ -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>
|
||||
@@ -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() {
|
||||
|
||||
|
||||
@@ -326,7 +326,9 @@ export default {
|
||||
e.ptzType = e.ptzType + "";
|
||||
that.$set(e, "edit", false);
|
||||
that.$set(e, "location", "");
|
||||
if (e.longitude && e.latitude) {
|
||||
if (e.customLongitude && e.customLatitude) {
|
||||
that.$set(e, "location", e.customLongitude + "," + e.customLatitude);
|
||||
}else if (e.longitude && e.latitude) {
|
||||
that.$set(e, "location", e.longitude + "," + e.latitude);
|
||||
}
|
||||
});
|
||||
@@ -481,7 +483,9 @@ export default {
|
||||
e.ptzType = e.ptzType + "";
|
||||
this.$set(e, "edit", false);
|
||||
this.$set(e, "location", "");
|
||||
if (e.longitude && e.latitude) {
|
||||
if (e.customLongitude && e.customLatitude) {
|
||||
this.$set(e, "location", e.customLongitude + "," + e.customLatitude);
|
||||
}else if (e.longitude && e.latitude) {
|
||||
this.$set(e, "location", e.longitude + "," + e.latitude);
|
||||
}
|
||||
});
|
||||
@@ -603,8 +607,8 @@ export default {
|
||||
this.$message.warning("位置信息格式有误,例:117.234,36.378");
|
||||
return;
|
||||
} else {
|
||||
row.longitude = parseFloat(segements[0]);
|
||||
row.latitude = parseFloat(segements[1]);
|
||||
row.customLongitude = parseFloat(segements[0]);
|
||||
row.custom_latitude = parseFloat(segements[1]);
|
||||
if (!(row.longitude && row.latitude)) {
|
||||
this.$message.warning("位置信息格式有误,例:117.234,36.378");
|
||||
return;
|
||||
|
||||
@@ -32,7 +32,14 @@
|
||||
<el-input v-model="platform.deviceGBId" clearable @input="deviceGBIdChange"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="本地IP" prop="deviceIp">
|
||||
<el-input v-model="platform.deviceIp" :disabled="true"></el-input>
|
||||
<el-select v-model="platform.deviceIp" placeholder="请选择与上级相通的网卡" style="width: 100%">
|
||||
<el-option
|
||||
v-for="ip in deviceIp"
|
||||
:key="ip"
|
||||
:label="ip"
|
||||
:value="ip">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="本地端口" prop="devicePort">
|
||||
<el-input v-model="platform.devicePort" :disabled="true" type="number"></el-input>
|
||||
@@ -165,6 +172,7 @@ export default {
|
||||
administrativeDivision: "",
|
||||
sendStreamIp: null,
|
||||
},
|
||||
deviceIp: [], // 存储用户选择的设备IP
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入平台名称", trigger: "blur" }],
|
||||
serverGBId: [
|
||||
@@ -198,7 +206,7 @@ export default {
|
||||
console.log(res);
|
||||
if (res.data.code === 0) {
|
||||
that.platform.deviceGBId = res.data.data.username;
|
||||
that.platform.deviceIp = res.data.data.deviceIp;
|
||||
that.deviceIp = res.data.data.deviceIp.split(',');
|
||||
that.platform.devicePort = res.data.data.devicePort;
|
||||
that.platform.username = res.data.data.username;
|
||||
that.platform.password = res.data.data.password;
|
||||
@@ -222,7 +230,7 @@ export default {
|
||||
this.platform.serverIP = platform.serverIP;
|
||||
this.platform.serverPort = platform.serverPort;
|
||||
this.platform.deviceGBId = platform.deviceGBId;
|
||||
this.platform.deviceIp = platform.deviceIp;
|
||||
this.deviceIp = platform.deviceIp.split(',');
|
||||
this.platform.devicePort = platform.devicePort;
|
||||
this.platform.username = platform.username;
|
||||
this.platform.password = platform.password;
|
||||
|
||||
Reference in New Issue
Block a user