xujunjie 1 жил өмнө
parent
commit
bf5d448671

+ 6 - 0
src/models/eqSelfInspection.js

@@ -270,6 +270,12 @@ export default {
               return { ...item, history: true };
               return { ...item, history: true };
             }),
             }),
           ];
           ];
+          data.WaterInCheckList = [
+            ...data.WaterInCheckList,
+            ...recentGaugeRecord.data.WaterInCheckList.map((item) => {
+              return { ...item, history: true };
+            }),
+          ];
           data.PressureCompareList = [
           data.PressureCompareList = [
             ...data.PressureCompareList,
             ...data.PressureCompareList,
             ...recentGaugeRecord.data.PressureCompareList.map((item) => {
             ...recentGaugeRecord.data.PressureCompareList.map((item) => {

+ 3 - 3
src/pages/EqSelfInspection/components/Table/WaterInCom.js

@@ -26,7 +26,7 @@ export default function WaterInCom(props) {
     allData?.forEach((item) => {
     allData?.forEach((item) => {
       if (!item.history && item.status == 1 && statusCheck.includes(1)) {
       if (!item.history && item.status == 1 && statusCheck.includes(1)) {
         data.errorTableData.push(item);
         data.errorTableData.push(item);
-      } else if (item.status == 0 && statusCheck.includes(0)) {
+      } else if (item.history) {
         data.normalData.push(item);
         data.normalData.push(item);
       }
       }
     });
     });
@@ -43,10 +43,10 @@ export default function WaterInCom(props) {
         children: <div></div>,
         children: <div></div>,
       });
       });
     }
     }
-    if (showAllTabs || normalData.length > 0) {
+    if (showAllTabs) {
       items.push({
       items.push({
         key: '0',
         key: '0',
-        label: `正常(${normalData.length || 0})`,
+        label: `历史记录(${normalData.length || 0})`,
         children: <div></div>,
         children: <div></div>,
       });
       });
     }
     }

+ 21 - 3
src/pages/SmartOps/ChartPage.js

@@ -6,6 +6,7 @@ import { Button, DatePicker, Empty, Form, Spin } from 'antd';
 import dayjs from 'dayjs';
 import dayjs from 'dayjs';
 import { useEffect, useState } from 'react';
 import { useEffect, useState } from 'react';
 import styles from './index.less';
 import styles from './index.less';
+import { ChartContent } from './predictionAnalysis/PredictionDetail';
 
 
 const { RangePicker } = DatePicker;
 const { RangePicker } = DatePicker;
 const tabs = [
 const tabs = [
@@ -35,9 +36,8 @@ const ChartPage = (props) => {
 
 
   const { projectId } = useParams();
   const { projectId } = useParams();
   const [searchParams, setSearchParams] = useSearchParams();
   const [searchParams, setSearchParams] = useSearchParams();
-  const type = searchParams.get('type') || 2;
   const data = searchParams.get('data');
   const data = searchParams.get('data');
-  const deviceCode = searchParams.get('device_code');
+  const isPredictionAnalysis = searchParams.get('title') == '跨膜压差';
 
 
   const [loading, setLoading] = useState(false);
   const [loading, setLoading] = useState(false);
   const [options, setOptions] = useState({});
   const [options, setOptions] = useState({});
@@ -215,4 +215,22 @@ const ChartPage = (props) => {
     </PageContent>
     </PageContent>
   );
   );
 };
 };
-export default ChartPage;
+
+export default () => {
+  const [searchParams, setSearchParams] = useSearchParams();
+  const { projectId } = useParams();
+  const isPredictionAnalysis = searchParams.get('title') == '跨膜压差';
+
+  if (isPredictionAnalysis) {
+    return (
+      <PageContent closeable={false}>
+        <ChartContent
+          deviceCode={searchParams.get('device_code')}
+          projectId={projectId}
+        />
+      </PageContent>
+    );
+  } else {
+    return <ChartPage />;
+  }
+};

+ 1 - 1
src/pages/SmartOps/predictionAnalysis/PredictionDetail.js

@@ -444,7 +444,7 @@ function getOption(data = [], active) {
   return option;
   return option;
 }
 }
 
 
-const ChartContent = (props) => {
+export const ChartContent = (props) => {
   const { deviceCode, projectId } = props;
   const { deviceCode, projectId } = props;
 
 
   const [time, setTime] = useState([dayjs().subtract(10, 'minute'), dayjs()]);
   const [time, setTime] = useState([dayjs().subtract(10, 'minute'), dayjs()]);