|
@@ -1,10 +1,11 @@
|
|
import { getComparisonData } from '@/services/OperationManagement';
|
|
import { getComparisonData } from '@/services/OperationManagement';
|
|
import { queryConditionSnapshot } from '@/services/SmartOps';
|
|
import { queryConditionSnapshot } from '@/services/SmartOps';
|
|
-import { UnityAction } from '@/utils/utils';
|
|
|
|
|
|
+import { getToken, UnityAction } from '@/utils/utils';
|
|
import { LoadingOutlined } from '@ant-design/icons';
|
|
import { LoadingOutlined } from '@ant-design/icons';
|
|
import { connect, useParams, useRequest } from '@umijs/max';
|
|
import { connect, useParams, useRequest } from '@umijs/max';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
import { useEffect } from 'react';
|
|
import { useEffect } from 'react';
|
|
|
|
+import { getScadaPage } from '../../services/OperationManagement';
|
|
import CircleScore from '../Smart/components/CircleScore';
|
|
import CircleScore from '../Smart/components/CircleScore';
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
|
|
|
|
@@ -17,6 +18,7 @@ const HomePage = (props) => {
|
|
return (
|
|
return (
|
|
<div className={styles.content}>
|
|
<div className={styles.content}>
|
|
<LeftContent data={data} />
|
|
<LeftContent data={data} />
|
|
|
|
+ <CenterContent />
|
|
<RightContent data={data} />
|
|
<RightContent data={data} />
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
@@ -32,6 +34,13 @@ const LeftContent = (props) => {
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
+const CenterContent = () => {
|
|
|
|
+ return (
|
|
|
|
+ <div className={styles.centerBox}>
|
|
|
|
+ <Scada />
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+};
|
|
const RightContent = (props) => {
|
|
const RightContent = (props) => {
|
|
const { data } = props;
|
|
const { data } = props;
|
|
return (
|
|
return (
|
|
@@ -205,6 +214,40 @@ const Medicine = () => {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+// 工艺监控
|
|
|
|
+const Scada = () => {
|
|
|
|
+ const { projectId } = useParams();
|
|
|
|
+
|
|
|
|
+ const { data } = useRequest(getScadaPage, {
|
|
|
|
+ defaultParams: [{ project_id: projectId }],
|
|
|
|
+ formatResult: (res) => {
|
|
|
|
+ let domain =
|
|
|
|
+ process.env.NODE_ENV === 'production'
|
|
|
|
+ ? 'http://120.55.44.4:8900/'
|
|
|
|
+ : 'http://47.96.12.136:8788/';
|
|
|
|
+ const token = getToken();
|
|
|
|
+ const pageList = res?.filter((item) => item.hide);
|
|
|
|
+ const urls = pageList.map(
|
|
|
|
+ (item) =>
|
|
|
|
+ `${domain}smart-water/scada/index.html#/3dview/${projectId}/${item.id}?JWT-TOKEN=${token}&hideTitle=true`,
|
|
|
|
+ );
|
|
|
|
+ return urls.splice(0, 2);
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ return (
|
|
|
|
+ <Box
|
|
|
|
+ title="工艺监控"
|
|
|
|
+ onClick={() => UnityAction.sendMsg('menuItem', '工艺监控')}
|
|
|
|
+ >
|
|
|
|
+ <div className={styles.scadaContent}>
|
|
|
|
+ {data?.map((url) => (
|
|
|
|
+ <iframe src={url} />
|
|
|
|
+ ))}
|
|
|
|
+ </div>
|
|
|
|
+ </Box>
|
|
|
|
+ );
|
|
|
|
+};
|
|
|
|
+
|
|
const Box = ({ title, children, onClick }) => {
|
|
const Box = ({ title, children, onClick }) => {
|
|
return (
|
|
return (
|
|
<div className={styles.box} onClick={onClick}>
|
|
<div className={styles.box} onClick={onClick}>
|