项目文件路径修改

This commit is contained in:
cwchen 2026-02-04 16:19:44 +08:00
parent f6a6f7d3f4
commit 7542bd196b
9 changed files with 93 additions and 21 deletions

View File

@ -6,7 +6,10 @@ ENV = 'production'
VUE_APP_ENV = 'production'
VUE_APP_ONLYOFFICE_URL = 'http://36.33.26.201:19840'
# 图片预览路径
VUE_APP_FILE_URL = 'http://192.168.0.108:8099/smartCar/profile'
VUE_APP_FILE_URL = 'http://36.33.26.201:18088/profile'
#视频流路径
VUE_APP_VIDEO_URL = 'http://36.33.26.201:18088/processed'
# 车辆道路监测系统/生产环境
VUE_APP_BASE_API = '/smart-car-api'

View File

@ -89,13 +89,13 @@ export const constantRoutes = [
]
},
{
path: '/device/image-recognition/export-progress',
component: () => import('@/views/device/image-recognition/ExportProgress'),
path: '/device/imageRecognition/export-progress',
component: () => import('@/views/device/imageRecognition/ExportProgress'),
hidden: true
},
{
path: '/device/data-recognition/export-progress',
component: () => import('@/views/device/data-recognition/ExportProgress'),
path: '/device/dataRecognition/export-progress',
component: () => import('@/views/device/dataRecognition/ExportProgress'),
hidden: true
}
]

View File

@ -77,7 +77,7 @@
<el-card class="video-card" shadow="never" :body-style="{ padding: '0', height: '100%' }">
<div class="video-wrapper">
<div class="video-container" ref="videoContainer">
<video ref="videoPlayer" class="video-player" :src="videoUrl" autoplay muted
<video ref="videoPlayer" id="myVideo" class="video-player" :src="videoUrl" autoplay muted
@loadedmetadata="handleVideoLoaded" @error="handleVideoError" controlsList="nofullscreen">
您的浏览器不支持视频播放
</video>
@ -201,6 +201,50 @@ export default {
document.removeEventListener('MSFullscreenChange', this.onFullscreenChange)
},
methods: {
async startWhelpPlay() {
// 1. PeerConnection
const pc = new RTCPeerConnection({
iceServers: [{ urls: 'stun:stun.l.google.com:19302' }] // STUN
});
// 2. video
pc.ontrack = (event) => {
document.getElementById('myVideo').srcObject = event.streams[0];
};
// 3. addTransceiver
pc.addTransceiver('video', { direction: 'recvonly' });
pc.addTransceiver('audio', { direction: 'recvonly' });
// 4. Offer
const offer = await pc.createOffer();
await pc.setLocalDescription(offer);
// 5.
// POST SDP
const response = await fetch(`${process.env.VUE_APP_VIDEO_URL}/whep`, {
method: 'POST',
headers: {
'Content-Type': 'application/sdp'
},
body: offer.sdp
});
if (response.status !== 201) {
console.error("连接失败");
return;
}
// 6. Answer
const answerSdp = await response.text();
await pc.setRemoteDescription(new RTCSessionDescription({
type: 'answer',
sdp: answerSdp
}));
console.log("WHEP 握手成功,等待视频流...");
},
/** 初始化 ResizeObserver */
initResizeObserver() {
const container = this.$refs.videoContainer
@ -604,16 +648,19 @@ export default {
async loadVideoStream() {
try {
const res = await getVideoStreamAPI()
const res = await getVideoStreamAPI()
if (res.code === 200 && res.data && res.data.streamUrl) {
this.videoErrorShown = false
this.videoUrl = res.data.streamUrl
}
/*this.startWhelpPlay();*/
} catch (error) {
console.error('获取视频流失败:', error)
}
},
/** 位置锁定 */
async handleLockPosition() {
this.$confirm('确定要锁定设备位置吗?', '位置锁定', {
@ -1048,7 +1095,8 @@ video::-internal-media-controls-download-button {
.status-indicator {
display: inline-flex;
align-items: center;
padding: 6px 14px; /* 稍微加宽一点 */
padding: 6px 14px;
/* 稍微加宽一点 */
border-radius: 20px;
font-size: 14px;
font-weight: 600;
@ -1059,22 +1107,29 @@ video::-internal-media-controls-download-button {
&::before {
content: '';
display: inline-block;
width: 10px; /* 增大尺寸 */
height: 10px; /* 增大尺寸 */
width: 10px;
/* 增大尺寸 */
height: 10px;
/* 增大尺寸 */
border-radius: 50%;
margin-right: 8px;
flex-shrink: 0; /* 防止圆点被挤压 */
flex-shrink: 0;
/* 防止圆点被挤压 */
}
/* 在线:高亮绿 + 强力扩散动画 */
&.online {
background-color: #e1f3d8; /* 浅绿背景 */
color: #67c23a; /* 绿色文字 */
background-color: #e1f3d8;
/* 浅绿背景 */
color: #67c23a;
/* 绿色文字 */
border: 1px solid #c2e7b0;
&::before {
background-color: #529b2e; /* 圆点颜色比文字更深,更实 */
box-shadow: 0 0 0 0 rgba(82, 155, 46, 0.7); /* 初始阴影 */
background-color: #529b2e;
/* 圆点颜色比文字更深,更实 */
box-shadow: 0 0 0 0 rgba(82, 155, 46, 0.7);
/* 初始阴影 */
animation: deep-pulse 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}
}
@ -1095,7 +1150,10 @@ video::-internal-media-controls-download-button {
background-color: #fdf6ec;
color: #e6a23c;
border: 1px solid #f5dab1;
&::before { background-color: #e6a23c; }
&::before {
background-color: #e6a23c;
}
}
/* 升级中 */
@ -1103,6 +1161,7 @@ video::-internal-media-controls-download-button {
background-color: #ecf5ff;
color: #409eff;
border: 1px solid #d9ecff;
&::before {
background-color: #409eff;
animation: blink 1s infinite;
@ -1115,16 +1174,26 @@ video::-internal-media-controls-download-button {
0% {
box-shadow: 0 0 0 0 rgba(82, 155, 46, 0.7);
}
70% {
box-shadow: 0 0 0 8px rgba(82, 155, 46, 0); /* 扩散范围更大 */
box-shadow: 0 0 0 8px rgba(82, 155, 46, 0);
/* 扩散范围更大 */
}
100% {
box-shadow: 0 0 0 0 rgba(82, 155, 46, 0);
}
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
</style>

View File

@ -11,7 +11,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '车辆道路监测系统' // 网页标题
// const baseUrl = 'http://localhost:8080' // 后端接口
const baseUrl = 'http://192.168.0.39:8080'
const baseUrl = 'http://192.168.0.108:8099'
// const baseUrl = 'http://192.168.31.169:8080'
const port = process.env.port || process.env.npm_config_port || 80 // 端口