xielei 2024-10-15 10:56:37 +08:00
commit a697614a07
3 changed files with 44 additions and 15 deletions

View File

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

View File

@ -18,7 +18,7 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" }, { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" }, { title: '时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" },
{ {
title: '生态供水', title: '发电灌溉',
align: "center", align: "center",
children: [ children: [
{ {
@ -36,7 +36,7 @@ const Page = () => {
] ]
}, },
{ {
title: '生活供水', title: '水厂取水',
align: "center", align: "center",
children: [ children: [
{ {
@ -62,7 +62,7 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" }, { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '时间', key: 'tm', dataIndex: 'tm', width: 100, ellipsis: true, align:"center" }, { title: '时间', key: 'tm', dataIndex: 'tm', width: 100, ellipsis: true, align:"center" },
{ {
title: '生态供水', title: '发电灌溉',
align: "center", align: "center",
children: [ children: [
{ {
@ -104,7 +104,7 @@ const Page = () => {
] ]
}, },
{ {
title: '生活供水', title: '水厂取水',
align: "center", align: "center",
children: [ children: [
{ {

View File

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