From 46cdda27d21f30b4e87018e76e438d11c75c7108 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 08 Aug 2025 15:38:03 +0800
Subject: [PATCH] feat: 下载逻辑
---
src/views/device/components/DockControlPanel.vue | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/views/device/components/DockControlPanel.vue b/src/views/device/components/DockControlPanel.vue
index 6a8d389..af1a16e 100644
--- a/src/views/device/components/DockControlPanel.vue
+++ b/src/views/device/components/DockControlPanel.vue
@@ -77,10 +77,7 @@
<script setup>
import { ElMessage } from 'element-plus';
-import EventBus from '@/event-bus'
import { EBizCode, ELocalStorageKey, ERouterName } from '@/types'
-import { useConnectWebSocket } from '@/hooks/use-connect-websocket'
-import { getWebsocketUrl } from '@/websocket/util/config'
import { defineProps, ref, watch, reactive } from 'vue'
import { cmdList as baseCmdList } from '@/types/device-cmd'
import { useDockControl } from './use-dock-control'
@@ -89,6 +86,9 @@
import { setThermalCurrentPaletteStyle, setPhotoStorageSet, setVideoStorageSet, getLiveStatus, setStreamsSwitch, photoAndVideoCmd } from '@/api/device-setting'
import Store from '@/store'
+import { useConnectWebSocket } from '@/utils/websocket/connect-websocket';
+import { getWebsocketUrl } from '@/utils/websocket/config';
+import EventBus from '@/utils/eventBus';
const valueStyle = ref(0)
const cameraModeValue = ref(0)
@@ -248,6 +248,9 @@
}
)
onMounted(() => {
+ const webSorketUrl = getWebsocketUrl() + '&workspace-id=' + props.deviceInfo.workspace_id
+ // 监听ws 消息
+ useConnectWebSocket(messageHandler, webSorketUrl)
getLiveStatuss()
});
@@ -292,13 +295,11 @@
action: cmdItem.action,
}
const success = await sendDockControlCmd(params, true)
- if (success) {
- updateDeviceSingleCmdInfo(cmdList.value[index])
- }
}
// webSocket 监听
const messageHandler = async payload => {
+ payload = JSON.parse(payload)
if (!payload) {
return
}
@@ -384,9 +385,6 @@
}
}
-const webSorketUrl = getWebsocketUrl() + '&workspace-id=' + props.deviceInfo.workspace_id
-// 监听ws 消息
-useConnectWebSocket(messageHandler, webSorketUrl)
// 添加 changs 方法
async function changs(value, item) {
@@ -532,4 +530,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3