|
@@ -105,18 +105,18 @@ export const ChemCost = ({ open, showTheory = false }) => {
|
|
|
defaultParams: [{ project_id: projectId }],
|
|
|
formatResult: (result) => {
|
|
|
const otcCost = Number(getValue(result.data.otc_cost_unit));
|
|
|
- let resultText = `当前药耗持平理论值 ${
|
|
|
+ let resultText = `当前药耗持平理论值 (${
|
|
|
result?.data?.otc_unit_theory || 0
|
|
|
- }KWh/m³`;
|
|
|
+ }kg/m³)`;
|
|
|
if (otcCost) {
|
|
|
if (otcCost > result.data.otc_unit_theory) {
|
|
|
- resultText = `当前药耗高于理论值 ${result.data.otc_unit_theory}KWh/m³`;
|
|
|
+ resultText = `当前药耗高于理论值 (${result.data.otc_unit_theory}kg/m³)`;
|
|
|
}
|
|
|
if (otcCost === result.data.otc_unit_theory) {
|
|
|
- resultText = `当前药耗持平理论值 ${result.data.otc_unit_theory}KWh/m³`;
|
|
|
+ resultText = `当前药耗持平理论值 (${result.data.otc_unit_theory}kg/m³)`;
|
|
|
}
|
|
|
if (otcCost < result.data.otc_unit_theory) {
|
|
|
- resultText = `当前药耗低于理论值 ${result.data.otc_unit_theory}KWh/m³`;
|
|
|
+ resultText = `当前药耗低于理论值 (${result.data.otc_unit_theory}kg/m³)`;
|
|
|
}
|
|
|
}
|
|
|
console.log({ ...result.data, resultText });
|
|
@@ -308,72 +308,78 @@ export const ChemCost = ({ open, showTheory = false }) => {
|
|
|
}, []);
|
|
|
|
|
|
return (
|
|
|
- <div className="card-box" style={{ position: 'relative' }}>
|
|
|
+ <div style={{ position: 'relative' }}>
|
|
|
<div
|
|
|
style={{
|
|
|
fontSize: '0.28rem',
|
|
|
position: 'absolute',
|
|
|
- top: '-0.6rem',
|
|
|
- right: '0.3rem',
|
|
|
+ top: '-0.3rem',
|
|
|
+ right: '0.2rem',
|
|
|
display: `${showTheory ? '' : 'none'}`,
|
|
|
}}
|
|
|
>
|
|
|
{snapshot?.resultText}
|
|
|
</div>
|
|
|
- <div className={styles.curEnergyCost}>
|
|
|
- <div className={styles.item}>
|
|
|
- <div className={styles.value}>
|
|
|
- {open ? getValue(snapshot?.otc_unit || '') : '***'}
|
|
|
- <span className={styles.unit}>kg/t</span>
|
|
|
- </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>
|
|
|
- </div>
|
|
|
- <div className={styles.name}>近一小时药量</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style={{ padding: '0.2rem' }}>
|
|
|
- {/* 使用Tabs来展示所有药的标签 */}
|
|
|
- <div className="tabs">
|
|
|
- {chemList?.map((item) => (
|
|
|
- <div
|
|
|
- key={item}
|
|
|
- onClick={() => {
|
|
|
- setCurrentChem(item);
|
|
|
- handleChemChange(item);
|
|
|
- }}
|
|
|
- className={`tabs-item ${currentChem == item ? 'active' : ''}`}
|
|
|
- >
|
|
|
- {item}
|
|
|
+ <div style={{ padding: '0.2rem 0rem' }}>
|
|
|
+ <div className="card-box">
|
|
|
+ <div className={styles.curEnergyCost}>
|
|
|
+ <div className={styles.item}>
|
|
|
+ <div className={styles.value}>
|
|
|
+ {open ? getValue(snapshot?.otc_unit || '') : '***'}
|
|
|
+ <span className={styles.unit}>kg/t</span>
|
|
|
+ </div>
|
|
|
+ <div className={styles.name}>近一小时吨水药耗</div>
|
|
|
</div>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
- <div className={styles.curEnergyCost}>
|
|
|
- <div className={styles.item}>
|
|
|
- <div style={{ fontSize: '0.18rem', color: 'gray' }}>
|
|
|
- 药剂参考价格:{referencePriceTable[`${currentChem}`]}
|
|
|
+ <div className={styles.item}>
|
|
|
+ <div className={styles.value}>
|
|
|
+ {open ? getValue(snapshot?.otc || '') : '***'}
|
|
|
+ <span className={styles.unit}>kg</span>
|
|
|
+ </div>
|
|
|
+ <div className={styles.name}>近一小时药量</div>
|
|
|
</div>
|
|
|
- <div className={styles.value}>
|
|
|
- {open ? topValues.chemPer : '***'}
|
|
|
- <span className={styles.unit}>kg/m³</span>
|
|
|
+ </div>
|
|
|
+ {/* 使用Tabs来展示所有药的标签 */}
|
|
|
+ <div style={{ padding: '0 0.1rem' }}>
|
|
|
+ <div className="tabs">
|
|
|
+ {chemList?.map((item) => (
|
|
|
+ <div
|
|
|
+ key={item}
|
|
|
+ onClick={() => {
|
|
|
+ setCurrentChem(item);
|
|
|
+ handleChemChange(item);
|
|
|
+ }}
|
|
|
+ className={`tabs-item ${currentChem == item ? 'active' : ''}`}
|
|
|
+ >
|
|
|
+ {item}
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
</div>
|
|
|
- <div className={styles.name}>当月吨水药耗</div>
|
|
|
</div>
|
|
|
- <div className={styles.item}>
|
|
|
- <div className={styles.value}>
|
|
|
- {open ? topValues.chemUser : '***'}
|
|
|
- <span className={styles.unit}>kg</span>
|
|
|
+ <div className={styles.curEnergyCost}>
|
|
|
+ <div className={styles.item}>
|
|
|
+ <div style={{ fontSize: '0.18rem', color: 'gray' }}>
|
|
|
+ 药剂参考价格:{referencePriceTable[`${currentChem}`]}
|
|
|
+ </div>
|
|
|
+ <div className={styles.value}>
|
|
|
+ {open ? topValues.chemPer : '***'}
|
|
|
+ <span className={styles.unit}>kg/m³</span>
|
|
|
+ </div>
|
|
|
+ <div className={styles.name}>当月吨水药耗</div>
|
|
|
+ </div>
|
|
|
+ <div className={styles.item}>
|
|
|
+ <div className={styles.value}>
|
|
|
+ {open ? topValues.chemUser : '***'}
|
|
|
+ <span className={styles.unit}>kg</span>
|
|
|
+ </div>
|
|
|
+ <div className={styles.name}>当月药量</div>
|
|
|
</div>
|
|
|
- <div className={styles.name}>当月药量</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
{chartData.length !== 0 && (
|
|
|
<div
|
|
|
+ className="card-box"
|
|
|
style={{
|
|
|
+ marginTop: '0.2rem',
|
|
|
height: '8.8rem',
|
|
|
display: 'flex',
|
|
|
flexDirection: 'column',
|