Commit ba9a388ef5dc6ea6d11ac60bcef0f067549c6305

Authored by sqy
1 parent fa6ab188

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

... ... @@ -56,8 +56,79 @@
56 56 </div>
57 57
58 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 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 132 <h1 style="color: rgba(0, 0, 0, 0.85); font-weight: bold; font-size: 16px">
62 133 本月即将过期租户</h1
63 134 >
... ... @@ -68,7 +139,7 @@
68 139
69 140 <script lang="ts">
70 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 143 import { useUserStore } from '/@/store/modules/user';
73 144 import { getEnterPriseDetail } from '/@/api/oem';
74 145 import { notifyMyGetrPageApi } from '/@/api/stationnotification/stationnotifyApi';
... ... @@ -77,7 +148,6 @@
77 148 import { BasicTable, useTable } from '/@/components/Table';
78 149 import { isAdmin } from '/@/enums/roleEnum';
79 150 import { getTenantExpireTimeList, getTenantTop10 } from '/@/api/dashboard';
80   - import { useECharts } from '/@/hooks/web/useECharts';
81 151 export default defineComponent({
82 152 components: {
83 153 Card,
... ... @@ -87,9 +157,12 @@
87 157 List,
88 158 ListItem: List.Item,
89 159 ListItemMeta: List.Item.Meta,
  160 + Descriptions,
  161 + DescriptionsItem: Descriptions.Item,
90 162 Avatar,
91 163 Time,
92 164 BasicTable,
  165 + Progress,
93 166 },
94 167 props: {
95 168 role: {
... ... @@ -168,38 +241,9 @@
168 241 return userStore.enterPriseInfo?.qrCode;
169 242 });
170 243 const tenantTop10 = ref<{ name: string; count: number }[]>([]);
171   - const top10Ref = ref<HTMLDivElement | null>(null);
172   - const { setOptions } = useECharts(top10Ref as Ref<HTMLDivElement>);
173 244 onMounted(async () => {
174 245 if (isAdmin(props.role)) {
175 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 247 return;
204 248 }
205 249 const notice = await notifyMyGetrPageApi({ page: 1, pageSize: 5 });
... ... @@ -221,7 +265,6 @@
221 265 go,
222 266 registerTable,
223 267 isAdmin,
224   - top10Ref,
225 268 };
226 269 },
227 270 });
... ...
... ... @@ -68,7 +68,6 @@ export const searchFormSchema: FormSchema[] = [
68 68 label: '姓名',
69 69 component: 'Input',
70 70 colProps: { span: 8 },
71   - required: true,
72 71 componentProps: {
73 72 maxLength: 255,
74 73 placeholder: '请输入姓名',
... ...