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

28341 北电]武装部,页面切换未变化101458

上级 de63f811
......@@ -47,7 +47,6 @@ export default class Detail extends Component {
window.addEventListener(
'message',
(event) => {
console.log(event.data);
if (event && event.data && event.data.indexOf) {
if(event.data.indexOf('iframeDetailHeight') > -1){ // 高度修改事件
let height = Number(event.data.split('-')[1]);
......@@ -72,9 +71,21 @@ export default class Detail extends Component {
);
}
render() {
// static getDerivedStateFromProps(nextProps, prevState) {
// if(nextProps.workId && prevState.id && nextProps.workId !== prevState.id){
// return {
// id: nextProps.workId,
// };
// }else{
// return null;
// }
// // ...
// }
render() {
const { id } = this.state;
let iframeUrl = `${config.gateWayPort}/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
let iframeUrl = `${config.gateWayPort}/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
// iframeUrl = `https://yx.bpi.edu.cn/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
// iframeUrl = `http://localhost:8022/portal/#/showSmartFormOnly?id=${id}&token=${getToken()}&isShow=true`;
return (
<PageHeaderWrapper title="">
......
import React from "react";
import React, { useEffect, useState } from "react";
import CheckRecord2 from "@/webPublic/FormInsertDiy/AffairPage/IframeFor2.0"; // 2.0的 查询类 应用 直接iframe 嵌入
import Apply from "@/webPublic/FormInsertDiy/AffairPage/ApplyPage"; // 申请
import BatchAudit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit"; // 批量审批
......@@ -12,9 +12,23 @@ export default function ActiveMenuComponent2({
...otherProps
}) {
const { component = "", appId } = routerConfig;
const [show, setShow] = useState(true);
useEffect(() => {
if(appId){
setShow(false);
setTimeout(() => {
setShow(true);
}, 1000);
}
}, [appId]);
if(!show){
return null;
}
switch (component) {
case "CheckRecord": // 查询类应用
console.log(appId);
return <CheckRecord2 workId={appId} {...otherProps} />;
case "Apply": // 申请类
return <Apply
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论