From 877a020dc083cad71e70504f295276db84a77215 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 5 Jun 2024 17:16:55 +0800 Subject: [PATCH] perf: report loading --- src/stores/Report.js | 4 ++-- src/views/report/Index.jsx | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/stores/Report.js b/src/stores/Report.js index 0767790..c3b05d7 100644 --- a/src/stores/Report.js +++ b/src/stores/Report.js @@ -32,7 +32,7 @@ export const useReportStore = create( }; const { errcode, ...Result } = await fetchJSON(`${HT_HOST}/service-cusservice/PTGetHWVendorScores`, searchParams); setVendorScoresData(errcode === 0 ? Result : {}); - setLoading(false); + // setLoading(false); }, async getHWProductScores(VEI_SN, StartDate, EndDate) { const { setLoading, setProductScoresData } = get(); @@ -62,7 +62,7 @@ export const useReportStore = create( }; const { errcode, ...Result } = await fetchJSON(`${HT_HOST}/service-cusservice/PTGetHWCommendScores`, searchParams); setCommendScoresData(errcode === 0 ? Result : {}); - setLoading(false); + // setLoading(false); }, })) ); diff --git a/src/views/report/Index.jsx b/src/views/report/Index.jsx index 88769ce..33076ab 100644 --- a/src/views/report/Index.jsx +++ b/src/views/report/Index.jsx @@ -1,4 +1,4 @@ -import { Row, Col, Space, Button, Table, Divider, Typography } from 'antd'; +import { Row, Col, Space, Button, Table, Divider, Typography, } from 'antd'; import * as comm from '@/utils/commons'; import { usePDF } from 'react-to-pdf'; import dayjs from 'dayjs'; @@ -9,7 +9,7 @@ import useReportStore from '@/stores/Report'; function Index() { const [travelAgencyId, ] = useAuthStore((state) => [state.loginUser.travelAgencyId]); - const [vendorScoresData, getHWVendorScores] = useReportStore((state) => [state.vendorScoresData, state.getHWVendorScores]); + const [loading, vendorScoresData, getHWVendorScores] = useReportStore((state) => [state.loading, state.vendorScoresData, state.getHWVendorScores]); const [productScoresData, getHWProductScores] = useReportStore((state) => [state.productScoresData, state.getHWProductScores]); const [commendScoresData, getHWCommendScores] = useReportStore((state) => [state.commendScoresData, state.getHWCommendScores]); @@ -300,7 +300,6 @@ function Index() { - @@ -308,7 +307,7 @@ function Index() { Primary Data - +
@@ -317,7 +316,7 @@ function Index() { Monthly Data -
+