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
| <template>
| <div class="data-screen">
| <Header />
| <div v-if="loading" class="main-content">
| <LeftPanel :staticsData="staticsData" :rentRank="rentRank" />
| <MapPanel />
| <RightPanel :staticsData="staticsData" />
| </div>
| <BottomCharts v-if="loading" :rentIncomeTrend="rentIncomeTrend" :tenantCountTrend="tenantCountTrend" />
| <div class="footer"></div>
| </div>
| </template>
|
| <script>
| import Header from '@/components/Header.vue'
| import LeftPanel from '@/components/LeftPanel.vue'
| import MapPanel from '@/components/MapPanel.vue'
| import RightPanel from '@/components/RightPanel.vue'
| import BottomCharts from '@/components/BottomCharts.vue'
| import { getStaticsData, getRentRank, getRentIncomeTrend, getTenantCountTrend } from '@/components/service'
| import {
| Message
| } from 'element-ui'
|
| export default {
| name: 'DataScreen',
| components: {
| Header,
| LeftPanel,
| MapPanel,
| RightPanel,
| BottomCharts
| },
| data() {
| return {
| staticsData: {},
| rentRank: [],
| rentIncomeTrend: [],
| tenantCountTrend: [],
| loading: false
| }
| },
| created() {
| if (this.$route.query.token || localStorage.getItem('token')) {
| localStorage.setItem('token', 'Bearer ' + this.$route.query.token)
| this.fetchData()
| } else {
| Message({
| message: '登录已过期,请重新登录',
| type: 'warning',
| duration: 2000
| })
| setTimeout(() => {
| localStorage.clear();
| window.location.replace(`https://xzgt.test.591taxi.cn/web/?#/login`);
| }, 2000)
| }
| },
| methods: {
| fetchData() {
| Promise.all([getStaticsData(), getRentRank(), getRentIncomeTrend(), getTenantCountTrend()]).then(res => {
| this.staticsData = res[0].data
| this.rentRank = res[1].data
| this.rentIncomeTrend = res[2].data
| this.tenantCountTrend = res[3].data
| this.loading = true
| })
| }
| }
| }
| </script>
|
| <style>
| .data-screen {
| width: 100%;
| height: 100%;
| display: flex;
| flex-direction: column;
| position: relative;
| color: #fff;
| font-family: 'DIN', sans-serif;
| }
|
| /* 添加全局字体声明 */
| /* @font-face {
| font-family: 'DIN';
| src: url('https://fonts.cdnfonts.com/css/din-next-lt-arabic') format('woff2');
| font-weight: normal;
| font-style: normal;
| font-display: swap;
| } */
|
| .main-content {
| flex: 1;
| display: flex;
| gap: 10px;
| height: calc(100% - 300px);
| position: relative;
| margin-top: 100px;
| min-height: 0;
| }
|
| .footer {
| height: 300px;
| position: absolute;
| bottom: 0;
| left: 0;
| width: 100%;
| z-index: 1000;
| background: linear-gradient(to top, rgba(1, 85, 121, 0.8) 0%, rgba(1, 85, 121, 0.4) 20%, rgba(151, 190, 192, 0) 100%);
| pointer-events: none;
| }
| </style>
|
|