<template>
  <!-- <div class="xtjc-left-side" v-show="mapStore.rightSideMenu" :style="{
    transform: `scale(${transformNum})`,
    top: `${transformTop}px`,
    'margin-right': `${transformRight}px`
  }"> -->
  <div class="xtjc-left-side" v-show="mapStore.rightSideMenu">
    <!-- 水情监测 -->
    <regimen />
  </div>
</template>

<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import regimen from './components/regimen.vue';
import { useMapStore } from '/@/store/modules/map';
const mapStore = useMapStore();
import { useDebounceFn } from '@vueuse/core';

let transformNum = ref(0.8)
let transformTop = ref(0)
let transformRight = ref(-40)
const getWindowSize = (e) => {
  let visualHeight = window.innerHeight
  transformNum.value = visualHeight/1080
  transformTop.value = 90-((1080-visualHeight)*0.53)
  transformRight.value = (1080-visualHeight)*-0.26
  // transformNum.value = visualHeight/1080
  // if(visualHeight>911){
  //   transformTop.value = 90
  //   transformRight.value = 0
  //   transformNum.value = 1
  // }else{
  //   transformTop.value = 0
  //   transformRight.value = -40
  //   transformNum.value = 0.8
  // }
}
onMounted(() => {
  window.addEventListener('resize', useDebounceFn(function (event) {
    getWindowSize(event)
  }, 300));
  getWindowSize()
})
</script>
<style lang="less" scoped>
.xtjc-left-side {
  // position: fixed;
  position: absolute;
  right: 0px;
  top: 60px;
  z-index: 3;
  width: 400px;
  // height: 100%;
  margin-right: 0px;
  // transform: scale(0.86);
}
.xtjc-left-side {
  animation-name: move;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}
@keyframes move {
  0% {
    right: -400px;
  }
  100% {
    right: 20px;
  }
}
</style>
