From 5e7ae2328760eef03978d9c7cc17c0ce7209beff Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期五, 28 十一月 2025 15:00:38 +0800
Subject: [PATCH] fix: bug
---
src/views/DataBoard/components/DataBoardCenterDataContent.vue | 50 +++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/src/views/DataBoard/components/DataBoardCenterDataContent.vue b/src/views/DataBoard/components/DataBoardCenterDataContent.vue
index 6357cdf..d7ff949 100644
--- a/src/views/DataBoard/components/DataBoardCenterDataContent.vue
+++ b/src/views/DataBoard/components/DataBoardCenterDataContent.vue
@@ -1,17 +1,17 @@
<template>
<div class="data-board-home-content-center-top">
<DataBoardCenterDataItem
- :value="detail?.currentMonthSumBountyReleaseAmount"
+ v-model:value="currentMonthSumBountyReleaseAmountValue"
label="褰撴湀鍙戞斁棰�"
:image="DataBoardCenterIcon1"
></DataBoardCenterDataItem>
<DataBoardCenterDataItem
- :value="detail?.currentMonthSumBountyUseAmount"
+ v-model:value="currentMonthSumBountyUseAmountValue"
label="褰撴湀浣跨敤棰�"
:image="DataBoardCenterIcon2"
></DataBoardCenterDataItem>
<DataBoardCenterDataItem
- :value="detail?.currentMonthInsurePeopleCount"
+ v-model:value="currentMonthInsurePeopleCountValue"
label="褰撴湀鎶曚繚浜烘暟"
:precision="0"
:image="DataBoardCenterIcon3"
@@ -24,13 +24,53 @@
import DataBoardCenterIcon2 from '@/assets/dataBoard/data-board-center-icon2.png';
import DataBoardCenterIcon3 from '@/assets/dataBoard/data-board-center-icon3.png';
import DataBoardCenterDataItem from './DataBoardCenterDataItem.vue';
-import { useGetDataBoardOverview } from '../hooks';
+import * as dataBoardServices from '@/services/api/DataBoard';
+import { useQuery } from '@tanstack/vue-query';
+import { useIntervalValue } from '../hooks';
defineOptions({
name: 'DataBoardCenterDataContent',
});
-const { detail } = useGetDataBoardOverview();
+const form = reactive({
+ currentMonthSumBountyReleaseAmount: 0,
+ currentMonthSumBountyUseAmount: 0,
+ currentMonthInsurePeopleCount: 0,
+});
+
+const { data: detail, isLoading } = useQuery({
+ queryKey: ['dataBoardServices/getDataBoardOverview'],
+ queryFn: async () => {
+ return await dataBoardServices.getDataBoardOverview(
+ {},
+ {
+ showLoading: false,
+ }
+ );
+ },
+ placeholderData: () => ({} as API.GetDataBoardOverviewOutput),
+ onSuccess(data) {
+ form.currentMonthSumBountyReleaseAmount = data.currentMonthSumBountyReleaseAmount;
+ changeCurrentMonthSumBountyReleaseAmount(data.currentMonthSumBountyReleaseAmount);
+ form.currentMonthSumBountyUseAmount = data.currentMonthSumBountyUseAmount;
+ changeCurrentMonthSumBountyUseAmount(data.currentMonthSumBountyUseAmount);
+ form.currentMonthInsurePeopleCount = data.currentMonthInsurePeopleCount;
+ changeCurrentMonthInsurePeopleCount(data.currentMonthInsurePeopleCount);
+ },
+});
+
+const {
+ value: currentMonthSumBountyReleaseAmountValue,
+ changeValue: changeCurrentMonthSumBountyReleaseAmount,
+} = useIntervalValue(form.currentMonthSumBountyReleaseAmount);
+const {
+ value: currentMonthSumBountyUseAmountValue,
+ changeValue: changeCurrentMonthSumBountyUseAmount,
+} = useIntervalValue(form.currentMonthSumBountyUseAmount);
+const {
+ value: currentMonthInsurePeopleCountValue,
+ changeValue: changeCurrentMonthInsurePeopleCount,
+} = useIntervalValue(form.currentMonthInsurePeopleCount);
</script>
<style lang="scss" scoped>
--
Gitblit v1.9.1