From 6bbbb4b915db008caa570774b3acc7922fbc3abf Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期五, 28 十一月 2025 14:38:30 +0800
Subject: [PATCH] fix: bug
---
src/views/DataBoard/components/DataOverviewContent.vue | 53 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/src/views/DataBoard/components/DataOverviewContent.vue b/src/views/DataBoard/components/DataOverviewContent.vue
index 6604d75..a9fcec0 100644
--- a/src/views/DataBoard/components/DataOverviewContent.vue
+++ b/src/views/DataBoard/components/DataOverviewContent.vue
@@ -3,22 +3,22 @@
<DataBoardDataInfoItem
:backgroundImage="DataBoardDataInfoBg1"
label="鎬诲叆椹讳紒涓�"
- :value="detail?.totalCustomerCount"
+ v-model:value="totalCustomerCountValue"
></DataBoardDataInfoItem>
<DataBoardDataInfoItem
:backgroundImage="DataBoardDataInfoBg2"
label="鎬荤敵鎶ユ暟閲�"
- :value="detail?.totalBountyApplyCount"
+ v-model:value="totalBountyApplyCountValue"
></DataBoardDataInfoItem>
<DataBoardDataInfoItem
:backgroundImage="DataBoardDataInfoBg3"
label="濂栧姳閲戝彂鏀炬�婚"
- :value="detail?.sumBountyReleaseAmount"
+ v-model:value="sumBountyReleaseAmountValue"
></DataBoardDataInfoItem>
<DataBoardDataInfoItem
:backgroundImage="DataBoardDataInfoBg4"
label="濂栧姳閲戜娇鐢ㄦ�婚"
- :value="detail?.sumBountyUseAmount"
+ v-model:value="sumBountyUseAmountValue"
></DataBoardDataInfoItem>
</div>
</template>
@@ -29,13 +29,54 @@
import DataBoardDataInfoBg3 from '@/assets/dataBoard/data-board-data-info-bg3.png';
import DataBoardDataInfoBg4 from '@/assets/dataBoard/data-board-data-info-bg4.png';
import DataBoardDataInfoItem from './DataBoardDataInfoItem.vue';
-import { useGetDataBoardOverview } from '../hooks';
+import { useQuery } from '@tanstack/vue-query';
+import * as dataBoardServices from '@/services/api/DataBoard';
+import { useIntervalValue } from '../hooks';
defineOptions({
name: 'DataOverviewContent',
});
-const { detail } = useGetDataBoardOverview();
+const form = reactive({
+ totalCustomerCount: 0,
+ totalBountyApplyCount: 0,
+ sumBountyReleaseAmount: 0,
+ sumBountyUseAmount: 0,
+});
+
+const { data: detail, isLoading } = useQuery({
+ queryKey: ['dataBoardServices/getDataBoardOverview'],
+ queryFn: async () => {
+ return await dataBoardServices.getDataBoardOverview(
+ {},
+ {
+ showLoading: false,
+ }
+ );
+ },
+ placeholderData: () => ({} as API.GetDataBoardOverviewOutput),
+ onSuccess(data) {
+ form.totalCustomerCount = data.totalCustomerCount;
+ changeTotalCustomerCount(form.totalCustomerCount);
+ form.totalBountyApplyCount = data.totalBountyApplyCount;
+ changeTotalBountyApplyCount(form.totalBountyApplyCount);
+ form.sumBountyReleaseAmount = data.sumBountyReleaseAmount;
+ changeSumBountyReleaseAmount(form.sumBountyReleaseAmount);
+ form.sumBountyUseAmount = data.sumBountyUseAmount;
+ changeSumBountyUseAmount(form.sumBountyUseAmount);
+ },
+});
+
+const { value: totalCustomerCountValue, changeValue: changeTotalCustomerCount } = useIntervalValue(
+ form.totalCustomerCount
+);
+const { value: totalBountyApplyCountValue, changeValue: changeTotalBountyApplyCount } =
+ useIntervalValue(form.totalBountyApplyCount);
+const { value: sumBountyReleaseAmountValue, changeValue: changeSumBountyReleaseAmount } =
+ useIntervalValue(form.sumBountyReleaseAmount);
+const { value: sumBountyUseAmountValue, changeValue: changeSumBountyUseAmount } = useIntervalValue(
+ form.sumBountyUseAmount
+);
</script>
<style lang="scss" scoped>
--
Gitblit v1.9.1