Commit 3702b0a841fe4758d16c13d28a6b88f6c9b74824

Authored by fengtao
1 parent 12a50e3d

feat:首页新增饼状图和调整部分样式

@@ -90,22 +90,18 @@ @@ -90,22 +90,18 @@
90 const radisStatusData = ref<string[]>(['40%', '70%']); 90 const radisStatusData = ref<string[]>(['40%', '70%']);
91 const growCardList = ref<CardList>(); 91 const growCardList = ref<CardList>();
92 const legendData = ref(['gateway', 'directly', 'sub-device']); 92 const legendData = ref(['gateway', 'directly', 'sub-device']);
93 - const seriesData: Ref<seriesDataT[]> = ref([]); 93 + const seriesData: Ref<seriesDataT[]> = ref([
  94 + { value: 1048, name: 'gateway', itemStyle: { color: '#3aa0ff' } },
  95 + { value: 735, name: 'directly', itemStyle: { color: '#36cbcb' } },
  96 + { value: 580, name: 'sub-device', itemStyle: { color: '#4ecb73' } },
  97 + ]);
94 const legendStatusData = ref(['inactive', 'online', 'offline']); 98 const legendStatusData = ref(['inactive', 'online', 'offline']);
95 - const seriesStatusData: Ref<seriesDataT[]> = ref([]); 99 + const seriesStatusData: Ref<seriesDataT[]> = ref([
  100 + { value: 1048, name: 'inactive', itemStyle: { color: '#3aa0ff' } },
  101 + { value: 735, name: 'online', itemStyle: { color: '#36cbcb' } },
  102 + { value: 580, name: 'offline', itemStyle: { color: '#4ecb73' } },
  103 + ]);
96 onMounted(async () => { 104 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;  
109 const res = await getHomeData(); 105 const res = await getHomeData();
110 growCardList.value = res; 106 growCardList.value = res;
111 }); 107 });
@@ -56,13 +56,13 @@ @@ -56,13 +56,13 @@
56 width: 500, 56 width: 500,
57 height: 200, 57 height: 200,
58 left: 'center', 58 left: 'center',
59 - data: legendDatas, 59 + data: legendDatas.value,
60 }, 60 },
61 series: [ 61 series: [
62 { 62 {
63 type: 'pie', 63 type: 'pie',
64 radius: radisDatas.value, 64 radius: radisDatas.value,
65 - data: dataSeries, 65 + data: dataSeries.value,
66 emphasis: { 66 emphasis: {
67 itemStyle: { 67 itemStyle: {
68 shadowBlur: 10, 68 shadowBlur: 10,