|
@@ -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);
|