| 
...
 | 
...
 | 
@@ -7,7 +7,11 @@ | 
| 
7
 | 
7
 | 
     >
 | 
| 
8
 | 
8
 | 
       <div class="flex container">
 | 
| 
9
 | 
9
 | 
         <div class="mr-4 flex chart-top">
 | 
| 
10
 | 
 
 | 
-          <PieChartDeviceSub :legendData="legendData" :seriesData="seriesData" />
 | 
| 
 
 | 
10
 | 
+          <PieChartDeviceSub
 | 
| 
 
 | 
11
 | 
+            :legendData="legendData"
 | 
| 
 
 | 
12
 | 
+            :seriesData="seriesData"
 | 
| 
 
 | 
13
 | 
+            :radisData="radisData"
 | 
| 
 
 | 
14
 | 
+          />
 | 
| 
11
 | 
15
 | 
         </div>
 | 
| 
12
 | 
16
 | 
         <div class="ml-20 flex justify-around right-text">
 | 
| 
13
 | 
17
 | 
           <div class="text"> 直连设备:4个 </div>
 | 
| 
...
 | 
...
 | 
@@ -23,7 +27,11 @@ | 
| 
23
 | 
27
 | 
     >
 | 
| 
24
 | 
28
 | 
       <div class="flex container">
 | 
| 
25
 | 
29
 | 
         <div class="mr-4 flex chart-top">
 | 
| 
26
 | 
 
 | 
-          <PieChartDeviceSub :legendData="legendStatusData" :seriesData="seriesStatusData" />
 | 
| 
 
 | 
30
 | 
+          <PieChartDeviceSub
 | 
| 
 
 | 
31
 | 
+            :legendData="legendStatusData"
 | 
| 
 
 | 
32
 | 
+            :seriesData="seriesStatusData"
 | 
| 
 
 | 
33
 | 
+            :radisData="radisStatusData"
 | 
| 
 
 | 
34
 | 
+          />
 | 
| 
27
 | 
35
 | 
         </div>
 | 
| 
28
 | 
36
 | 
         <div class="ml-20 flex justify-around right-text">
 | 
| 
29
 | 
37
 | 
           <div class="text"> 待激活设备:2个 </div>
 | 
| 
...
 | 
...
 | 
@@ -35,7 +43,7 @@ | 
| 
35
 | 
43
 | 
   </div>
 | 
| 
36
 | 
44
 | 
 </template>
 | 
| 
37
 | 
45
 | 
 <script lang="ts" setup>
 | 
| 
38
 | 
 
 | 
-  import { ref, onMounted, defineComponent } from 'vue';
 | 
| 
 
 | 
46
 | 
+  import { ref, onMounted, defineComponent, Ref } from 'vue';
 | 
| 
39
 | 
47
 | 
   import { Card } from 'ant-design-vue';
 | 
| 
40
 | 
48
 | 
   import { getHomeData } from '/@/api/dashboard';
 | 
| 
41
 | 
49
 | 
   import { isAdmin } from '/@/enums/roleEnum';
 | 
| 
...
 | 
...
 | 
@@ -73,20 +81,31 @@ | 
| 
73
 | 
81
 | 
       todayMessageAdd: number;
 | 
| 
74
 | 
82
 | 
     };
 | 
| 
75
 | 
83
 | 
   }
 | 
| 
 
 | 
84
 | 
+  type seriesDataT = {
 | 
| 
 
 | 
85
 | 
+    value: number;
 | 
| 
 
 | 
86
 | 
+    name: string;
 | 
| 
 
 | 
87
 | 
+    itemStyle: object;
 | 
| 
 
 | 
88
 | 
+  };
 | 
| 
 
 | 
89
 | 
+  const radisData: any = ref('70%');
 | 
| 
 
 | 
90
 | 
+  const radisStatusData = ref<string[]>(['40%', '70%']);
 | 
| 
76
 | 
91
 | 
   const growCardList = ref<CardList>();
 | 
| 
77
 | 
 
 | 
-  const legendData = ref<string[]>(['gateway', 'directly', 'sub-device']);
 | 
| 
78
 | 
 
 | 
-  const seriesData = ref([
 | 
| 
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
 | 
 
 | 
-  ]);
 | 
| 
83
 | 
 
 | 
-  const legendStatusData = ref<string[]>(['inactive', 'online', 'offline']);
 | 
| 
84
 | 
 
 | 
-  const seriesStatusData = ref([
 | 
| 
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
 | 
 
 | 
-  ]);
 | 
| 
 
 | 
92
 | 
+  const legendData = ref(['gateway', 'directly', 'sub-device']);
 | 
| 
 
 | 
93
 | 
+  const seriesData: Ref<seriesDataT[]> = ref([]);
 | 
| 
 
 | 
94
 | 
+  const legendStatusData = ref(['inactive', 'online', 'offline']);
 | 
| 
 
 | 
95
 | 
+  const seriesStatusData: Ref<seriesDataT[]> = ref([]);
 | 
| 
89
 | 
96
 | 
   onMounted(async () => {
 | 
| 
 
 | 
97
 | 
+    const mockData = [
 | 
| 
 
 | 
98
 | 
+      { value: 1048, name: 'gateway', itemStyle: { color: '#3aa0ff' } },
 | 
| 
 
 | 
99
 | 
+      { value: 735, name: 'directly', itemStyle: { color: '#36cbcb' } },
 | 
| 
 
 | 
100
 | 
+      { value: 580, name: 'sub-device', itemStyle: { color: '#4ecb73' } },
 | 
| 
 
 | 
101
 | 
+    ];
 | 
| 
 
 | 
102
 | 
+    const mockTestData = [
 | 
| 
 
 | 
103
 | 
+      { value: 1048, name: 'inactive', itemStyle: { color: '#3aa0ff' } },
 | 
| 
 
 | 
104
 | 
+      { value: 735, name: 'online', itemStyle: { color: '#36cbcb' } },
 | 
| 
 
 | 
105
 | 
+      { value: 580, name: 'offline', itemStyle: { color: '#4ecb73' } },
 | 
| 
 
 | 
106
 | 
+    ];
 | 
| 
 
 | 
107
 | 
+    seriesData.value = mockData;
 | 
| 
 
 | 
108
 | 
+    seriesStatusData.value = mockTestData;
 | 
| 
90
 | 
109
 | 
     const res = await getHomeData();
 | 
| 
91
 | 
110
 | 
     growCardList.value = res;
 | 
| 
92
 | 
111
 | 
   });
 | 
...
 | 
...
 | 
 |