视频监控页面逻辑更改

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 { export interface DeviceChannelVO {
/** /**
@ -51,6 +51,13 @@ export interface DeviceChannelVO {
*/ */
channelNo: string; channelNo: string;
nvrId: string;
nvrFactoryNo: string;
nvrIp: string;
nvrPort: number;
nvrAccount: string;
nvrPwd: string;
nvrChannelNo: string;
} }
export interface DeviceChannelForm extends BaseEntity { export interface DeviceChannelForm extends BaseEntity {
@ -103,7 +110,6 @@ export interface DeviceChannelForm extends BaseEntity {
* *
*/ */
channelNo?: string; channelNo?: string;
} }
export interface DeviceChannelQuery extends PageQuery { export interface DeviceChannelQuery extends PageQuery {
@ -153,7 +159,7 @@ export interface DeviceChannelQuery extends PageQuery {
channelNo?: string; channelNo?: string;
/** /**
* *
*/ */
params?: any; params?: any;
} }

View File

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

View File

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