tsg-web/src/views/sq/qth/sksq/index.js

68 lines
2.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import React, { useEffect, useState } from 'react'
import { reservoirlist, } from "../../../../service/sssq";
import Sssw from './sssw';
import Sjcx from '../../../Home/MapCtrl/components/Sksjcx/index'
import NormalSelect from '../../../../components/Form/NormalSelect';
import "./index.less"
import { helpers } from '@turf/turf';
import { Label } from 'react-konva';
export default function Sksq() {
const [tableData, setTableData] = useState([])
const [selected, setSelected] = useState(0)
const getData = async (params) => {
const data = await reservoirlist(params)
setTableData(data);
}
useEffect(() => {
let option = {
sources: ["SW", "SK"],
args: "",
};
getData(option)
}, [])
return (
<div className='lf' style={{ height: 'calc(100vh - 168px)', width: "100%" }}>
<div className='content-sk'>
<div className='content-left'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center"}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span style={{marginLeft:10}}>实时水位</span>
</div>
<span>站点
<NormalSelect
allowClear={false}
style={{ width: '150px' }}
options={tableData.map((item,index)=>({ label: item.stnm, value: index }))}
value={selected}
onChange={(e) => setSelected(e)}
/>
</span>
</div>
<div className='sssw-content'>
<Sssw data={tableData[selected] || {}}/>
</div>
</div>
<div className='content-right'>
<div className='comomn-title'>
<div style={{display:"flex",alignItems:"center",columnGap:10}}>
<img alt='' src={`${process.env.PUBLIC_URL}/assets/panelTitle.png`} />
<span>数据查询</span>
</div>
</div>
<div className='sjcx-content'>
<Sjcx record={{...tableData[selected],height:true} || {}}/>
</div>
</div>
</div>
</div>
)
}