Newer
Older
urbanLifeline_YanAn / src / views / oneMap / components / FXHG.vue
@zhangqy zhangqy on 12 Nov 4 KB 调整数据
<template>
  <div id="ZHPS">
    <!-- 汛情回顾头部日历 -->
    <TopTimePick @selectTime="selectTime" v-if="!showPanel" />
    <div
      :class="[
        'LeftBox',
        'animate__animated',
        showPanel ? 'animate__fadeOutLeft' : 'animate__fadeInLeft',
      ]"
    >
      <xqhgLeftBox />
    </div>
    <div
      :class="[
        'RightBox',
        'animate__animated',
        showPanel ? 'animate__fadeOutRight' : 'animate__fadeInRight',
      ]"
    >
      <xqRightBox />
    </div>
    <div
      :class="[
        'BottomBox',
        'animate__animated',
        showPanel ? 'animate__bounceInUp' : 'animate__bounceInUp',
      ]"
      v-if="showBottom"
    >
      <sqhgBottomBox :checkTime="checkTime" />
    </div>
  </div>
  <div v-if="!showPanel" class="bnt" @click="goBack">返回</div>
</template>

<script setup name="ZHPS">
import { ref, reactive, toRefs, onMounted, onBeforeUnmount } from "vue";
// import FHPL from '@/views/oneMap/components/FHPL.vue';
import TopTimePick from "@/views/oneMap/components/topTimePick.vue";
import xqhgLeftBox from "@/views/oneMap/FloodStuationReview/xqhgLeftBox.vue";
import xqRightBox from "@/views/oneMap/FloodStuationReview/xqRightBox.vue";
import sqhgBottomBox from "@/views/oneMap/FloodStuationReview/sqhgBottomBox.vue";
import bus from "@/bus";
const AllData = reactive({});
const curType = ref(false);
const showPanel = ref(true); //面板展开收起
const showBottom = ref(true);
// 面板内容展开收起控制
const props = defineProps({
  showPanel: {
    type: Boolean,
  },
});
let checkTime = ref("");
function goBack(params) {
  showPanel.value = true;
  showBottom.value = false;
  // curType.value = true;
  bus.emit("HideFXHG");
  bus.emit("checkBottom", 0);
  bus.emit("SetLayerShow", ["蓝色地图"]);
  if (newfiberMapbox.map.getLayer("dynamicRoute")) {
    newfiberMapbox.map.removeLayer("dynamicRoute");
    newfiberMapbox.map.removeLayer("dynamicRoute_Symbol");
    newfiberMapbox.map.removeSource("dynamicRoute");
    newfiberMapbox.map.removeSource("dynamicRoute_Symbol");
    clearInterval(window.routeTimer);
  }
  newfiberMapbox.map.setBearing(0);
}
function selectTime(time) {
  checkTime.value = time;
}
watch(
  () => props.showPanel,
  () => {
    showPanel.value = props.showPanel;
  },
  { immediate: true }
);
onMounted(() => {
  bus.emit("checkBottom", 1);

  //接受日历
  bus.on("checkRili", (params) => {
    console.log(params, "接收paramsparamsparams");
  });

  let initePSTimer = setInterval(() => {
    if (!newfiberMapbox) return;
    // bus.emit("SetLayerShow", ["白色地图"]);
    bus.emit("setLayerVisible", { layername: "pipeline_info_flow_ys", isCheck: true });
    //bus.emit('setLayerVisible', { layername: 'wsLine1', isCheck: true });
    clearInterval(initePSTimer);
  }, 100);
});
onBeforeUnmount(() => {
  bus.emit("setLayerVisible", { layername: "pipeline_info_flow_ys", 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(4, 34, 84, 0.8) 0%, rgba(4, 34, 84, 0.8) 100%);
    border-radius: 6px;
    border: 1px solid #4aa4ff;
    box-shadow: inset 0 0 5px 5px #4aa4ff8a;
  }
  .RightBox {
    width: 450px;
    height: calc(100% - 98px);
    position: absolute;
    right: 10px;
    top: 70px;
    background: linear-gradient(0deg, rgba(4, 34, 84, 0.8) 0%, rgba(4, 34, 84, 0.8) 100%);
    border-radius: 6px;
    border: 1px solid #4aa4ff;
    box-shadow: inset 0 0 5px 5px #4aa4ff8a;
    z-index: 120;
  }
  .BottomBox {
    width: 900px;
    height: 260px;
    position: absolute;
    right: 500px;
    bottom: 70px;
    background: linear-gradient(0deg, rgba(4, 34, 84, 0.8) 0%, rgba(4, 34, 84, 0.8) 100%);
    border-radius: 6px;
    border: 1px solid #4aa4ff;
    box-shadow: inset 0 0 5px 5px #4aa4ff8a;
  }
}
.bnt {
  width: 62px;
  height: 62px;
  position: absolute;
  left: 520px;
  bottom: 340px;
  background: url("@/assets/images/fhpl/rkan_bnt.png") no-repeat;
  background-size: 100% 100%;
  cursor: pointer;

  font-family: Source Han Sans CN;
  font-weight: 500;
  font-size: 16px;
  color: #ffffff;
  line-height: 60px;
  padding-left: 14px;
}
</style>