...
|
...
|
@@ -5,7 +5,7 @@ |
5
|
5
|
class="md:w-1/3 w-full !md:mt-0 !mt-4 !md:mr-4"
|
6
|
6
|
style="color: #666; width: 50%"
|
7
|
7
|
>
|
8
|
|
- <div class="flex">
|
|
8
|
+ <div class="flex container">
|
9
|
9
|
<div class="mr-4 flex chart-top">
|
10
|
10
|
<PieChartDeviceSub :legendData="legendData" :seriesData="seriesData" />
|
11
|
11
|
</div>
|
...
|
...
|
@@ -21,7 +21,7 @@ |
21
|
21
|
class="md:w-1/3 w-full !md:mt-0 !mt-4 !md:ml-1"
|
22
|
22
|
style="color: #666; width: 50%"
|
23
|
23
|
>
|
24
|
|
- <div class="flex">
|
|
24
|
+ <div class="flex container">
|
25
|
25
|
<div class="mr-4 flex chart-top">
|
26
|
26
|
<PieChartDeviceSub :legendData="legendStatusData" :seriesData="seriesStatusData" />
|
27
|
27
|
</div>
|
...
|
...
|
@@ -76,15 +76,15 @@ |
76
|
76
|
const growCardList = ref<CardList>();
|
77
|
77
|
const legendData = ref<string[]>(['gateway', 'directly', 'sub-device']);
|
78
|
78
|
const seriesData = ref([
|
79
|
|
- { value: 1048, name: 'gateway' },
|
80
|
|
- { value: 735, name: 'directly' },
|
81
|
|
- { value: 580, name: 'sub-device' },
|
|
79
|
+ { value: 1048, name: 'gateway', itemStyle: { color: '#3aa0ff' } },
|
|
80
|
+ { value: 735, name: 'directly', itemStyle: { color: '#36cbcb' } },
|
|
81
|
+ { value: 580, name: 'sub-device', itemStyle: { color: '#4ecb73' } },
|
82
|
82
|
]);
|
83
|
83
|
const legendStatusData = ref<string[]>(['inactive', 'online', 'offline']);
|
84
|
84
|
const seriesStatusData = ref([
|
85
|
|
- { value: 1048, name: 'inactive' },
|
86
|
|
- { value: 735, name: 'online' },
|
87
|
|
- { value: 580, name: 'offline' },
|
|
85
|
+ { value: 1048, name: 'inactive', itemStyle: { color: '#3aa0ff' } },
|
|
86
|
+ { value: 735, name: 'online', itemStyle: { color: '#36cbcb' } },
|
|
87
|
+ { value: 580, name: 'offline', itemStyle: { color: '#4ecb73' } },
|
88
|
88
|
]);
|
89
|
89
|
onMounted(async () => {
|
90
|
90
|
const res = await getHomeData();
|
...
|
...
|
@@ -94,19 +94,27 @@ |
94
|
94
|
|
95
|
95
|
<style lang="css">
|
96
|
96
|
.right-text {
|
|
97
|
+ width: 40%;
|
97
|
98
|
flex-direction: column;
|
98
|
|
- height: 200px;
|
|
99
|
+ height: 240px;
|
99
|
100
|
margin: 10px 0 10px 50px;
|
100
|
|
- flex-wrap: nowrap;
|
101
|
101
|
}
|
102
|
102
|
|
103
|
103
|
.text {
|
104
|
104
|
color: #333;
|
105
|
105
|
font-weight: bold;
|
|
106
|
+ display: flex;
|
|
107
|
+ flex-wrap: nowrap;
|
106
|
108
|
}
|
107
|
109
|
|
108
|
110
|
.chart-top {
|
|
111
|
+ width: 60%;
|
|
112
|
+ height: 300px;
|
109
|
113
|
align-items: center;
|
110
|
114
|
margin-top: -30px;
|
111
|
115
|
}
|
|
116
|
+
|
|
117
|
+ .container {
|
|
118
|
+ width: 100%;
|
|
119
|
+ }
|
112
|
120
|
</style> |
...
|
...
|
|