|  |  |  | 
|---|
|  |  |  | <i class="el-icon-video-camera"  ></i> | 
|---|
|  |  |  | {{ item.substring(0,17)}} | 
|---|
|  |  |  | </el-tag> | 
|---|
|  |  |  | <a class="el-icon-download" style="color: #409EFF;font-weight: 600;margin-left: 10px;" :href="`${basePath}/download.html?url=record/${recordFile.app}/${recordFile.stream}/${chooseDate}/${item}`" target="_blank" /> | 
|---|
|  |  |  | <a class="el-icon-download" style="color: #409EFF;font-weight: 600;margin-left: 10px;" :href="`${getFileBasePath()}/download.html?url=download/${recordFile.app}/${recordFile.stream}/${chooseDate}/${item}`" target="_blank" /> | 
|---|
|  |  |  | </li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | <li class="task-list-item" v-for="(item, index) in taskListEnded" :key="index"> | 
|---|
|  |  |  | <div class="task-list-item-box" style="height: 2rem;line-height: 2rem;"> | 
|---|
|  |  |  | <span>{{ item.startTime.substr(10) }}-{{item.endTime.substr(10)}}</span> | 
|---|
|  |  |  | <a class="el-icon-download download-btn" :href="mediaServerPath  + '/download.html?url=../' + item.recordFile" target="_blank"> | 
|---|
|  |  |  | <a class="el-icon-download download-btn" :href="getFileBasePath()  + '/download.html?url=download/' + item.recordFile" target="_blank"> | 
|---|
|  |  |  | </a> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </li> | 
|---|
|  |  |  | 
|---|
|  |  |  | import uiHeader from '../layout/UiHeader.vue' | 
|---|
|  |  |  | import player from './dialog/easyPlayer.vue' | 
|---|
|  |  |  | import moment  from 'moment' | 
|---|
|  |  |  | import axios from "axios"; | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'app', | 
|---|
|  |  |  | components: { | 
|---|
|  |  |  | uiHeader, player | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | props: ['recordFile', 'mediaServerId', 'dateFiles', 'mediaServerPath'], | 
|---|
|  |  |  | props: ['recordFile', 'mediaServerId', 'dateFiles'], | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | basePath: `${this.mediaServerPath}`, | 
|---|
|  |  |  | dateFilesObj: [], | 
|---|
|  |  |  | detailFiles: [], | 
|---|
|  |  |  | chooseDate: null, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.queryRecordDetails(()=>{ | 
|---|
|  |  |  | if (this.detailFiles.length > 0){ | 
|---|
|  |  |  | console.log(this.detailFiles) | 
|---|
|  |  |  | let timeForFile = this.getTimeForFile(this.detailFiles[0]); | 
|---|
|  |  |  | let lastTimeForFile = this.getTimeForFile(this.detailFiles[this.detailFiles.length - 1]); | 
|---|
|  |  |  | let timeNum = timeForFile[0].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime() | 
|---|
|  |  |  | console.log(timeNum) | 
|---|
|  |  |  | let lastTimeNum = lastTimeForFile[1].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.playTime = parseInt(timeNum/1000) | 
|---|
|  |  |  | this.sliderMIn = parseInt(timeNum/1000 - timeNum/1000%(60*60)) | 
|---|
|  |  |  | console.log(this.sliderMIn ) | 
|---|
|  |  |  | this.sliderMax = parseInt(lastTimeNum/1000 - lastTimeNum/1000%(60*60)) + 60*60 | 
|---|
|  |  |  | console.log(this.sliderMax ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | that.$axios({ | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | url:`./record_proxy/${that.mediaServerId}/api/record/file/list`, | 
|---|
|  |  |  | url:`/record_proxy/${that.mediaServerId}/api/record/file/list`, | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | app: that.recordFile.app, | 
|---|
|  |  |  | stream: that.recordFile.stream, | 
|---|
|  |  |  | 
|---|
|  |  |  | if (file == null) { | 
|---|
|  |  |  | this.videoUrl = ""; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | // TODO 控制列表滚动条 | 
|---|
|  |  |  | this.videoUrl = `${this.basePath}/record/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}` | 
|---|
|  |  |  | this.videoUrl = `${this.getFileBasePath()}/download/${this.recordFile.app}/${this.recordFile.stream}/${this.chooseDate}/${this.choosedFile}` | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log(this.videoUrl) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | getFileBasePath(){ | 
|---|
|  |  |  | let basePath = "" | 
|---|
|  |  |  | if (axios.defaults.baseURL.startsWith("http")) { | 
|---|
|  |  |  | basePath = `${axios.defaults.baseURL}/record_proxy/${this.mediaServerId}` | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | basePath = `${window.location.origin}${axios.defaults.baseURL}/record_proxy/${this.mediaServerId}` | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return basePath; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | getDataWidth(item){ | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getTimeForFile(file){ | 
|---|
|  |  |  | console.log(file) | 
|---|
|  |  |  | let timeStr = file.substring(0,17); | 
|---|
|  |  |  | if(timeStr.indexOf("~") > 0){ | 
|---|
|  |  |  | timeStr = timeStr.replaceAll("-",":") | 
|---|
|  |  |  | } | 
|---|
|  |  |  | let timeArr = timeStr.split("~"); | 
|---|
|  |  |  | let timeArr = timeStr.split("-"); | 
|---|
|  |  |  | let starTime = new Date(this.chooseDate + " " + timeArr[0]); | 
|---|
|  |  |  | let endTime = new Date(this.chooseDate + " " + timeArr[1]); | 
|---|
|  |  |  | if(this.checkIsOver24h(starTime,endTime)){ | 
|---|
|  |  |  | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | this.$axios({ | 
|---|
|  |  |  | method: 'delete', | 
|---|
|  |  |  | url:`./record_proxy/${that.mediaServerId}/api/record/delete`, | 
|---|
|  |  |  | url:`/record_proxy/${that.mediaServerId}/api/record/delete`, | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | page: that.currentPage, | 
|---|
|  |  |  | count: that.count | 
|---|
|  |  |  | 
|---|
|  |  |  | that.dateFilesObj = {}; | 
|---|
|  |  |  | this.$axios({ | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | url:`./record_proxy/${that.mediaServerId}/api/record/date/list`, | 
|---|
|  |  |  | url:`/record_proxy/${that.mediaServerId}/api/record/date/list`, | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | app: that.recordFile.app, | 
|---|
|  |  |  | stream: that.recordFile.stream | 
|---|
|  |  |  | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | this.$axios({ | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, | 
|---|
|  |  |  | url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`, | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | app: that.recordFile.app, | 
|---|
|  |  |  | stream: that.recordFile.stream, | 
|---|
|  |  |  | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | this.$axios({ | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | url:`./record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, | 
|---|
|  |  |  | url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`, | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | isEnd: isEnd, | 
|---|
|  |  |  | } | 
|---|