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
| <template>
| <div class="home">
| <div id="cesium"></div>
| <div class="page-index">
| <RouterView></RouterView>
| </div>
| </div>
| </template>
|
| <script setup>
| import { onMounted } from 'vue';
| import CesiumInstance from '@/utils/cesium/cesiumInstance';
| import { RouterView } from 'vue-router';
|
| onMounted(() => {
| new CesiumInstance('cesium'); // 只初始化一次
| });
| </script>
|
| <script>
| import index from '@/mixins';
| import { mapGetters } from 'vuex';
|
| export default {
| mixins: [index],
| components: {},
| name: 'index',
| provide() {
| return {
| index: this,
| };
| },
| computed: {},
| props: [],
| methods: {},
| };
| </script>
| <style scoped lang="scss">
| .home {
| position: relative;
| height: 100%;
| width: 100%;
| overflow: hidden;
|
| #cesium {
| height: 100%;
| width: 100%;
|
| :deep() {
| .cesium-viewer {
| width: 100%;
| height: 100%;
|
| .cesium-viewer-cesiumWidgetContainer {
| width: 100%;
| height: 100%;
|
| .cesium-widget {
| width: 100%;
| height: 100%;
|
| canvas {
| width: 100%;
| height: 100%;
| }
| }
| }
| }
| }
| }
|
| .page-index {
| left: 0;
| top: 0;
| position: absolute;
| z-index: 999;
| height: 100%;
| width: 100%;
| background-image: url('../assets/images/bg.png');
| background-size: 100% 100%;
| background-repeat: no-repeat;
| pointer-events: none;
| color: red;
| >*{
| pointer-events: auto;
| }
| }
| }
| </style>
|
|