2024-09-20 15:02:50 +08:00
|
|
|
import React, { useEffect, useState, useMemo } from 'react';
|
|
|
|
|
import { Descriptions, Form, Button, Input, DatePicker } from 'antd';
|
|
|
|
|
import {CloseOutlined} from '@ant-design/icons';
|
|
|
|
|
import ReactEcharts from 'echarts-for-react';
|
|
|
|
|
import { httppost2 } from '../../../utils/request';
|
|
|
|
|
import apiurl from '../../../service/apiurl';
|
|
|
|
|
import moment from "moment"
|
|
|
|
|
import drpOption from './drpOption';
|
|
|
|
|
|
|
|
|
|
const Page = ({data}) => {
|
|
|
|
|
const [ tableData, setTableData ] = useState([])
|
|
|
|
|
const [ xxsw, setXxsw ] = useState(null)
|
|
|
|
|
const option = useMemo(() => drpOption(tableData,xxsw), [tableData])
|
|
|
|
|
|
|
|
|
|
const getData = async(resCode)=>{
|
|
|
|
|
const { code, data} = await httppost2(apiurl.fxdd_xyt.fhxs.getSk,{resCode:resCode})
|
|
|
|
|
if(code!==200 ){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const list = data.list.filter(o=>o.rz)
|
|
|
|
|
setTableData(list)
|
|
|
|
|
setXxsw(Number(data.flLowLimLev))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
useEffect(()=>{
|
|
|
|
|
if(data.resCode){
|
|
|
|
|
getData(data.resCode)
|
|
|
|
|
}
|
|
|
|
|
},[data])
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{
|
|
|
|
|
tableData.length>0?
|
|
|
|
|
<ReactEcharts option={option} style={{width: "100%", height: '300px'}}/>
|
2024-09-25 09:57:08 +08:00
|
|
|
:<div style={{textAlign: "center", padding: "5%"}}><img src={`${process.env.PUBLIC_URL}/assets/noData.png`} alt=""/></div>
|
2024-09-20 15:02:50 +08:00
|
|
|
}
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Page;
|