Browse Source

fix: [算法配置]-平台相机预览点击跳转时带上sceneId

louhangfei 1 year ago
parent
commit
a9c17fe4f4

+ 8 - 4
src/views/cameras/preview/components/FenceAppSetting/FenceAppSetting.vue

@@ -25,9 +25,8 @@
     getCameraAlgoPresetList,
     choosePreset,
     getAppCameraAlgoPreset,
-    CameraAlgoPresetResp,
   } from '@/api/camera/camera-preview';
-  import { computed, onMounted, ref, watch } from 'vue';
+  import { computed, ref, watch } from 'vue';
   import useCameraDetailStore from '../../store/useCameraDetailStore';
   import { storeToRefs } from 'pinia';
   import { OptionType } from './constants';
@@ -42,8 +41,13 @@
   const { appPCUrl } = useGlobSetting();
 
   const previewUrl = computed(() => {
-    if (!detail.value?.workshopId || !detail.value?.code) return '';
-    return appPCUrl + `#/shop?id=${detail.value?.workshopId}&cameraId=${detail.value?.code!}`;
+    const firstSceneId = detail.value?.sceneTemplateList[0]?.sceneId;
+    if (!detail.value?.workshopId || !detail.value?.code || !firstSceneId) return '';
+    return (
+      appPCUrl +
+      `#/shop?id=${detail.value?.workshopId}&cameraId=${detail.value
+        ?.code!}&sceneId=${firstSceneId}`
+    );
   });
 
   watch(