diff --git a/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx b/src/pages/GlobalModalServices/modals/ConstructionWaste/components/DistributionChart/index.tsx index 6fc8b7b907a9a2fd041cf6eaebf3f50acad63eef..80cd8aaf88b2cb43bf9203453f7425be50f1b624 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 bda0b110b166f8fe0f323a78afc2ba11e556a0e5..3cb561edbf179f677dfe1d05db2a2f8243acfa39 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 3f757306f83c51f46a7dc2a3e73c549641eb8e35..008992f4ccf952ab6ab884bf8a86deaeae4ee812 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') + }} />