diff --git a/src/components/DescriptionItem/index.tsx b/src/components/DescriptionItem/index.tsx index 157307cdb72dcdd352f91304d6f22b52ccf7de2e..de8fe1fd6e751efbc02c23331788fe303ab16587 100644 --- a/src/components/DescriptionItem/index.tsx +++ b/src/components/DescriptionItem/index.tsx @@ -3,6 +3,7 @@ import classNames from 'classnames'; import React, { CSSProperties, Fragment, memo } from 'react'; import CountUp from 'react-countup'; import styles from './index.less'; +import { formatDecimalsWithWan, formatDecimalsWithWanAndFixedDecimals, formatUnitWithWan, formatValueWithWan } from '@/pages/Home_v_2504/config/commonUtils'; interface DescriptionItemProps { value?: any; @@ -17,6 +18,7 @@ interface DescriptionItemProps { reverseName?: boolean; onClick?: () => void; showTextToValue?: boolean; + isTransferWan?: boolean; } /** @name 描述列表项 */ @@ -34,6 +36,7 @@ const DescriptionItem: React.FC = memo((props) => { reverseName = false, onClick, showTextToValue = false, + isTransferWan = true, } = props; const ValueAndUnit = ( @@ -47,10 +50,10 @@ const DescriptionItem: React.FC = memo((props) => { className={classNames(styles.value, { [styles.gradientValue]: !valueStyle?.color, })} - end={Number(value)} + end={isTransferWan ? formatValueWithWan(Number(value)) : Number(value)} style={valueStyle} preserveValue - decimals={decimals} + decimals={isTransferWan ? decimals ? formatDecimalsWithWanAndFixedDecimals(Number(value), decimals) : formatDecimalsWithWan(Number(value)) : decimals} /> ) : (
= memo((props) => { {unit && (
- {unit} + {isTransferWan ? formatUnitWithWan(Number(value)) + unit : unit}
)} diff --git a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/VehicleOverview/index.tsx b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/VehicleOverview/index.tsx index ed58543fd4245568bb96a3e2283cd658481a356b..bd4e89a2d16fca1194bb9de7387f2655371fdd98 100644 --- a/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/VehicleOverview/index.tsx +++ b/src/pages/Home_v_2504/components/SubPages/ConstructionWaste/components/LeftContent/VehicleOverview/index.tsx @@ -175,13 +175,17 @@ const VehicleOverview = ({ searchTime }: { searchTime: any }) => {