Newer
Older
urbanLifeline_YanAn / src / views / oneMap / components / ZHPS.vue
@jimengfei jimengfei on 18 Oct 2 KB updata
<template>
  <div id="ZHPS">
    <div :class="['LeftBox', 'animate__animated', showPanel ? 'animate__fadeOutLeft' : 'animate__fadeInLeft']">
      <PsLeftBox />
    </div>
    <div :class="['RightBox', 'animate__animated', showPanel ? 'animate__fadeOutRight' : 'animate__fadeInRight']">
      <PsRightBox />
    </div>
  </div>
</template>

<script setup name="ZHPS">
import { ref, reactive, toRefs, onMounted, onBeforeUnmount } from 'vue';
import PsLeftBox from '@/views/oneMap/SmartDrainage/PsLeftBox.vue';
import PsRightBox from '@/views/oneMap/SmartDrainage/PsRightBox.vue';
import bus from '@/bus';
const AllData = reactive({});
const showPanel = ref(true); //面板展开收起
// 面板内容展开收起控制
const props = defineProps({
  showPanel: {
    type: Boolean,
  },
});
watch(
  () => props.showPanel,
  () => {
    showPanel.value = props.showPanel;
  },
  { immediate: true }
);
onMounted(() => {
  // let initePSTimer = setInterval(() => {
  //   if (!newfiberMapbox) return;
  bus.emit('setLayerVisible', { layername: 'ysLine1', isCheck: true });
  //   bus.emit('setLayerVisible', { layername: 'wsLine1', isCheck: true });
  //   clearInterval(initePSTimer);
  // }, 100);
  newfiberMapbox.map.easeTo({
    center: [109.488, 36.596],
    zoom: 12,
    pitch: 55,
  });
});
onBeforeUnmount(() => {
  bus.emit('SetLayerShow', ['蓝色地图']);
  newfiberMapbox.map.setBearing(0);
  bus.emit('setLayerVisible', { layername: 'ysLine1', isCheck: false });
  // bus.emit('setLayerVisible', { layername: 'wsLine1', isCheck: false });
});
</script>

<style lang="scss" scoped>
#ZHPS {
  .LeftBox {
    width: 450px;
    height: calc(100% - 98px);
    position: absolute;
    left: 10px;
    top: 70px;
    background: linear-gradient(0deg, rgba(0, 93, 114, 0.8) 0%, rgba(0, 93, 114, 0.8) 100%);
    border-radius: 6px;
    border: 1px solid #47eef3;
    box-shadow: inset 0 0 5px 5px #47eef38a;
  }
  .RightBox {
    width: 450px;
    height: calc(100% - 98px);
    position: absolute;
    right: 10px;
    top: 70px;
    background: linear-gradient(0deg, rgba(0, 93, 114, 0.8) 0%, rgba(0, 93, 114, 0.8) 100%);
    border-radius: 6px;
    border: 1px solid #47eef3;
    box-shadow: inset 0 0 5px 5px #47eef38a;
  }
}
</style>