diff --git a/src/views/admin/agent/index.vue b/src/views/admin/agent/index.vue index 7d694db..fad7548 100644 --- a/src/views/admin/agent/index.vue +++ b/src/views/admin/agent/index.vue @@ -3,10 +3,33 @@ import StatisticsPanel from "@/views/components/StatisticsPanel.vue"; import { getBrokerStatistic } from "@/api/admin/agent/home"; import { ref } from "vue"; -const statisticsList = ref([]); +const statisticsList = ref([ + { + label: "企业数量", + value: 0, + unit: "家", + }, + { + label: "正在服务需求数", + value: 0, + unit: "个", + }, + { + label: "订单总数", + value: 0, + unit: "元", + }, + { + // demandCount + label: "需求总数", + value: 0, + unit: "个", + }, +]); const loadStatistics = async () => { const { data } = await getBrokerStatistic(); + statisticsList.value = [ { label: "企业数量", diff --git a/src/views/admin/laboratory/index.vue b/src/views/admin/laboratory/index.vue index 052879e..ce41d69 100644 --- a/src/views/admin/laboratory/index.vue +++ b/src/views/admin/laboratory/index.vue @@ -6,29 +6,51 @@ import { getLaboratoryStatistic } from "@/api/admin/laboratory/home"; const statisticsList = ref([ { label: "专利数量", - value: 47, + value: 0, unit: "项", }, { label: "成果数量", - value: 17, + value: 0, unit: "个", }, { label: "需求数量", - value: 11, + value: 0, unit: "个", }, { label: "论文数量", - value: 46, + value: 0, unit: "篇", }, ]); const loadLabStatisticsData = () => { getLaboratoryStatistic().then((resp) => { - console.log(resp); + const { data } = resp; + statisticsList.value = [ + { + label: "专利数量", + value: data?.patentCount ?? 0, + unit: "项", + }, + { + label: "成果数量", + value: data?.achievementCount ?? 0, + unit: "个", + }, + { + label: "需求数量", + value: data?.demandCount ?? 0, + unit: "个", + }, + { + label: "论文数量", + value: data?.paperCount ?? 0, + unit: "篇", + }, + ]; }); }; diff --git a/src/views/admin/research/index.vue b/src/views/admin/research/index.vue index 1a98c00..91f7177 100644 --- a/src/views/admin/research/index.vue +++ b/src/views/admin/research/index.vue @@ -6,29 +6,51 @@ import { getResearchStatistic } from "@/api/admin/research/home"; const statisticsList = ref([ { label: "专利数量", - value: 32, + value: 0, unit: "项", }, { label: "成果数量", - value: 13, + value: 0, unit: "个", }, { label: "专家数量", - value: 1, + value: 0, unit: "位", }, { label: "实验室数量", - value: 6, + value: 0, unit: "家", }, ]); const loadResearchStatisticsData = () => { getResearchStatistic().then((resp) => { - console.log(resp); + const { data } = resp; + statisticsList.value = [ + { + label: "专利数量", + value: data?.patentCount ?? 0, + unit: "项", + }, + { + label: "成果数量", + value: data?.achievementCount ?? 0, + unit: "个", + }, + { + label: "专家数量", + value: data?.expertCount ?? 0, + unit: "位", + }, + { + label: "实验室数量", + value: data?.laboratoryCount ?? 0, + unit: "家", + }, + ]; }); };