import React, { useState, useEffect,useMemo,useRef } from 'react' import { Table, Tabs,Modal,message,Tooltip } from 'antd'; import { useDispatch, useSelector } from 'react-redux' import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch"; import Draggable from 'react-draggable'; import { httpget, httpget2, httppost2 } from '../../../utils/request'; import apiurl from '../../../service/apiurl'; import ShenYa from '../../Home/MapCtrl/Pops/ShenYa/index'; import ShenLiu from '../../Home/MapCtrl/Pops/ShenLiu/index.js'; import WeiYi from '../../Home/MapCtrl/Pops/WeiYi/index.js'; import DuanMian from '../../Home/MapCtrl/Pops/DuanMian/index.js'; import TuLi from '../../Home/TuLi/Tuli6.js'; import './index.less' export default function Page({isHome}) { const dispatch = useDispatch(); const [shouqi,setShouQi] = useState(false) const [syList,setSyList] = useState([]) const [slList,setSlList] = useState([]) const [wyList,setWyList] = useState([]) const [dmList,setDmList] = useState([]) const [openSy, setOpenSy] = useState(false) const [openSl, setOpenSl] = useState(false) const [openWy, setOpenWy] = useState(false) const [openDm, setOpenDm] = useState(false) const [modalData, setModalData] = useState({}) const columnsSy = [ { title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center", ellipsis: true }, { title: '所属断面', key: 'profileName', dataIndex: 'profileName',width: 110,align: "center", ellipsis: true }, { title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 110, ellipsis: true, render:(v,row)=>
{v?.slice(5,16)}
}, { title: '管水位(m)', key: 'value', dataIndex: 'value',align: "center", ellipsis: true, render:(v,row)=>
{v}
}, ] const columnsSl = [ { title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center", ellipsis: true }, { title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 150, ellipsis: true, render:(v,row)=>
{v?.slice(5,16)}
}, { title: '渗流量(L/s)', key: 'value', dataIndex: 'value',align: "center", ellipsis: true, render:(v,row)=>
{v}
}, ] const columnsWy = [ { title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center",width: 80, ellipsis: true }, { title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 80, ellipsis: true, render:(v,row)=>
{v?.slice(5,10)}
{v?.slice(11,16)}
}, { title:
X方向
(mm)
, key: 'x', dataIndex: 'x',align: "center", ellipsis: true, render:(v,row)=>
{v}
}, { title:
Y方向
(mm)
, key: 'y', dataIndex: 'y',align: "center", ellipsis: true, render:(v,row)=>
{v}
}, { title:
H方向
(mm)
, key: 'h', dataIndex: 'h',align: "center", ellipsis: true, render:(v,row)=>
{v}
}, ] useEffect(()=>{ getSyData() getSlData() getWyData() getDmData() },[]) const getSyData = async()=>{ const {code, data} = await httpget2(apiurl.home.sy) const list = [] const c = ['01','04','07','16','10','13','02','05','08','17','11','14','03','06','09','12','15','24','26','28','25','27','29','18','19','20','21','22','23'] .map((i)=>{ list.push({ "stationCode": "SY"+i, "profileName": "B0+250", "tm": "2024-10-10 08:00:00", "value": 195.3, "flag": 1, "status": 0 }) }) if(code!==200){ return } setSyList(list) } const getSlData = async()=>{ const {code, data} = await httpget2(apiurl.home.sl) if(code!==200){ return } const list = [{ "stationCode": "SL01", "profileName": null, "tm": "2024-10-27 08:00:00", "value": 1.18, "flag": 1, "status": 0 }] setSlList(list) } const getWyData = async()=>{ const {code, data} = await httpget2(apiurl.home.wy) if(code!==200){ return } const list = [] for(let a=1; a<33; a++){ list.push({ "stationCode": "WY"+(a<10?('0'+a):a), "tm": "2024-10-15 08:00:00", "flag": 1, "x": -0.09, "y": 0.1, "h": 0.12, "xstatus": 0, "ystatus": 0, "hstatus": 0 }) } for(let b=1; b<37; b++){ list.push({ "stationCode": "ZY"+(b<10?('0'+b):b), "tm": "2024-10-15 08:00:00", "flag": 1, "x": -0.09, "y": 0.1, "h": 0.12, "xstatus": 0, "ystatus": 0, "hstatus": 0 }) } setWyList(list) } const getDmData = async()=>{ const {code, data} = await httppost2(apiurl.home.dmList) if(code!==200){ return } console.log('断面',data) setDmList(data) } return (
{ syList.map((item)=>
{ setOpenSy(true) setModalData(item) }}> {item.stationCode}
) } {/* { slList.map((item)=>
{ setOpenSl(true) setModalData(item) }}> {item.stationCode}
) } */} { wyList.map((item)=>
{ setOpenWy(true) setModalData(item) }} > {item.stationCode}
) }
{ !isHome?
渗压监测
} key="1">
({ onClick:()=>{ setOpenSy(true) setModalData(data) } }) } /> 渗流监测} key="2">
({ onClick:()=>{ setOpenSl(true) setModalData(data) } }) } /> 位移监测} key="3">
({ onClick:()=>{ setOpenWy(true) setModalData(data) } }) } />
setShouQi(!shouqi)}/>
:null } {/*
*/} setOpenSy(false)} destroyOnClose={true}> setOpenSy(false)}/> setOpenSl(false)} destroyOnClose={true}> setOpenSl(false)}/> setOpenWy(false)} destroyOnClose={true}> setOpenWy(false)}/> setOpenDm(false)} destroyOnClose={true}> setOpenDm(false)}/> ) }