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

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

  const route = useRoute();
  const operate = (route.query.operate as string) || 'inventory-create';

  const headerTitle = computed(() => {
    switch (operate) {
      case 'inventory-create':
        return '新增劳防用品采购申请';
      case 'inventory-edit':
        return '编辑劳防用品采购申请';
      case 'inventory-view':
        return '查看劳防用品采购申请';
      case 'audit':
        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>
