闸门监控

lsf-dev
秦子超 2024-10-14 15:09:02 +08:00
parent b31efc6d77
commit 23c10829ac
2 changed files with 40 additions and 11 deletions

View File

@ -51,8 +51,8 @@ const Page = () => {
<div className="rf2">{data1.q}</div>
</div>
<div style={{marginBottom:'10px', display:'flex'}}>
<div className="lf2" style={{color:'#70B603'}}>7月核定流量: </div>
<div className="rf2" style={{color:'#70B603'}}>{data1.value}</div>
<div className="lf2" style={{color:'#70B603'}}>{data1.resMonthEcoFlow.month||'-'}月核定流量: </div>
<div className="rf2" style={{color:'#70B603'}}>{data1.resMonthEcoFlow.value}</div>
</div>
</div>
<div className="home_gongshui_item_text">

View File

@ -14,7 +14,7 @@ import apiurl from '../../../service/apiurl';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const CanvasW = 1080
const CanvasH = 640
const waterRatio = 0
// const waterRatio = 0
const zmobj ={
"hpCode": "HP0074208040002120",
"stcd": "4265630075",
@ -177,6 +177,7 @@ const myType = {
const Page = () => {
const [itemIndex,setItemIndex] = useState(null)
const [waterRatio,setWaterRatio] = useState(0)
const [data,setData] = useState({})
const [list, setList ] = useState([])
const [damList, setDamList ] = useState([])
@ -211,6 +212,11 @@ const Page = () => {
if(code!==200){
return
}
data.map((item)=>{
if(item.type===2){
setWaterRatio(item.value/5||0)
}
})
setList(data)
}
@ -223,7 +229,6 @@ const Page = () => {
data.map((item)=>{
list.push({
...item
// ,realAperture:item.realAperture*1000
})
})
setDamList(list)
@ -246,6 +251,12 @@ const Page = () => {
}
}
const getNum = (a,b)=>{
const aa = Number(a||0)
const bb = Number(b||0)
const num = Number(aa-bb).toFixed(3)
return num
}
return (
<>
@ -330,13 +341,31 @@ const Page = () => {
<div style={{height:'144px',overflowY:'auto',padding:'20px'}}>
{
list?.map((item)=>{
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>112.079 / 1.279</div>
<div>07-10 12:09:00</div>
</div>
)
if(item.type===1){
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>{item.value||'-'} / {getNum(item.value,data.inEle)}</div>
<div>{item.tm?.slice(5,19)}</div>
</div>
)
}else if(item.type===2){
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>{item.value||'-'} / {getNum(item.value,data.inEle)}</div>
<div>{item.tm?.slice(5,19)}</div>
</div>
)
}else{
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>{item.value}</div>
<div>{item.tm?.slice(5,19)}</div>
</div>
)
}
})
}
</div>