MiddleSection.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class="middle-section">
  3. <div class="btn-box">
  4. <div class="btn" @click="handleQuery1">备战防御</div>
  5. <div class="btn-active" style="margin-left: 40px">指挥调度</div>
  6. </div>
  7. <GlobalMap />
  8. <slot />
  9. </div>
  10. </template>
  11. <script lang="ts" setup>
  12. import GlobalMap from '@/views/globalMap/index.vue';
  13. import { useRouter } from 'vue-router';
  14. const props = defineProps({
  15. flag: Boolean
  16. });
  17. const router = useRouter();
  18. const handleQuery1 = () => {
  19. router.push({ path: props.flag ? '/' : '/index2' });
  20. };
  21. </script>
  22. <style lang="scss" scoped>
  23. .middle-section {
  24. flex: 1;
  25. height: 100%;
  26. animation: slideAndFade 1.5s;
  27. position: relative;
  28. }
  29. .btn-box {
  30. position: absolute;
  31. top: 60px;
  32. left: 940px;
  33. z-index: 10;
  34. display: flex;
  35. align-items: center;
  36. .btn,
  37. .btn-active {
  38. width: 454px;
  39. height: 176px;
  40. cursor: pointer;
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. color: #fafdf9;
  45. font-size: 78px;
  46. font-family: YouSheBiaoTiHei;
  47. background-size: 100% 100%;
  48. }
  49. .btn {
  50. background: url('@/assets/images/btn.png') no-repeat;
  51. background-size: 100% 100%;
  52. &:hover {
  53. background: url('@/assets/images/btnActive.png') no-repeat;
  54. background-size: 100% 100%;
  55. }
  56. }
  57. .btn-active {
  58. background: url('@/assets/images/btnActive.png') no-repeat;
  59. background-size: 100% 100%;
  60. }
  61. }
  62. @keyframes slideAndFade {
  63. 0% {
  64. transform: translateY(218px);
  65. opacity: 0;
  66. }
  67. 100% {
  68. transform: translateX(0);
  69. opacity: 1;
  70. }
  71. }
  72. </style>