|
@@ -95,6 +95,20 @@ export const ChemCost = ({ open, showTip = false }) => {
|
|
|
end: defaultTime.e_time,
|
|
|
};
|
|
|
|
|
|
+ const { data } = useRequest(getComparisonData, {
|
|
|
+ defaultParams: [
|
|
|
+ {
|
|
|
+ project_id: projectId,
|
|
|
+ start: curMonth,
|
|
|
+ end: curMonth,
|
|
|
+ type: 1,
|
|
|
+ flag: 1,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ formatResult(res) {
|
|
|
+ return res[0];
|
|
|
+ },
|
|
|
+ });
|
|
|
const getValue = (str) => {
|
|
|
const result = str?.match(/.*?(\d+(?:\.\d+)?)\D*$/);
|
|
|
if (result && result[1]) return result[1];
|
|
@@ -316,16 +330,16 @@ export const ChemCost = ({ open, showTip = false }) => {
|
|
|
<div className={styles.item}>
|
|
|
<div className={styles.value}>
|
|
|
{open ? getValue(snapshot?.otc_unit || '') : '***'}
|
|
|
- <span className={styles.unit}>kg/t</span>
|
|
|
+ <span className={styles.unit}>元/m³</span>
|
|
|
</div>
|
|
|
- <div className={styles.name}>近一小时吨水药耗</div>
|
|
|
+ <div className={styles.name}>近一小时吨水药成本</div>
|
|
|
</div>
|
|
|
<div className={styles.item}>
|
|
|
<div className={styles.value}>
|
|
|
- {open ? getValue(snapshot?.otc || '') : '***'}
|
|
|
- <span className={styles.unit}>kg</span>
|
|
|
+ {open ? data?.value.toFixed(2) : '***'}
|
|
|
+ <span className={styles.unit}>元/m³</span>
|
|
|
</div>
|
|
|
- <div className={styles.name}>近一小时药量</div>
|
|
|
+ <div className={styles.name}>当月吨水药成本</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|