智慧园区前端大屏
zrj
2024-11-09 5de2d6f333bb6bb6eeb2baee4ca7fd0f3a6d88ff
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!--
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:24
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-08 11:50:25
 * @FilePath: \bigScreen\src\views\layout\index.vue
 * @Description:
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
-->
<template>
  <div class="wrapper">
    <div v-if="showSinglePage" class="main-content single-page" id="MainContent">
      <div class="w100 h100">
        <div class="main-header">
          <div class="title">吉水化工园区“一园一策一图”VR平台</div>
 
          <div class="login-out" @click="signOut">
            <img :src="loginOutBg" class="img" />
            <span>退出</span>
          </div>
        </div>
 
        <div class="main-container">
          <!-- 地图区域 -->
          <router-view></router-view>
        </div>
 
        <main-menu></main-menu>
      </div>
    </div>
 
    <map-container v-if="!showSinglePage" ref="MapContainer">
      <template #content>
        <div v-if="showContent" :class="[showSubLayout ? 'main-content-sub' : 'main-content']" id="MainContent">
          <main-search></main-search>
          <main-tool></main-tool>
 
          <div v-if="showSubLayout" class="w100 h100">
            <router-view class="w100 h100"></router-view>
          </div>
 
          <div v-if="!showSubLayout" class="w100 h100">
            <div class="main-header">
              <div class="title">吉水化工园区“一园一策一图”VR平台</div>
 
              <div class="login-out" @click="signOut">
                <img :src="loginOutBg" class="img" />
                <span>退出</span>
              </div>
            </div>
 
            <div class="main-container">
              <!-- 地图区域 -->
              <router-view></router-view>
            </div>
 
            <main-menu></main-menu>
          </div>
        </div>
      </template>
    </map-container>
  </div>
</template>
 
<script setup>
import { useRouter, useRoute } from 'vue-router'
let router = useRouter()
import { getAssetsFile } from 'utils/utils'
const loginOutBg = getAssetsFile('login.png', '/images')
import mainSearch from './components/mainSearch.vue'
import mainTool from './components/mainTool.vue'
import mainMenu from './components/mainMenu.vue'
 
import { useLogin } from 'store/login'
const loginStore = useLogin()
import { useMap } from 'store/map'
import { useRouterStore } from 'store/router'
const store = useMap()
const storeRouter = useRouterStore()
const showContent = ref(false)
const showSubLayout = ref(false)
const showSinglePage = ref(false)
// 监听createB的变化
watch(
  [
    () => store.loadMap,
    () => storeRouter.loadSub,
    () => storeRouter.loadSingle,
  ],
  ([newLoadMap, newLoadSub, newLoadSingle]) => {
    showContent.value = newLoadMap
    showSubLayout.value = newLoadSub
    showSinglePage.value = newLoadSingle
  },
  { immediate: true } // 设置immediate为true以便在组件挂载时立即检查createB的值
)
 
const signOut = () => {
  loginStore.LogOut().then(res => {
    router.push('/login')
  })
}
</script>
 
<style scoped lang="scss">
$bg-blue: rgba(24, 33, 92, 0.9);
 
.wrapper {
  position: relative;
  width: 100%;
  height: 100%;
 
  #MainContent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
  }
 
  .main-content {
    height: 1080px;
    background: url(/images/header.png) no-repeat center / 100% 100%,
      url(/images/pro-bg.png) no-repeat center / 100% 100%;
 
    pointer-events: none;
 
    &.single-page {
      background: url(/images/header.png) no-repeat center / 100% 100%,
        url(/images/pro-bg.png) no-repeat center / 100% 100%,
        rgba(0, 0, 0, 1);
    }
 
    .main-header {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 40px;
      pointer-events: auto;
 
      .title {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 640px;
        height: 40px;
        font-size: 24px;
        font-family: YouSheBiaoTiHei;
        font-weight: 400;
        color: #eff8fc;
        line-height: 40px;
        text-align: center;
        letter-spacing: 8px;
        font-weight: bolder;
        background: linear-gradient(to bottom,
            #e2eaf0 0%,
            #aed1f1 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        // opacity: 0.89;
        // text-shadow: 0px 4px 1px rgba(19, 80, 143, 0.66);
 
        // background: linear-gradient(0deg, rgba(119, 186, 255, 0.45) 0%, rgba(233, 248, 255, 0.45) 73.3154296875%, rgba(255, 255, 255, 0.45) 100%);
        // -webkit-background-clip: text;
        // -webkit-text-fill-color: transparent;
      }
 
 
      .login-out {
        position: absolute;
        top: 10px;
        right: 40px;
        height: 36px;
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
 
        .img {
          width: 16px;
          height: 16px;
        }
 
        span {
          font-size: 13px;
        }
      }
    }
 
    .main-container {
      position: absolute;
      top: 40px;
      left: 40px;
      right: 40px;
      bottom: 40px;
    }
  }
 
 
  .main-content-sub {
    height: 1080px;
    background: url(/images/wrapper-box-bg.png) no-repeat center / 100% 100%,
      url(/images/pro-bg.png) no-repeat center / 100% 100%;
 
    pointer-events: none;
 
    .main-header {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 40px;
      pointer-events: auto;
 
      .title {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 640px;
        height: 40px;
        font-size: 24px;
        font-family: YouSheBiaoTiHei;
        font-weight: 400;
        color: #eff8fc;
        line-height: 40px;
        text-align: center;
        letter-spacing: 8px;
        font-weight: bolder;
        background: linear-gradient(to bottom,
            #e2eaf0 0%,
            #aed1f1 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        // opacity: 0.89;
        // text-shadow: 0px 4px 1px rgba(19, 80, 143, 0.66);
 
        // background: linear-gradient(0deg, rgba(119, 186, 255, 0.45) 0%, rgba(233, 248, 255, 0.45) 73.3154296875%, rgba(255, 255, 255, 0.45) 100%);
        // -webkit-background-clip: text;
        // -webkit-text-fill-color: transparent;
      }
 
 
      .login-out {
        position: absolute;
        top: 10px;
        right: 40px;
        height: 36px;
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
 
        .img {
          width: 16px;
          height: 16px;
        }
 
        span {
          font-size: 13px;
        }
      }
    }
 
    .main-container {
      position: absolute;
      top: 40px;
      left: 40px;
      right: 40px;
      bottom: 40px;
    }
  }
}
</style>