|
@@ -5,6 +5,7 @@ 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';
|
|
|
|
|
|
@@ -216,21 +217,32 @@ const Medicine = () => {
|
|
// 工艺监控
|
|
// 工艺监控
|
|
const Scada = () => {
|
|
const Scada = () => {
|
|
const { projectId } = useParams();
|
|
const { projectId } = useParams();
|
|
- const token = getToken();
|
|
|
|
- let domain =
|
|
|
|
- process.env.NODE_ENV === 'production'
|
|
|
|
- ? 'http://120.55.44.4:8900/'
|
|
|
|
- : 'http://47.96.12.136:8788/';
|
|
|
|
- const src1 = `${domain}smart-water/scada/index.html#/3dview/${projectId}/267?JWT-TOKEN=${token}&hideTitle=true`;
|
|
|
|
- const src2 = `${domain}smart-water/scada/index.html#/3dview/${projectId}/203?JWT-TOKEN=${token}&hideTitle=true`;
|
|
|
|
|
|
+
|
|
|
|
+ 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 (
|
|
return (
|
|
<Box
|
|
<Box
|
|
title="工艺监控"
|
|
title="工艺监控"
|
|
onClick={() => UnityAction.sendMsg('menuItem', '工艺监控')}
|
|
onClick={() => UnityAction.sendMsg('menuItem', '工艺监控')}
|
|
>
|
|
>
|
|
<div className={styles.scadaContent}>
|
|
<div className={styles.scadaContent}>
|
|
- <iframe src={src1} />
|
|
|
|
- <iframe src={src2} />
|
|
|
|
|
|
+ {data?.map((url) => (
|
|
|
|
+ <iframe src={url} />
|
|
|
|
+ ))}
|
|
</div>
|
|
</div>
|
|
</Box>
|
|
</Box>
|
|
);
|
|
);
|