feat(securitySurveillance): 实现首页大屏数据展示和设备状态动态更新

- 新增获取首页大屏数据的API接口
- 在安全监控页面添加数据获取逻辑并传递给子组件
- 更新设备状态组件显示实时在线/离线数据
- 优化视频监控组件播放器初始化和销毁逻辑
- 调整API接口路径和参数格式
- 移除无用代码和注释
This commit is contained in:
tcy
2025-09-24 16:31:18 +08:00
parent 4163b11d3d
commit 64c538775f
9 changed files with 211 additions and 89 deletions

View File

@ -55,6 +55,8 @@
import { ref, onBeforeUnmount, getCurrentInstance, nextTick } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import { listDevicePreset, addDevicePreset, updateDevicePreset, delDevicePreset, callDevicePreset } from '@/api/devicePreset';
import { getToken } from '@/api/securitySurveillance/index.js';
import EZUIKit from 'ezuikit-js';
const emit = defineEmits(['update']);
@ -127,8 +129,8 @@ function addPre() {
function videoPlay(obj: any) {
console.log('objobjobj', obj);
getAccessToken().then((res: any) => {
if (res.code == 200 && obj.deviceSerial) {
getToken().then((res: any) => {
if (res.msg == "ok" && obj.deviceSerial) {
flvPlayer.value = new EZUIKit.EZUIKitPlayer({
audio: '0',
id: 'video-container',
@ -211,7 +213,12 @@ function handleDelete(row: any) {
// 调用
function handleDebug(row: any) {
callDevicePreset(row.id).then((res: any) => {
callDevicePreset([{
deviceSerial: row.deviceSerial,
presetIndex: row.presetIndex,
channelNo: "1",
id: row.id
}]).then((res: any) => {
if (res.code === 200) {
ElMessage.success('调用成功');
}