PageDrillSignItem.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="safety-platform-container">
  3. <header class="safety-platform-container__header">
  4. <BreadcrumbBack />
  5. <span class="breadcrumb-title">{{ headerTitle }}</span>
  6. </header>
  7. <component :is="dynamicComponent" :id="id" :status="status" />
  8. </div>
  9. </template>
  10. <script setup lang="ts">
  11. import { useRoute } from 'vue-router';
  12. import { computed, defineAsyncComponent } from 'vue';
  13. import { DRILL_SIGN_TYPE } from './constants';
  14. const route = useRoute();
  15. const id = route.params.id;
  16. const type = Number(route.query.type);
  17. const status = Number(route.query.status);
  18. const headerTitle = computed(() => {
  19. let title;
  20. if (type === DRILL_SIGN_TYPE.SCRIPT) {
  21. title = '脚本';
  22. } else if (type === DRILL_SIGN_TYPE.RECORD) {
  23. title = '评估报告';
  24. } else {
  25. title = '';
  26. }
  27. return `演练${title}确认`;
  28. });
  29. const dynamicComponent = computed(() => {
  30. if (type === DRILL_SIGN_TYPE.SCRIPT) {
  31. return defineAsyncComponent(() => import('./components/DrillSignScriptItem.vue'));
  32. } else if (type === DRILL_SIGN_TYPE.RECORD) {
  33. return defineAsyncComponent(() => import('./components/DrillSignRecordItem.vue'));
  34. } else {
  35. return '';
  36. }
  37. });
  38. </script>
  39. <style lang="scss" scoped>
  40. @use '@/styles/page-details-layout.scss' as *;
  41. .safety-platform-container__header {
  42. flex-direction: row !important;
  43. justify-content: flex-start !important;
  44. gap: 8px !important;
  45. }
  46. </style>