| | |
| | | |
| | | <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' |
| | |
| | | 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) |
| | |
| | | } |
| | | ) |
| | | onMounted(() => { |
| | | const webSorketUrl = getWebsocketUrl() + '&workspace-id=' + props.deviceInfo.workspace_id |
| | | // 监听ws 消息 |
| | | useConnectWebSocket(messageHandler, webSorketUrl) |
| | | getLiveStatuss() |
| | | }); |
| | | |
| | |
| | | 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 |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | const webSorketUrl = getWebsocketUrl() + '&workspace-id=' + props.deviceInfo.workspace_id |
| | | // 监听ws 消息 |
| | | useConnectWebSocket(messageHandler, webSorketUrl) |
| | | |
| | | // 添加 changs 方法 |
| | | async function changs(value, item) { |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |