refactor(record): 移除视频播放相关代码

- 删除了 VideoPlayer 组件的实现
- 移除了旧的 OldVideoPlayer组件
- 注释掉了路由配置中的视频播放页面
- 删除了 recordInspectionCabinet 中的视频播放相关代码
IOT
zch 9 months ago
parent f21d35039d
commit c2b6083e1e

@ -53,6 +53,10 @@ export function countBusbar() {
})
}
/**
* 查询母排信息列表
*/
export function baseBusbarInfolist(data) {
return request({
url: '/base/baseBusbarInfo/baseBusbarInfolist',

@ -8,7 +8,8 @@ Vue.use(Router)
import Layout from '@/layout'
import BoardLayout from '@/layout/index2'
/*import VideoPlayer from "@/views/record/recordInspectionCabinet/OldVideoPlayer.vue";*/
import VideoPlayer from "@/views/record/recordInspectionCabinet/VideoPlayer.vue";
// import VideoPlayer from "@/views/record/recordInspectionCabinet/VideoPlayer.vue";
/**
* Note: 路由配置项
*
@ -49,11 +50,11 @@ export const constantRoutes = [
component: () => import('@/views/login'),
hidden: true
},
{
/* {
path: '/video-player',
component: VideoPlayer
},
},*/
{
path: '/register',
component: () => import('@/views/register'),

@ -1,180 +0,0 @@
<!--
<template>
<div class="video-container">
<h1>视频播放页面</h1>
<video controls width="640" ref="thermalVideo" :src="thermalVideo" height="360" autoplay>
您的浏览器不支持 video 标签
</video>
<video controls width="640" ref="visibleVideo" :src="visibleVideo" height="360" autoplay>
您的浏览器不支持 video 标签
</video>
</div>
</template>
<script>
import { getThermalVideo, getVisibleVideo } from "@/api/record/recordInspectionCabinet";
import axios from 'axios';
export default {
data() {
return {
thermalVideo: '',
visibleVideo: '',
thermalVideoUrl: '',
visibleVideoUrl: '',
thermalVideoPath: '',
visibleVideoPath: ''
};
},
mounted() {
this.loadVideoPaths();
},
methods: {
async loadVideoPaths() {
const filePath = this.$route.query.filePath;
try {
const thermalResponse = `/dev-api/record/recordInspectionCabinet/getThermalVideo/${filePath}`;
this.thermalVideoUrl = thermalResponse;
const visibleResponse = `/dev-api/record/recordInspectionCabinet/getVisibleVideo/${filePath}`;
this.visibleVideoUrl = visibleResponse;
/* const thermalResponse = `/prod-api/record/recordInspectionCabinet/getThermalVideo/${filePath}`;
this.thermalVideoUrl = thermalResponse;
const visibleResponse = `/prod-api/record/recordInspectionCabinet/getVisibleVideo/${filePath}`;
this.visibleVideoUrl = visibleResponse;*/
/* const thermalResponse = getThermalVideo(filePath);
this.thermalVideoUrl = thermalResponse;
const visibleResponse= getVisibleVideo(filePath);
this.visibleVideoUrl = visibleResponse;*/
console.log(this.thermalVideoUrl);
console.log(this.visibleVideoUrl);
this.playVideo();
} catch (error) {
console.log(error);
}
},
playVideo() {
//
if (this.thermalVideo !== this.thermalVideoUrl) {
this.thermalVideo = this.thermalVideoUrl;
this.$refs.thermalVideo.load(); //
}
if (this.visibleVideo !== this.visibleVideoUrl) {
this.visibleVideo = this.visibleVideoUrl;
this.$refs.visibleVideo.load(); //
}
//
this.$refs.thermalVideo.onloadeddata = () => {
this.$refs.thermalVideo.play();
};
this.$refs.visibleVideo.onloadeddata = () => {
this.$refs.visibleVideo.play();
};
}
}
};
</script>
<style scoped>
video {
margin: 10px 0;
}
.video-container {
display: flex;
flex-direction: column;
align-items: center;
}
.video-container video {
margin-bottom: 20px; /* 在每个视频下方添加20px的间隔 */
}
</style>-->
<template>
<div class="video-container">
<h1>视频播放页面</h1>
<video controls ref="thermalVideo" width="640" height="360" autoplay crossorigin>
<source :src="thermalVideo" type="video/mp4">
您的浏览器不支持 video 标签
</video>
<video controls ref="visibleVideo" width="640" height="360" autoplay crossorigin>
<source :src="visibleVideo" type="video/mp4">
您的浏览器不支持 video 标签
</video>
</div>
</template>
<script>
export default {
data() {
return {
thermalVideo: '',
visibleVideo: '',
thermalVideoUrl: '',
visibleVideoUrl: '',
thermalVideoPath: '',
visibleVideoPath: ''
};
},
mounted() {
this.loadVideoPaths();
},
methods: {
async loadVideoPaths() {
const filePath = this.$route.query.filePath;
try {
//TODO:
const thermalResponse = `/dev-api/record/recordInspectionCabinet/getThermalVideo/${filePath}`;
this.thermalVideoUrl = thermalResponse;
const visibleResponse = `/dev-api/record/recordInspectionCabinet/getVisibleVideo/${filePath}`;
this.visibleVideoUrl = visibleResponse;
/* const thermalResponse = `/prod-api/record/recordInspectionCabinet/getThermalVideo/${filePath}`;
this.thermalVideoUrl = thermalResponse;
const visibleResponse = `/prod-api/record/recordInspectionCabinet/getVisibleVideo/${filePath}`;
this.visibleVideoUrl = visibleResponse;*/
this.playVideo();
} catch (error) {
console.log(error);
}
},
playVideo() {
this.thermalVideo = this.thermalVideoUrl;
this.visibleVideo = this.visibleVideoUrl;
this.$refs.thermalVideo.play();
this.$refs.visibleVideo.play();
}
},
}
</script>
<style scoped>
video {
margin: 10px 0;
}
.video-container {
display: flex;
flex-direction: column;
align-items: center;
}
.video-container video {
margin-bottom: 20px; /* 在每个视频下方添加20px的间隔 */
}
</style>

@ -1,3 +1,4 @@
<!--
<template>
<div class="video-container">
<h1>视频播放页面</h1>
@ -159,3 +160,4 @@ export default {
background-color: black; /* 背景色,可根据需要调整 */
}
</style>
-->

@ -463,16 +463,16 @@ export default {
}, `recordInspectionCabinet_${new Date().getTime()}.xlsx`)
},
openVideoPage(filePath) {
/* openVideoPage(filePath) {
if(filePath){
const url = `/video-player`;
/* this.$router.push({path:url,query: {filePath}});*/
/!* this.$router.push({path:url,query: {filePath}});*!/
const fullPath = `${url}?filePath=${encodeURIComponent(filePath)}`;
window.open(fullPath, '_blank');
}else {
this.$modal.msgError("暂无文件路径");
}
},
},*/
}
};

Loading…
Cancel
Save