Browse Source

Merge branch 'develop' of http://120.55.44.4:10080/xujunjie/gt_client_pad into develop

Renxy 1 năm trước cách đây
mục cha
commit
c22ed93491

+ 1 - 1
src/pages/EqSelfInspection/components/Table/PressureGaugeCom.js

@@ -162,7 +162,7 @@ export default function PressureGaugeCom(props) {
     if (showAllTabs) {
       items.push({
         key: '0',
-        label: `历史数据(${normalData.length || 0})`,
+        label: `历史记录(${normalData.length || 0})`,
         children: <div></div>,
       });
     }

+ 2 - 2
src/pages/EqSelfInspection/components/Table/ReportCom.js

@@ -28,7 +28,7 @@ export default function ReportCom(props) {
         data.errorTableData.push(item);
       } else if (item.Status == 2 && statusCheck.includes(2)) {
         data.warningTableData.push(item);
-      } else if (statusCheck.includes(0)) {
+      } else if (item.Status == 0 && statusCheck.includes(0)) {
         data.normalData.push(item);
       }
     });
@@ -111,7 +111,7 @@ export default function ReportCom(props) {
         <DeviceTable
           onClickItem={sendMessageToUnity}
           select={select}
-          items={allData}
+          items={normalData}
           data={data}
           key={type}
           type={type}

+ 1 - 1
src/pages/EqSelfInspection/components/Table/WaterQualityCom.js

@@ -163,7 +163,7 @@ export default function WaterQualityCom(props) {
     if (showAllTabs) {
       items.push({
         key: '0',
-        label: `历史数据(${normalData.length || 0})`,
+        label: `历史记录(${normalData.length || 0})`,
         children: <div></div>,
       });
     }

+ 3 - 3
src/pages/Home/ChemCostComparison.js

@@ -118,7 +118,7 @@ export const ChemCost = ({ open, showTip = false }) => {
   const { data: snapshot } = useRequest(queryConditionSnapshot, {
     defaultParams: [{ project_id: projectId }],
     formatResult: (result) => {
-      const otcCost = Number(getValue(result.data.otc_cost_unit));
+      const otcCost = Number(getValue(result.data.otc_day_cost_unit));
       let resultText = `当前药耗持平理论值 (${
         result?.data?.otc_unit_theory || 0
       }kg/m³)`;
@@ -257,7 +257,7 @@ export const ChemCost = ({ open, showTip = false }) => {
       // 确定保留的小数点
       const chemUsedMaxValue = [...planChem, ...actualChem]
         .map((item) => item.value)
-        .reduce((a, b) => Math.max(a, b));
+        .reduce((a, b) => Math.max(a, b), 0);
       const chemUsedFixed = getFixed(chemUsedMaxValue);
       chemUsed.dataList = [
         {
@@ -329,7 +329,7 @@ export const ChemCost = ({ open, showTip = false }) => {
           <div className={styles.curEnergyCost}>
             <div className={styles.item}>
               <div className={styles.value}>
-                {open ? getValue(snapshot?.otc_unit || '') : '***'}
+                {open ? getValue(snapshot?.otc_day_unit || '') : '***'}
                 <span className={styles.unit}>元/m³</span>
               </div>
               <div className={styles.name}>近一天吨水药成本</div>

+ 3 - 3
src/pages/Home/EnergyCostComparison.js

@@ -85,7 +85,7 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
   const { data: snapshot } = useRequest(queryConditionSnapshot, {
     defaultParams: [{ project_id: projectId }],
     formatResult: (result) => {
-      const elec = Number(getValue(result.data.elec_unit));
+      const elec = Number(getValue(result.data.elec_day_unit));
       let resultText = `当前电耗持平理论值 ${
         result?.data?.elec_unit_theory || 0
       }KWh/m³`;
@@ -309,7 +309,7 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
             }}
           >
             <div className={styles.value}>
-              {open ? getValue(snapshot?.elec_unit || '') : '***'}
+              {open ? getValue(snapshot?.elec_day_unit || '') : '***'}
               <span className={styles.unit}>kWh/t</span>
             </div>
             <div className={styles.name}>近一天吨水电耗</div>
@@ -321,7 +321,7 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
             }}
           >
             <div className={styles.value}>
-              {open ? getValue(snapshot?.elec || '') : '***'}
+              {open ? getValue(snapshot?.elec_day || '') : '***'}
               <span className={styles.unit}>kWh</span>
             </div>
             <div className={styles.name}>近一天用电量</div>

+ 4 - 4
src/pages/Home/index.js

@@ -245,8 +245,8 @@ const Electric = (props) => {
   const [open, setOpen] = useState(false);
 
   const elec = useMemo(() => {
-    return getValue(data?.elec_unit);
-  }, [data?.elec_unit]);
+    return getValue(data?.elec_day_unit);
+  }, [data?.elec_day_unit]);
 
   const status = useMemo(() => {
     if (!data) return '';
@@ -312,8 +312,8 @@ const Medicine = (props) => {
   const [open, setOpen] = useState(false);
 
   const otc_cost = useMemo(() => {
-    return getValue(data?.otc_cost_unit);
-  }, [data?.otc_cost_unit]);
+    return getValue(data?.otc_day_cost_unit);
+  }, [data?.otc_day_cost_unit]);
 
   const status = useMemo(() => {
     if (!data) return '';

+ 1 - 1
src/pages/SmartOps/WorkAnalysisDetail.js

@@ -439,7 +439,7 @@ const ChartContent = (props) => {
           defaultValue={time}
           // value={time}
           onChange={onSearch}
-          format="YYYY-MM-DD HH:mm:ss"
+          format="YYYY-MM-DD HH:mm"
         ></RangePicker>
         <div className={styles.dateTabs}>
           {DateTab.map((item) => (

+ 7 - 4
src/pages/SmartOps/components/DeviceAnalysis.js

@@ -495,12 +495,12 @@ const WaterFlow = (props) => {
     {
       title: '差值',
       // width: '15%',
-      dataIndex: 'current_val',
+      dataIndex: 'result_val',
     },
     {
       title: '时间',
       // width: '15%',
-      dataIndex: 'create_time',
+      dataIndex: 'created_time',
       render: (text) => {
         if (text) {
           return dayjs(text).format('HH:mm:ss');
@@ -513,11 +513,14 @@ const WaterFlow = (props) => {
       width: '30%',
       render: (record) => (
         <ThresholdDetail
-          current={record.current_val || 0}
+          current={record.result_val || 0}
           data={{
             JsonNumThreshold: {
               exception: [
-                { ThresholdValue: record?.thresholds, ThresholdType: 1 },
+                {
+                  ThresholdValue: record?.threshold_error,
+                  ThresholdType: record.result_val > 0 ? 1 : 2,
+                },
               ],
             },
             Type: 2,

+ 8 - 12
src/pages/SmartOps/index.js

@@ -15,7 +15,6 @@ import {
   useRequest,
   useSearchParams,
 } from '@umijs/max';
-import { Tabs } from 'antd';
 import dayjs from 'dayjs';
 import { useEffect, useMemo, useRef, useState } from 'react';
 import Analysis from './Analysis';
@@ -26,14 +25,10 @@ import styles from './index.less';
 import OperationManage from './operationManage';
 import PredictionAnalysis from './predictionAnalysis/PredictionAnalysis';
 
-const { TabPane } = Tabs;
-const icon06 = require('@/assets/smartOps/icon06.png');
-const icon07 = require('@/assets/smartOps/icon07.png');
-
 let timer = '';
 
 function SmartOps(props) {
-  const { list, dispatch, loading, loadingDev, autoReport } = props;
+  const { list, dispatch, loading, loadingDev, autoReport, active } = props;
 
   const navigate = useNavigate();
   const { projectId } = useParams();
@@ -42,7 +37,6 @@ function SmartOps(props) {
   const idList = searchParams.get('idList');
   const patrolId = searchParams.get('patrolId');
 
-  const [tab, setTab] = useState('1');
   const [videoNum, setVideoNum] = useState(0);
 
   const signalRef = useRef();
@@ -198,8 +192,6 @@ function SmartOps(props) {
 
   const AnalysisNumber = list?.pagenation?.total || 0;
 
-  const deviceNumber = autoReport?.extendWarningData?.length || 0;
-
   // 利润
   const { data: profitData, run: getProfit } = useRequest(
     () =>
@@ -227,7 +219,10 @@ function SmartOps(props) {
   }, [eTime]);
 
   const onChangeTab = (type) => {
-    setTab(type);
+    dispatch({
+      type: 'smartOps/save',
+      payload: { active: type },
+    });
     UnityAction.sendMsg('SmartAnalysisTab', type);
   };
 
@@ -254,7 +249,7 @@ function SmartOps(props) {
     });
 
     // 通知unity当前处于工况分析
-    UnityAction.sendMsg('SmartAnalysisTab', 1);
+    UnityAction.sendMsg('SmartAnalysisTab', active);
 
     const controller = new AbortController();
     signalRef.current = controller;
@@ -332,7 +327,7 @@ function SmartOps(props) {
       </div>
       <div className={styles.tabContent}>
         <TabsContent
-          defaultActiveKey="1"
+          defaultActiveKey={active}
           center={false}
           spacing={2.5}
           small
@@ -402,6 +397,7 @@ export default connect(({ smartOps, eqSelfInspection, loading }) => ({
   list: smartOps.list,
   loading: loading.models.smartOps,
   processList: smartOps.processList,
+  active: smartOps.active,
   autoReport: eqSelfInspection.autoReport,
   loadingDev: loading.effects['eqSelfInspection/getPatrolDataById'],
 }))(SmartOps);

+ 1 - 0
src/pages/SmartOps/models/smartOps.js

@@ -8,6 +8,7 @@ export default {
 
   state: {
     list: [],
+    active: "1",
     processList: [],
   },
 

+ 2 - 2
src/pages/SmartOps/predictionAnalysis/PredictionAnalysis.js

@@ -23,7 +23,7 @@ const PredictionAnalysis = () => {
       devs[item.device_code] = 0;
     });
     const msg = {
-      SysName: '超滤工艺单元',
+      SysName: '超滤单元',
       SysDevs: devs,
     };
     UnityAction.sendMsg('ProcessPredictDetail', JSON.stringify(msg));
@@ -34,7 +34,7 @@ const PredictionAnalysis = () => {
   return (
     <>
       <div className="card-box" style={{ padding: '0.2rem' }}>
-        <div className={styles.title}>超滤工艺单元</div>
+        <div className={styles.title}>超滤单元</div>
         {deviceList?.map((item, index) => {
           return (
             <div

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

@@ -55,7 +55,7 @@ const PredictionDetail = () => {
     <PageContent closeable={false}>
       <PageTitle onReturn={handleBackClick}>预测分析</PageTitle>
       <div className={styles.detailDeviceName}>
-        超滤工艺单元: {currentDevice.device_name}({currentDevice.device_code})
+        超滤单元: {currentDevice.device_name}({currentDevice.device_code})
       </div>
       <div className={styles.detailDevice}>
         <div className={styles.detailDeviceTitle}>跨膜压差</div>
@@ -536,7 +536,7 @@ export const ChartContent = (props) => {
           defaultValue={time}
           // value={time}
           onChange={onSearch}
-          format="YYYY-MM-DD HH:mm:ss"
+          format="YYYY-MM-DD HH:mm"
         ></RangePicker>
         <div className={styles.dateTabs}>
           {DateTab.map((item) => (