xujunjie 1 жил өмнө
parent
commit
dde5ab69ea

+ 3 - 3
src/pages/Home/ChemCostComparison.js

@@ -118,7 +118,7 @@ export const ChemCost = ({ open, showTip = false }) => {
   const { data: snapshot } = useRequest(queryConditionSnapshot, {
     defaultParams: [{ project_id: projectId }],
     formatResult: (result) => {
-      const otcCost = Number(getValue(result.data.otc_cost_unit));
+      const otcCost = Number(getValue(result.data.otc_day_cost_unit));
       let resultText = `当前药耗持平理论值 (${
         result?.data?.otc_unit_theory || 0
       }kg/m³)`;
@@ -257,7 +257,7 @@ export const ChemCost = ({ open, showTip = false }) => {
       // 确定保留的小数点
       const chemUsedMaxValue = [...planChem, ...actualChem]
         .map((item) => item.value)
-        .reduce((a, b) => Math.max(a, b));
+        .reduce((a, b) => Math.max(a, b), 0);
       const chemUsedFixed = getFixed(chemUsedMaxValue);
       chemUsed.dataList = [
         {
@@ -329,7 +329,7 @@ export const ChemCost = ({ open, showTip = false }) => {
           <div className={styles.curEnergyCost}>
             <div className={styles.item}>
               <div className={styles.value}>
-                {open ? getValue(snapshot?.otc_unit || '') : '***'}
+                {open ? getValue(snapshot?.otc_day_unit || '') : '***'}
                 <span className={styles.unit}>元/m³</span>
               </div>
               <div className={styles.name}>近一天吨水药成本</div>

+ 3 - 3
src/pages/Home/EnergyCostComparison.js

@@ -85,7 +85,7 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
   const { data: snapshot } = useRequest(queryConditionSnapshot, {
     defaultParams: [{ project_id: projectId }],
     formatResult: (result) => {
-      const elec = Number(getValue(result.data.elec_unit));
+      const elec = Number(getValue(result.data.elec_day_unit));
       let resultText = `当前电耗持平理论值 ${
         result?.data?.elec_unit_theory || 0
       }KWh/m³`;
@@ -309,7 +309,7 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
             }}
           >
             <div className={styles.value}>
-              {open ? getValue(snapshot?.elec_unit || '') : '***'}
+              {open ? getValue(snapshot?.elec_day_unit || '') : '***'}
               <span className={styles.unit}>kWh/t</span>
             </div>
             <div className={styles.name}>近一天吨水电耗</div>
@@ -321,7 +321,7 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
             }}
           >
             <div className={styles.value}>
-              {open ? getValue(snapshot?.elec || '') : '***'}
+              {open ? getValue(snapshot?.elec_day || '') : '***'}
               <span className={styles.unit}>kWh</span>
             </div>
             <div className={styles.name}>近一天用电量</div>

+ 4 - 4
src/pages/Home/index.js

@@ -245,8 +245,8 @@ const Electric = (props) => {
   const [open, setOpen] = useState(false);
 
   const elec = useMemo(() => {
-    return getValue(data?.elec_unit);
-  }, [data?.elec_unit]);
+    return getValue(data?.elec_day_unit);
+  }, [data?.elec_day_unit]);
 
   const status = useMemo(() => {
     if (!data) return '';
@@ -312,8 +312,8 @@ const Medicine = (props) => {
   const [open, setOpen] = useState(false);
 
   const otc_cost = useMemo(() => {
-    return getValue(data?.otc_cost_unit);
-  }, [data?.otc_cost_unit]);
+    return getValue(data?.otc_day_cost_unit);
+  }, [data?.otc_day_cost_unit]);
 
   const status = useMemo(() => {
     if (!data) return '';