Просмотр исходного кода

fix(photography): 解决相机预览设备状态异常处理

- 添加设备状态异常时的消息提示功能
- 实现预览显示时设备异常的错误处理逻辑
- 完善预览隐藏时设备异常的状态检查
- 确保异常情况下正确返回和解析状态
panqiuyao 1 день назад
Родитель
Сommit
4dd0e1cf63
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      frontend/src/views/Photography/check.vue

+ 8 - 0
frontend/src/views/Photography/check.vue

@@ -221,6 +221,10 @@ function showVideo(point_name = 'A') {
   clientStore.ipc.on(icpList.camera.PreviewShow, async (event, result) => {
     console.log('打开预览=====================')
     console.log(result)
+    if (result.device_status === -1 && result.msg){
+      ElMessage.error(result.msg)
+      return;
+    }
     clearPreviewInterval()
     hideVideoTimer = setTimeout(() => {
       interval = setInterval(() => {
@@ -242,6 +246,10 @@ async function hideVideo(point_name = 'A') {
     clientStore.ipc.on(icpList.camera.PreviewHide, async (event, result) => {
       console.log('关闭预览回调=====================')
       console.log(result)
+      if (result.device_status === -1 && result.msg){
+        console.log(result.msg)
+        resolve(true)
+      }
       isHidingVideo.value = false
       // 如果有待执行的打开请求,执行它
       if (pendingShowVideoPoint) {