index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <script setup lang="ts">
  2. import { useRoute } from 'vue-router'
  3. import { computed } from 'vue'
  4. const route = useRoute()
  5. const subMenuItems = [
  6. { path: '/enterprise/emergency/flood', title: '洪涝灾害救援' },
  7. { path: '/enterprise/emergency/forest-fire', title: '森林火灾救援' },
  8. { path: '/enterprise/emergency/earthquake', title: '地震与地质灾害救援' },
  9. { path: '/enterprise/emergency/mountain-rescue', title: '山岳搜救' }
  10. ]
  11. const currentPath = computed(() => route.path)
  12. </script>
  13. <template>
  14. <div class="emergency-view">
  15. <div class="header">
  16. <h1>应急救援解决方案</h1>
  17. <p class="description">为应急救援提供高效、精准的数字化支持</p>
  18. </div>
  19. <!-- 子菜单导航 -->
  20. <nav class="sub-nav">
  21. <router-link
  22. v-for="item in subMenuItems"
  23. :key="item.path"
  24. :to="item.path"
  25. class="nav-item"
  26. :class="{ active: currentPath === item.path }"
  27. >
  28. {{ item.title }}
  29. </router-link>
  30. </nav>
  31. <!-- 子路由视图 -->
  32. <div class="content">
  33. <router-view></router-view>
  34. </div>
  35. </div>
  36. </template>
  37. <style scoped lang="scss">
  38. @use '@/assets/styles/variables' as v;
  39. @use '@/assets/styles/mixins' as m;
  40. .emergency-view {
  41. padding: v.$spacing-xl v.$spacing-xl * 2;
  42. .header {
  43. text-align: center;
  44. margin-bottom: v.$spacing-xl * 2;
  45. h1 {
  46. font-size: v.$font-size-xxl;
  47. color: v.$text-primary;
  48. margin-bottom: v.$spacing-md;
  49. }
  50. .description {
  51. font-size: v.$font-size-lg;
  52. color: v.$text-secondary;
  53. }
  54. }
  55. .sub-nav {
  56. display: flex;
  57. justify-content: center;
  58. gap: v.$spacing-md;
  59. margin-bottom: v.$spacing-xl;
  60. padding: v.$spacing-md;
  61. background-color: v.$background-light;
  62. border-radius: v.$border-radius-lg;
  63. box-shadow: v.$shadow-sm;
  64. .nav-item {
  65. padding: v.$spacing-sm v.$spacing-md;
  66. color: v.$text-primary;
  67. text-decoration: none;
  68. border-radius: v.$border-radius-md;
  69. transition: all v.$transition-fast;
  70. &:hover {
  71. background-color: rgba(v.$primary-color, 0.1);
  72. color: v.$primary-color;
  73. }
  74. &.active {
  75. background-color: v.$primary-color;
  76. color: white;
  77. }
  78. }
  79. }
  80. .content {
  81. max-width: 1200px;
  82. margin: 0 auto;
  83. }
  84. }
  85. </style>