xujunjie 1 年之前
父節點
當前提交
86bfd2b81a
共有 3 個文件被更改,包括 11 次插入14 次删除
  1. 1 1
      src/pages/SmartOps/WorkAnalysisDetail.js
  2. 9 13
      src/pages/SmartOps/index.js
  3. 1 0
      src/pages/SmartOps/models/smartOps.js

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

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

+ 9 - 13
src/pages/SmartOps/index.js

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

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

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