<template>
  <div class="safety-platform-container">
    <header class="safety-platform-container__header">
      <BreadcrumbBack />
      <span class="breadcrumb-title">{{ headerTitle }}</span>
    </header>
    <CheckTemplateManagementDetail :id="id" />
  </div>
</template>

<script setup lang="ts">
  import { computed } from 'vue';
  import { useRoute } from 'vue-router';
  import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
  import CheckTemplateManagementDetail from './components/checkTemplateManagementDetail.vue';

  const route = useRoute();
  const operate = route.query.operate as string;
  const id = computed(() => Number(route.query.id));

  const headerTitle = computed(() => {
    switch (operate) {
      case 'check-template-create':
        return '新增检查单模版';
      case 'check-template-edit':
        return '编辑检查单模版';
      case 'check-template-view':
        return '查看检查单模版';
      default:
        return '未知操作';
    }
  });
</script>

<style scoped lang="scss">
  @use '@/styles/page-details-layout.scss' as *;
  @use '@/styles/page-main-layout.scss' as *;

  .safety-platform-container__header {
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }
</style>

