<template>
  <div class="middle-section">
    <div class="btn-box">
      <div class="btn" @click="handleQuery1">备战防御</div>
      <div class="btn-active" style="margin-left: 40px">指挥调度</div>
    </div>
    <GlobalMap />
    <slot />
  </div>
</template>

<script lang="ts" setup>
import GlobalMap from '@/views/globalMap/index.vue';
import { useRouter } from 'vue-router';
const props = defineProps({
  flag: Boolean
});
const router = useRouter();
const handleQuery1 = () => {
  router.push({ path: props.flag ? '/' : '/index2' });
};
</script>

<style lang="scss" scoped>
.middle-section {
  flex: 1;
  height: 100%;
  animation: slideAndFade 1.5s;
  position: relative;
}
.btn-box {
  position: absolute;
  top: 60px;
  left: 940px;
  z-index: 10;
  display: flex;
  align-items: center;
  .btn,
  .btn-active {
    width: 454px;
    height: 176px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fafdf9;
    font-size: 78px;
    font-family: YouSheBiaoTiHei;
    background-size: 100% 100%;
  }
  .btn {
    background: url('@/assets/images/btn.png') no-repeat;
    background-size: 100% 100%;
    &:hover {
      background: url('@/assets/images/btnActive.png') no-repeat;
      background-size: 100% 100%;
    }
  }
  .btn-active {
    background: url('@/assets/images/btnActive.png') no-repeat;
    background-size: 100% 100%;
  }
}

@keyframes slideAndFade {
  0% {
    transform: translateY(218px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
</style>
