From 1204c782451788e6ba68b346209b0ba4fdac4fe5 Mon Sep 17 00:00:00 2001 From: lijingqi <1437862981@qq.com> Date: Mon, 24 Feb 2025 10:56:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=8E=B0=E9=97=AE=E9=A2=98=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DistributionChart/index.tsx | 6 ++++-- .../modals/ConstructionWaste/index.tsx | 3 ++- .../components/WasteDisposal/index.tsx | 13 +++++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx index 6fc8b7b9..80cd8aaf 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx @@ -10,13 +10,15 @@ interface DistributionChartProps { startTime: string; endTime: string; }; + tabKey?: string; } const DistributionChart: React.FC = ({ searchTime, + tabKey }) => { const chartRef = useRef(null); - const [activeTab, setActiveTab] = useState('1'); + const [activeTab, setActiveTab] = useState(tabKey||'1'); const tabItems = [ { key: '1', @@ -187,7 +189,7 @@ const DistributionChart: React.FC = ({ tooltip: { show: false, }, - data: data.map((item) => ({ + data: data?.map((item) => ({ ...item, itemStyle: { color: '#33658D', diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx index bda0b110..3cb561ed 100644 --- a/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx +++ b/src/pages/GlobalModalServices/modals/ConstructionWaste/index.tsx @@ -17,6 +17,7 @@ const ConstructionWaste = (props: any) => { endTime: dayjs().endOf('month').format('YYYY-MM-DD'), }); + useEffect(() => { props.modalDispatch.setOptions({ headerLeft: ( @@ -55,7 +56,7 @@ const ConstructionWaste = (props: any) => {
- +
diff --git a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx index 3f757306..008992f4 100644 --- a/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx +++ b/src/pages/NewHome/NewRightContent/IndustryOperationV4/components/WasteDisposal/index.tsx @@ -85,11 +85,14 @@ const WasteDisposal: React.FC = () => { padding: '0px 0 0 0px', }; - const handleClick = () => { + const handleClick = (activeTab?: string) => { dispatch.push('ConstructionWaste', { style: { top: 30, }, + props:{ + activeTab + } }); }; @@ -157,7 +160,7 @@ const WasteDisposal: React.FC = () => { src={industryTitle2} alt="建筑垃圾" className={styles.titleImage} - onClick={handleClick} + onClick={()=>{handleClick('1')}} />
@@ -171,7 +174,7 @@ const WasteDisposal: React.FC = () => { unitStyle={commonUnitStyle} decimals={2} style={commonStyle} - onClick={handleClick} + onClick={()=>{handleClick('1')}} /> { unitStyle={commonUnitStyle} decimals={0} style={commonStyle} - onClick={handleClick} + onClick={()=>{ + handleClick('2') + }} />
-- GitLab