Commit 92e01671 authored by 崔佳豪's avatar 崔佳豪

feat: 新增iframe访问功能

parent 17a7c670
......@@ -90,7 +90,8 @@
],
"resolutions": {
"babel-core": "7.0.0-bridge.0",
"webpack": "^5.70.0"
"webpack": "^5.70.0",
"antd": "4.21.2"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
......@@ -112,9 +113,9 @@
"@wisdom-map/arcgismap": "1.4.0-67",
"@wisdom-map/basemap": "1.1.0-13",
"@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.269",
"@wisdom-utils/components": "0.1.272",
"@wisdom-utils/runtime": "0.0.32",
"@wisdom-utils/utils": "0.1.309",
"@wisdom-utils/utils": "0.1.312",
"animate.css": "^4.1.1",
"antd": "4.21.2",
"compression": "1.7.4",
......
import React, { memo } from "react";
import SecurityLayout from "../../../layouts/SecurityLayout";
const HocContainer = Component => {
return (props) => {
return (
<SecurityLayout>
<Component {...props} />
</SecurityLayout>
)
}
}
export default HocContainer;
\ No newline at end of file
import React, { memo } from 'react';
import Iframe from 'react-iframe';
import Empty from '@wisdom-components/empty';
import styles from './index.less';
import Hoc from './HocContainer';
const TabWidget = ({ params }) => {
const { linkUrl } = params || {};
return (
<div className={styles['tab-iframe']}>
{linkUrl ? (
<Iframe
url={linkUrl}
width="100%"
height="100%"
display="block"
position="relative"
styles={{ border: 'none' }}
/>
) : (
<Empty description="配置url链接才能显示哦!"/>
)}
</div>
);
};
export default memo(Hoc(TabWidget));
.tab-iframe {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ import Iframe from '../pages/iframe';
import Login from '../pages/user/login';
import NoSecret from '../pages/user/login/noSecret';
import Notifications from '../pages/system/notifications';
import TabIframe from '../pages/system/iframe/TabWidget';
export const dyRoutes = (routes, layout, theme) => {
// eslint-disable-next-line no-shadow
......@@ -87,6 +88,15 @@ export const dyRoutes = (routes, layout, theme) => {
loading: LoadingComponent,
}),
},
{
path: '/',
render: ({ routeConfig }) => {
const { path } = routeConfig || {};
if (/system\/iframe\/tabWidget/.test(path)) {
return <TabIframe { ...routeConfig }/>
}
}
}
],
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment