Merge pull request #845 from 648540858/wvp-28181-2.0-test
Wvp 28181 2.0 test
This commit is contained in:
@@ -182,9 +182,11 @@
|
||||
this.playerStyle["height"] = this.winHeight + "px";
|
||||
this.chooseDate = moment().format('YYYY-MM-DD')
|
||||
this.dateChange();
|
||||
window.addEventListener('beforeunload', this.stopPlayRecord)
|
||||
},
|
||||
destroyed() {
|
||||
this.$destroy('recordVideoPlayer');
|
||||
window.removeEventListener('beforeunload', this.stopPlayRecord)
|
||||
},
|
||||
methods: {
|
||||
dateChange(){
|
||||
@@ -338,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);
|
||||
@@ -423,8 +429,14 @@
|
||||
return hStr + ":" + mStr + ":" + sStr
|
||||
},
|
||||
goBack(){
|
||||
// 如果正在进行录像回放则,发送停止
|
||||
if (this.streamId !== "") {
|
||||
this.stopPlayRecord(()=> {
|
||||
this.streamId = "";
|
||||
})
|
||||
}
|
||||
window.history.go(-1);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6" >
|
||||
<el-button icon="el-icon-download" v-if="percentage < 100" size="mini" title="点击下载可将以缓存部分下载到本地" @click="download()">停止缓存并下载</el-button>
|
||||
<el-button icon="el-icon-download" v-if="downloadFile" size="mini" title="点击下载" @click="downloadFileClientEvent()">点击下载</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@@ -21,7 +22,7 @@ import moment from "moment";
|
||||
export default {
|
||||
name: 'recordDownload',
|
||||
created() {
|
||||
|
||||
window.addEventListener('beforeunload', this.stopDownloadRecord)
|
||||
|
||||
},
|
||||
data() {
|
||||
@@ -39,7 +40,8 @@ export default {
|
||||
taskId: null,
|
||||
getProgressRun: false,
|
||||
getProgressForFileRun: false,
|
||||
timer: null
|
||||
timer: null,
|
||||
downloadFile: null,
|
||||
|
||||
};
|
||||
},
|
||||
@@ -187,8 +189,9 @@ export default {
|
||||
this.percentage = parseFloat(res.data.data[0].percentage)*100
|
||||
if (res.data.data[0].percentage === '1') {
|
||||
this.getProgressForFileRun = false;
|
||||
window.open(res.data.data[0].downloadFile)
|
||||
this.close();
|
||||
this.downloadFile = res.data.data[0].downloadFile
|
||||
this.title = "文件处理完成,点击按扭下载"
|
||||
// window.open(res.data.data[0].downloadFile)
|
||||
}else {
|
||||
if (callback)callback()
|
||||
}
|
||||
@@ -196,7 +199,13 @@ export default {
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
downloadFileClientEvent: function (){
|
||||
window.open(this.downloadFile )
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('beforeunload', this.stopDownloadRecord)
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user