视频监控页面逻辑更改

This commit is contained in:
lxj 2025-07-28 20:27:58 +08:00
parent 289839651d
commit 90c803dfa3
3 changed files with 57 additions and 37 deletions

View File

@ -1,4 +1,4 @@
import type { PageQuery, BaseEntity } from '#/api/common';
import type { BaseEntity, PageQuery } from '#/api/common';
export interface DeviceChannelVO {
/**
@ -51,6 +51,13 @@ export interface DeviceChannelVO {
*/
channelNo: string;
nvrId: string;
nvrFactoryNo: string;
nvrIp: string;
nvrPort: number;
nvrAccount: string;
nvrPwd: string;
nvrChannelNo: string;
}
export interface DeviceChannelForm extends BaseEntity {
@ -103,7 +110,6 @@ export interface DeviceChannelForm extends BaseEntity {
*
*/
channelNo?: string;
}
export interface DeviceChannelQuery extends PageQuery {
@ -153,7 +159,7 @@ export interface DeviceChannelQuery extends PageQuery {
channelNo?: string;
/**
*
*/
*
*/
params?: any;
}

View File

@ -194,31 +194,26 @@ function onNodeChecked(
}
// currentSelectPlayerIndex
else {
checkNode.forEach((item: any) => {
// .
let firstFreePlayerIndex = playerNum.value - 1;
//
let isRecord = false;
//
let isPlayer = true;
//
const freeArr: number[] = []; //
for (let i = 0; i < playerNum.value; i++) {
const playerData = playerList[i];
if (!playerData) {
freeArr.push(i);
}
}
//
if (checkNode.length <= freeArr.length) {
for (let j = 0; j < checkNode.length; j++) {
doPlayer(checkNode[j], freeArr[j]);
}
}
//
else {
for (let i = 0; i < playerNum.value; i++) {
//
const playerData = playerList[i];
// null
if (!isRecord && !playerData) {
firstFreePlayerIndex = i;
isRecord = true;
}
if (playerData && playerData.data.id == item.id) {
isRecord = false;
break;
}
doPlayer(checkNode[i], i);
}
if (isPlayer) {
doPlayer(item, firstFreePlayerIndex);
}
});
}
}
}
//
@ -275,16 +270,29 @@ function changeElPlayer(playerInfo: any, index: number) {
* @param nodeData 播放的节点数据
* @param index 播放器的索引信息
*/
function doPlayer(nodeData: any, index: number) {
function doPlayer(nodeData: any, index: number = 0) {
console.log('index=', index);
if (mpegts.isSupported()) {
const params = {
videoIp: nodeData.deviceIp,
videoPort: nodeData.devicePort,
factoryNo: nodeData.factoryNo,
account: nodeData.deviceAccount,
pwd: nodeData.devicePwd,
channelId: nodeData.channelNo,
};
let params = {};
if (nodeData.nvrIp) {
params = {
videoIp: nodeData.nvrIp,
videoPort: nodeData.nvrPort,
factoryNo: nodeData.nvrFactoryNo,
account: nodeData.nvrAccount,
pwd: nodeData.nvrPwd,
channelId: nodeData.nvrChannelNo,
};
} else {
params = {
videoIp: nodeData.deviceIp,
videoPort: nodeData.devicePort,
factoryNo: nodeData.factoryNo,
account: nodeData.deviceAccount,
pwd: nodeData.devicePwd,
channelId: nodeData.channelNo,
};
}
addStreamProxy(params).then((res) => {
const url = res.wsFlv;
// url nodeData
@ -367,6 +375,12 @@ onUnmounted(() => {
.player {
border: 1px solid #e4e4e7;
cursor: pointer;
video {
width: 100%;
height: 100%;
object-fit: fill;
}
}
.player.selected {

View File

@ -29,7 +29,7 @@ export default defineConfig(async () => {
// mock代理目标地址
// target: 'http://192.168.43.169:8080',
// target: 'https://by.missmoc.top/api/',
target: 'http://127.0.0.1:8080',
target: 'http://192.168.13.27:8080',
// target: 'http://192.168.0.106:8080',
// target: 'http://47.109.37.87:3010',
ws: true,