Commit b0875ab5 authored by 张烨's avatar 张烨

fix: 跳转样式

parent 6e8b3970
import { isDev } from '@/utils/tools';
import { PageContainer } from '@ant-design/pro-layout';
import { Tabs } from 'antd';
import React from 'react';
import styles from './index.less';
const { TabPane } = Tabs;
/**
* 嵌套iframe的组件
* @param {*} props 可在路由配置里面配置url参数
*/
const FrameContainer = props => {
const { route } = props;
const url = route.url || props.url;
const { url = props.url, tabs = props.tabs, tabProps = {} } = route;
const renderedFrame = tabs ? (
<Tabs type="card" hideAdd {...tabProps}>
{tabs.map(({ url: iframeUrl, tabName }) => (
<TabPane tab={tabName} key={tabName}>
<iframe
title={tabName}
src={`${
isDev ? process.env.PROXY : window.location.origin
}${iframeUrl}`}
/>
</TabPane>
))}
</Tabs>
) : (
<iframe
title="iframe"
src={`${isDev ? process.env.PROXY : window.location.origin}${url}`}
/>
);
return (
<PageContainer
className={styles.container}
......@@ -19,12 +42,7 @@ const FrameContainer = props => {
height: 'calc(100% + 24px)',
}}
>
<iframe
title="iframe"
src={`${
isDev ? process.env.PROXY : window.location.origin
}${url}`.replace('//', '/')}
/>
{renderedFrame}
</PageContainer>
);
};
......
......@@ -3,7 +3,7 @@
.ant-pro-grid-content{
flex: 1;
.ant-pro-grid-content-children{
height: 100%;
height: calc(100% - 12px);
&>div{
height: 100%;
.ant-pro-page-container-children-content{
......@@ -12,8 +12,18 @@
width: 100%;
height: 100%;
}
}
}
}
.ant-tabs.ant-tabs-top.ant-tabs-card{
height: 100%;
.ant-tabs-nav{
margin: 0;
}
.ant-tabs-content.ant-tabs-content-top{
height: 100%;
}
}
}
}
\ No newline at end of file
......@@ -148,13 +148,25 @@ export default {
{
path: '/platformCenter/notify',
name: '消息平台',
component: Welcome,
component: BaseFramContainer,
tabs: [
{
tabName: '推送模板配置',
url:
'/web4/?widget=product/oms/MessageTem/MessageTem|hideMap=true&state=scan',
},
{
tabName: '推送方案配置',
url:
'/web4/?widget=product/oms/MessageConfig/MessageConfig|hideMap=true',
},
],
},
{
path: '/platformCenter/vedio',
name: '视频管理',
url:
' http://192.168.10.151:8055/web4/?widget=product/oms/VideoConfig/VideoConfig|hideMap=true&videoType=萤石云',
'/web4/?widget=product/oms/VideoConfig/VideoConfig|hideMap=true&videoType=萤石云',
component: BaseFramContainer,
},
{
......
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