PageTitle.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div class="pageTitle">
  3. <BackIcon />
  4. <span>算法配置</span>
  5. <span class="cameraName">相机: {{ cameraDetailStore.detail?.name }}</span>
  6. <a :href="previewUrl" target="_blank" v-if="previewUrl">
  7. <svg-icon icon-name="eye-border" style="margin-left: 20px; width: 24px; height: 24px" />
  8. </a>
  9. </div>
  10. </template>
  11. <script lang="ts" setup>
  12. import useCameraDetailStore from '../../store/useCameraDetailStore';
  13. import { useGlobSetting } from '@/hooks/setting';
  14. import { computed } from 'vue';
  15. import { storeToRefs } from 'pinia';
  16. import BackIcon from '@/components/BackIcon/BackIcon.vue';
  17. const cameraDetailStore = useCameraDetailStore();
  18. const { detail } = storeToRefs(cameraDetailStore);
  19. const { appPCUrl } = useGlobSetting();
  20. const previewUrl = computed(() => {
  21. const firstSceneId = detail.value?.sceneTemplateList[0]?.sceneId;
  22. if (!detail.value?.workshopId || !detail.value?.code || !firstSceneId) return '';
  23. return appPCUrl + `#/shop?id=${detail.value?.workshopId}&cameraCode=${detail.value?.code!}&sceneId=${firstSceneId}`;
  24. });
  25. </script>
  26. <style lang="scss" scoped>
  27. .cameraName {
  28. margin-left: 30px;
  29. }
  30. .pageTitle {
  31. padding: 10px;
  32. // font-weight: bold;
  33. font-size: 14px;
  34. display: flex;
  35. align-items: center;
  36. }
  37. </style>