Files
quantulr f62877224d bugfix
2024-03-12 14:13:14 +08:00

51 lines
1.1 KiB
Vue

<script setup>
import StatisticsPanel from "@/views/components/StatisticsPanel.vue";
import { getBrokerStatistic } from "@/api/admin/agent/home";
import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const statisticsList = ref([
{
key: "enterpriseCount",
label: computed(() => t("admin.statistics.enterpriseCount")),
value: 0,
unit: "家",
},
{
key: "runDemandCount",
label: computed(() => t("admin.statistics.serviceDemandCount")),
value: 0,
unit: "个",
},
{
key: "orderTotal",
label: computed(() => t("admin.statistics.orderCount")),
value: 0,
unit: "万元",
},
{
key: "demandCount",
label: computed(() => t("admin.statistics.demandCount")),
value: 0,
unit: "个",
},
]);
const loadStatistics = async () => {
const { data } = await getBrokerStatistic();
statisticsList.value.forEach((item) => {
item.value = data[item.key] ?? 0;
});
};
loadStatistics();
</script>
<template>
<div class="app-container">
<statistics-panel :list="statisticsList" />
</div>
</template>
<style lang="scss" scoped></style>