修改首页水库img

qzc-dev-demo
秦子超 2025-04-08 16:08:04 +08:00
parent 0b96d442dd
commit 631899e393
3 changed files with 47 additions and 64 deletions

View File

@ -131,7 +131,7 @@ function Skssjc({data}) {
)
}
{
{/* {
imgList.length > 0 ? (
<div className="tx-item">
<Image
@ -150,7 +150,7 @@ function Skssjc({data}) {
) : (
<div className="noPic">暂无数据</div>
)
}
} */}
</div>
</div>

View File

@ -61,10 +61,10 @@ const Page = ({mySetTms}) => {
<div className="content">超汛限告警</div>
<div></div>
</div>
<div className="bodyBoxItem" onClick={()=>{setOpen(true);setkey('气象预警')}}>
{/* <div className="bodyBoxItem" onClick={()=>{setOpen(true);setkey('')}}>
<div className="num">{dataObj.qxWarn?.length||0}</div>
<div className="content">气象预警</div>
</div>
</div> */}
<div className="bodyBoxItem" onClick={()=>{setOpen(true);setkey('位移告警')}}>
<div className="num">{dataObj.shiftWarn?.length||0}</div>
<div className="content">位移告警</div>

View File

@ -13,11 +13,12 @@ const MyImg = ({ record }) => {
const computerHeight = (h1, h2, h3) => {
let height;
let comHeight;
if (h1 & h2 & h3) {
if (h1 && h2 && h3) {
comHeight = (h1 - h3) / (h2 - h3)
// height = comHeight * 100 < 80 ? `${comHeight}%` : "80%"
height = `${comHeight * 80}%`
return height
return comHeight > 0 ? height : 10
} else {
return ''
}
@ -25,7 +26,7 @@ const MyImg = ({ record }) => {
return (
<div style={{
flexGrow: 1,
height: '300px',
height: '36vh',
overflow: 'hidden',
position: 'relative',
backgroundColor: "#eff3f6",
@ -112,40 +113,27 @@ const MyImg = ({ record }) => {
<div style={
{
position: 'absolute',
// left: 150,
// left:78,
width: '82%',
left:'40px',
// width: '82%',
bottom: computerHeight(record.rz, record.crestElev, record.deadLev),
display: 'flex',
alignItems: 'center',
gap: 8,
justifyContent: 'end',
}}>
<div style={{width:'105px',overflow:'hidden'}}>
<div style={{display:'inline-block',width:"100px",overflow:'hidden'}}>
<img src={`${process.env.PUBLIC_URL}/assets/images/blue2.png`}
style={{
flex: 0.5,
// width: 30,
height:15
// width: 60,
height: 15,
}}
/>
</div>
<div style={{
// flexGrow: 0.5,
// border: '2px solid #fff',
// color: "#fff",
// backgroundColor:
// '#0008',
// padding: '2px 16px',
color:'#06caff',
fontSize: 16,
}}>
<div style={{
// justifyContent: 'space-between',
display: 'flex',
columnGap:10
}}> <span>实时水位</span> <strong>{record.rz?record.rz.toFixed(2):"-"}m</strong></div>
{/* <div style={{ justifyContent: 'space-between', display: 'flex'}}> <span>库容</span> <strong>{record.totCap}m³</strong></div> */}
<div style={{color: '#06caff',fontSize: 16}}>
<div style={{ display: 'flex', columnGap: 10 }}>
<span style={{width:"4rem"}}>实时水位</span> <strong>{record.rz ? record.rz.toFixed(2) : "-"}m</strong>
</div>
</div>
</div>
@ -161,12 +149,7 @@ const MyImg = ({ record }) => {
}}
/>
<div style={{
// width: "210px",
// border: '2px solid #fff',
// color: "#fff",
// backgroundColor: '#0bcbeb',
// padding: '2px 16px',
color:'#bfbfbf',
color: '#fff',
fontSize: 16,
justifyContent: 'space-between',
display: 'flex',