基于亦庄一张图系统为模板创建的Demo系统
surprise
2024-04-16 f51e0da4c397110b2916a9dc371b6d745042029d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!--
 * @Description: 
 * @Author: TT
 * @Date: 2023-02-27 11:30:56
 * @LastEditTime: 2023-03-06 15:19:16
 * @LastEditors: TT
-->
<template>
  <div class="MapBox">
    <div class="banner" :class="{ leftMap: !screenFlag }">
      <!-- <div id="cesiumContainer"></div> -->
      <!--  -->
    </div>
    <div class="rightMap"></div>
  </div>
</template>
 
<script lang="ts" setup>
import {
  ref,
  onMounted,
  onBeforeUnmount,
  reactive,
  defineProps,
  defineEmits,
  watch,
} from "vue";
import store from "@/store";
import mapView from "../assets/js/mapView.js";
const popOption = ref();
const screenFlag = ref(true);
const popFlag = ref(false);
const videoUrl = ref(null);
const imageUrl = ref(null);
const showImg = ref(null);
const setShowPops = (res) => {
  imageUrl.value = null;
  videoUrl.value = null;
  showImg.value = null;
  if (res["remarks"] && res["remarks"]._value) {
    var name = res["name"]._value;
    var id = res["remarks"]._value;
    var url = config.popVideo + name + "/" + id;
    showImg.value = "video";
    popOption.value = name;
    videoUrl.value = url;
  } else if (res["TE_DESC"] && res["TE_DESC"]._value) {
    popOption.value = res["TE_DESC"]._value;
  } else {
    showImg.value = "img";
    var name = res["name"]._value;
    var id = res["Id"]._value;
    var url = config.popImg + name + "/" + id + ".jpg";
    imageUrl.value = url;
    popOption.value = name + "_" + id + "号";
  }
 
  popFlag.value = true;
};
watch(
  () => store.state.showProperties,
  (newVal, oldVal) => {
    if (newVal) {
      setShowPops(newVal);
    }
  },
  { immediate: true, deep: true }
);
watch(
  () => store.state.showScreenFlag,
  (newVal, oldVal) => {
    screenFlag.value = newVal;
  },
  { immediate: true, deep: true }
);
onMounted(() => {
  // mapView.init();
});
onBeforeUnmount(() => {});
</script>
<style scoped lang="less">
.MapBox {
  width: 100%;
  height: 100%;
  position: absolute;
 
  .banner {
    width: 100%;
    height: 100vh;
    position: absolute;
    background-size: cover;
  }
 
  .leftMap {
    width: 50%;
    height: 100vh;
    position: absolute;
    background: skyblue;
    background-size: cover;
    float: left;
  }
  .rightMap {
    width: 50%;
    height: 100vh;
    position: absolute;
    background: red;
    background-size: cover;
    float: right !important;
  }
}
</style>