import TabsContent from '@/components/TabsContent'; import ThresholdDetail from '@/components/ThresholdDetail'; import { Popover, Table } from 'antd'; import dayjs from 'dayjs'; import { useEffect, useMemo, useState } from 'react'; import styles from '../PatrolReportDetail.less'; import Empty from './Empty'; export default function LiquidLevelCom(props) { const { sendMessageToUnity, select, allData, type, statusCheck, changeStatus, } = props; const [activeKey, setActiveKey] = useState('1'); const handleTabsChange = (activeKey) => { setActiveKey(activeKey); }; const { errorTableData, normalData } = useMemo(() => { let data = { errorTableData: [], normalData: [] }; allData?.forEach((item) => { if (item.status == 1 && statusCheck.includes(1)) { data.errorTableData.push(item); } else if (item.status == 0 && statusCheck.includes(0)) { data.normalData.push(item); } }); return data; }, [statusCheck, allData]); const items = useMemo(() => { let items = []; let showAllTabs = statusCheck.length == 3; if (showAllTabs || errorTableData.length > 0) { items.push({ key: '1', label: `异常(${errorTableData.length || 0})`, children:
, }); } if (showAllTabs || normalData.length > 0) { items.push({ key: '0', label: `历史记录(${normalData.length || 0})`, children: , }); } return items; }, [statusCheck, allData]); useEffect(() => { if (items.length == 0) { changeStatus(0); } else { setActiveKey(items[0].key); changeStatus(1); } }, [items]); const content = (固定液位1为H1,固定液位2为H2,实际液位为H实
液位差值:液位标准值(H1)与液位实际值(H2)的差值
液位差比值:H1标准值与实际值的差值与H2的标准值与实际值的差值的比值