Commit 37e1dc003366c5cd45eb371fcd787727e402218c

Authored by xp.Huang
2 parents 27604ed8 ba9a388e

Merge branch 'sqy_dev' into 'main'

'fix:調整首頁租戶消息量進度條'

See merge request huang/yun-teng-iot-front!98
@@ -56,8 +56,79 @@ @@ -56,8 +56,79 @@
56 </div> 56 </div>
57 57
58 <Card v-else :bordered="false" :bodyStyle="{ padding: 0 }" v-bind="$attrs"> 58 <Card v-else :bordered="false" :bodyStyle="{ padding: 0 }" v-bind="$attrs">
  59 + <h1 style="color: rgba(0, 0, 0, 0.85); font-weight: bold; font-size: 16px">
  60 + 租户消息量TOP10</h1
  61 + >
59 <Empty v-if="!tenantTop10.length" /> 62 <Empty v-if="!tenantTop10.length" />
60 - <div style="width: 100%; height: 390px" ref="top10Ref"></div> 63 + <Descriptions :column="1">
  64 + <template v-for="(item, index) in tenantTop10" :key="item.name">
  65 + <DescriptionsItem>
  66 + <span
  67 + class="mr-2"
  68 + style="
  69 + width: 1.25rem;
  70 + height: 1.25rem;
  71 + border: 1px solid;
  72 + color: #0b55f1;
  73 + border-radius: 50%;
  74 + display: flex;
  75 + align-items: center;
  76 + justify-content: center;
  77 + "
  78 + :style="{
  79 + color:
  80 + index === 0
  81 + ? '#f0a16e'
  82 + : index === 1
  83 + ? '#868585'
  84 + : index === 2
  85 + ? '#e78739'
  86 + : '#4e84f5',
  87 + backgroundColor:
  88 + index === 0 ? '#FAD672' : index === 1 ? '#CBCAC9' : index === 2 ? '#F1B889' : '',
  89 + borderColor:
  90 + index === 0
  91 + ? '#fdee7d'
  92 + : index === 1
  93 + ? '#e6e6e5'
  94 + : index === 2
  95 + ? '#f8c296'
  96 + : '#0b55f1;',
  97 + }"
  98 + >{{ index + 1 }}</span
  99 + >
  100 + <div class="flex justify-between" style="width: 100%">
  101 + <span>
  102 + {{ item.name }}
  103 + </span>
  104 + <div class="flex w-7/10">
  105 + <Progress
  106 + :showInfo="false"
  107 + size="small"
  108 + style="width: 70%"
  109 + :percent="item.count / 10000"
  110 + :strokeWidth="12"
  111 + :strokeColor="
  112 + index === 0
  113 + ? '#ea5b42'
  114 + : index === 1
  115 + ? '#666'
  116 + : index === 2
  117 + ? '#e4751a'
  118 + : '#b5b6b6'
  119 + "
  120 + />
  121 + <span
  122 + class="ml-2"
  123 + :style="{ color: index === 0 ? '#EA5B42' : index === 2 ? '#E4751A' : '#666' }"
  124 + >
  125 + {{ item.count }}
  126 + </span>
  127 + </div>
  128 + </div>
  129 + </DescriptionsItem>
  130 + </template>
  131 + </Descriptions>
61 <h1 style="color: rgba(0, 0, 0, 0.85); font-weight: bold; font-size: 16px"> 132 <h1 style="color: rgba(0, 0, 0, 0.85); font-weight: bold; font-size: 16px">
62 本月即将过期租户</h1 133 本月即将过期租户</h1
63 > 134 >
@@ -68,7 +139,7 @@ @@ -68,7 +139,7 @@
68 139
69 <script lang="ts"> 140 <script lang="ts">
70 import { defineComponent, ref, computed, onMounted } from 'vue'; 141 import { defineComponent, ref, computed, onMounted } from 'vue';
71 - import { Card, Anchor, List, Avatar, Empty } from 'ant-design-vue'; 142 + import { Card, Anchor, List, Avatar, Empty, Descriptions, Progress } from 'ant-design-vue';
72 import { useUserStore } from '/@/store/modules/user'; 143 import { useUserStore } from '/@/store/modules/user';
73 import { getEnterPriseDetail } from '/@/api/oem'; 144 import { getEnterPriseDetail } from '/@/api/oem';
74 import { notifyMyGetrPageApi } from '/@/api/stationnotification/stationnotifyApi'; 145 import { notifyMyGetrPageApi } from '/@/api/stationnotification/stationnotifyApi';
@@ -77,7 +148,6 @@ @@ -77,7 +148,6 @@
77 import { BasicTable, useTable } from '/@/components/Table'; 148 import { BasicTable, useTable } from '/@/components/Table';
78 import { isAdmin } from '/@/enums/roleEnum'; 149 import { isAdmin } from '/@/enums/roleEnum';
79 import { getTenantExpireTimeList, getTenantTop10 } from '/@/api/dashboard'; 150 import { getTenantExpireTimeList, getTenantTop10 } from '/@/api/dashboard';
80 - import { useECharts } from '/@/hooks/web/useECharts';  
81 export default defineComponent({ 151 export default defineComponent({
82 components: { 152 components: {
83 Card, 153 Card,
@@ -87,9 +157,12 @@ @@ -87,9 +157,12 @@
87 List, 157 List,
88 ListItem: List.Item, 158 ListItem: List.Item,
89 ListItemMeta: List.Item.Meta, 159 ListItemMeta: List.Item.Meta,
  160 + Descriptions,
  161 + DescriptionsItem: Descriptions.Item,
90 Avatar, 162 Avatar,
91 Time, 163 Time,
92 BasicTable, 164 BasicTable,
  165 + Progress,
93 }, 166 },
94 props: { 167 props: {
95 role: { 168 role: {
@@ -168,38 +241,9 @@ @@ -168,38 +241,9 @@
168 return userStore.enterPriseInfo?.qrCode; 241 return userStore.enterPriseInfo?.qrCode;
169 }); 242 });
170 const tenantTop10 = ref<{ name: string; count: number }[]>([]); 243 const tenantTop10 = ref<{ name: string; count: number }[]>([]);
171 - const top10Ref = ref<HTMLDivElement | null>(null);  
172 - const { setOptions } = useECharts(top10Ref as Ref<HTMLDivElement>);  
173 onMounted(async () => { 244 onMounted(async () => {
174 if (isAdmin(props.role)) { 245 if (isAdmin(props.role)) {
175 tenantTop10.value = await getTenantTop10(); 246 tenantTop10.value = await getTenantTop10();
176 - const tenantName = tenantTop10.value.map((item) => item.name);  
177 - const tenantCount = tenantTop10.value.map((item) => item.count);  
178 - setOptions({  
179 - xAxis: {},  
180 - title: {  
181 - text: '租户消息量TOP10',  
182 - },  
183 - yAxis: {  
184 - type: 'category',  
185 - data: tenantName,  
186 - inverse: true,  
187 - },  
188 - grid: {  
189 - containLabel: true,  
190 - left: '0%',  
191 - },  
192 - series: [  
193 - {  
194 - type: 'bar',  
195 - data: tenantCount,  
196 - label: {  
197 - show: true,  
198 - position: 'right',  
199 - },  
200 - },  
201 - ],  
202 - });  
203 return; 247 return;
204 } 248 }
205 const notice = await notifyMyGetrPageApi({ page: 1, pageSize: 5 }); 249 const notice = await notifyMyGetrPageApi({ page: 1, pageSize: 5 });
@@ -221,7 +265,6 @@ @@ -221,7 +265,6 @@
221 go, 265 go,
222 registerTable, 266 registerTable,
223 isAdmin, 267 isAdmin,
224 - top10Ref,  
225 }; 268 };
226 }, 269 },
227 }); 270 });