提交 d8e149ce authored 作者: 钟是志's avatar 钟是志

通过父iframe 定义公共组件让 子iframe 直接使用

上级 bd69ccbf
......@@ -45,7 +45,7 @@ export default class Detail extends Component {
(event) => {
if (event.data && event.data.indexOf && event.data.indexOf('iframeDetailHeight') > -1) {
const height = Number(event.data.split('-')[1]);
console.log(height);
// console.log(height);
document.getElementById('detailIframeId').height = height + 50;
setTimeout(() => {
let d = document.getElementsByClassName('ant-layout-content');
......
......@@ -49,7 +49,7 @@ export default class Detail extends Component {
(event) => {
if (event && event.data && event.data.indexOf && event.data.indexOf('iframeDetailHeight') > -1) {
let height = Number(event.data.split('-')[1]);
console.log(height);
// console.log(height);
const iframe = document.getElementById('applyIframeId');
if (iframe && height > 950) {
iframe.height = height;
......
......@@ -4,6 +4,14 @@ import Apply from "@/webPublic/FormInsertDiy/AffairPage/ApplyPage"; // 申请
import BatchAudit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit"; // 批量审批
import Audit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js"; // 审批
import Detail from "@/webPublic/FormInsertDiy/AffairPage/Detail"; //详情
import { Modal, message, notification } from 'antd';
window.iframeParentComponent = {
Modal,
message,
notification,
};
export default function ActiveMenuComponent({
routerConfig,
...otherProps
......@@ -14,16 +22,16 @@ export default function ActiveMenuComponent({
case "CheckRecord": // 查询类应用
return <CheckRecord workId={appId}
/>;
case "Apply": // 申请类
case "Apply": // 申请类 详情是 iframe
return <Apply
workId={appId} {...otherProps}/>;
case "Audit": // 审批类
case "Audit": // 审批类 详情是 iframe
return <Audit
workId={appId} {...otherProps}/>;
case "BatchAudit": // 批量审批
case "BatchAudit": // 批量审批 详情是 iframe
return <Audit
workId={appId} {...otherProps}/>;
case "Detail": // 详情
case "Detail": // 详情 iframe
return <Detail
{...otherProps} {...otherProps}/>;
default:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论