合并主线

This commit is contained in:
648540858
2023-05-25 17:28:57 +08:00
129 changed files with 5909 additions and 2399 deletions

View File

@@ -25,11 +25,13 @@
</el-table-column>
<el-table-column prop="manufacturer" label="厂家" min-width="120" >
</el-table-column>
<el-table-column prop="transport" label="信令传输模式" min-width="120" >
</el-table-column>
<el-table-column label="流传输模式" min-width="160" >
<template slot-scope="scope">
<el-select size="mini" @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="请选择" style="width: 120px">
<el-option key="UDP" label="UDP" value="UDP"></el-option>
<el-option key="TCP-ACTIVE" label="TCP主动模式" :disabled="true" value="TCP-ACTIVE"></el-option>
<el-option key="TCP-ACTIVE" label="TCP主动模式" value="TCP-ACTIVE"></el-option>
<el-option key="TCP-PASSIVE" label="TCP被动模式" value="TCP-PASSIVE"></el-option>
</el-select>
</template>

View File

@@ -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>

View File

@@ -123,7 +123,6 @@
<script>
import devicePlayer from './dialog/devicePlayer.vue'
import uiHeader from '../layout/UiHeader.vue'
import moment from "moment";
import DeviceService from "./service/DeviceService";
import DeviceTree from "./common/DeviceTree";
@@ -290,8 +289,8 @@ export default {
});
},
getSnap: function (row) {
let url = (process.env.NODE_ENV === 'development'? "debug": "") + '/api/device/query/snap/' + row.deviceId + '/' + row.channelId
return url
let baseUrl = window.baseUrl ? window.baseUrl : "";
return ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) + '/api/device/query/snap/' + row.deviceId + '/' + row.channelId;
},
getBigSnap: function (row) {
return [this.getSnap(row)]

View File

@@ -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,
};
},
@@ -96,7 +98,10 @@ export default {
});
},
close: function (){
this.stopDownloadRecord();
if (this.streamInfo.progress < 1) {
this.stopDownloadRecord();
}
if (this.timer !== null) {
window.clearTimeout(this.timer);
this.timer = null;
@@ -158,7 +163,7 @@ export default {
}
setTimeout( ()=>{
if (!this.showDialog) return;
this.getProgressForFile(this.getProgressForFileTimer())
this.getProgressForFile(this.getProgressForFileTimer)
}, 1000)
},
getProgressForFile: function (callback){
@@ -176,13 +181,17 @@ export default {
if (res.data.code === 0) {
if (res.data.data.length === 0){
this.percentage = 0
// 往往在多次请求后(实验五分钟的视频是三次请求),才会返回数据,第一次请求通常是返回空数组
if (callback)callback()
return
}
this.percentage = parseFloat(res.data.data.percentage)*100
// res.data.data应是数组类型
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()
}
@@ -190,7 +199,13 @@ export default {
}).catch(function (error) {
console.log(error);
});
}
},
downloadFileClientEvent: function (){
window.open(this.downloadFile )
}
},
destroyed() {
window.removeEventListener('beforeunload', this.stopDownloadRecord)
}
};
</script>