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

2.0的页面嵌入到学工中

上级 1ccb9203
......@@ -95,6 +95,7 @@ class AffairPage extends React.Component {
dataBaseId,
record,
addFields,
},
}}>
详情
......@@ -202,7 +203,7 @@ class AffairPage extends React.Component {
return false;
}
const { pathname } = this.state;
const { dataBaseId, workId } = this.props;
const { dataBaseId, workId, iframeHeight } = this.props;
if (dataBaseId || workId) {
this.setState(
{
......@@ -234,10 +235,11 @@ class AffairPage extends React.Component {
this.returnList(true);
}
if (event && event.data && event.data.indexOf && event.data.indexOf('iframeHeight') > -1) {
console.log(event.data);
let height = Number(event.data.split('-')[1]);
const iframe = document.getElementById('applyIframeId');
if (iframe) {
iframe.height = height + 50;
iframe.height = height + (iframeHeight || 50);
}
}
},
......@@ -271,6 +273,7 @@ class AffairPage extends React.Component {
};
render() {
const { iframeUrlDiy } = this.props;
const {
workId,
dataBaseId,
......@@ -282,9 +285,9 @@ class AffairPage extends React.Component {
if (!workId || !allConfigSetInfo) {
return null;
}
console.log(allConfigSetInfo.isCloseStart);
// console.log(allConfigSetInfo.isCloseStart);
const url = config.onestopPC.split('/#/');
let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getToken()}`;
let iframeUrl = iframeUrlDiy || `${url[0]}/#/IFrameForApply?id=${workId}&token=${getToken()}`;
console.log(iframeUrl);
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getToken()}`;
let buttons = this.handleButtonSet({});
......
......@@ -45,7 +45,8 @@ 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]);
document.getElementById('detailIframeId').height = height + 50;
console.log(height);
document.getElementById('detailIframeId').height = height + 50;
setTimeout(() => {
let d = document.getElementsByClassName('ant-layout-content');
if(d && d.length){
......@@ -68,13 +69,18 @@ export default class Detail extends Component {
};
render() {
const { from } = this.props;
const { id, showAll } = this.state;
const url = config.onestopPC.split('/#/');
let showPrint = this.props.location?.state?.showPrint;
let iframeUrl = `${url[0]}/#/IframeForDetail?id=${id}&token=${getToken()}`;
if (showPrint) {
iframeUrl = iframeUrl + '&showPrint=true';
}
if(from === 'onestopApp2.0'){
iframeUrl = config.gateWayPort + `/portal/#/showAuditIframe?id=${id}&hasSingle=false&token=${getToken()}&isPrint=false`;
}
// iframeUrl = `http://localhost:8000/onestop/IframeForDetail?id=${id}&token=${getToken()}`;
return (
<PageHeaderWrapper title=''>
......
......@@ -30,7 +30,7 @@ export default class Detail extends Component {
let id = '';
id = getOneStopConfig(pathname);
if (!id) {
id = getUrlInfo()?.id;
id = getUrlInfo()?.id || this.props.workId;
}
let token = getUrlInfo().token;
......
......@@ -12,21 +12,22 @@ export default function ActiveMenuComponent({
switch (component) {
case "CheckRecord": // 查询类应用
return <CheckRecord workId={appId} location={routerConfig} />;
return <CheckRecord workId={appId}
/>;
case "Apply": // 申请类
return <Apply location={routerConfig}
workId={appId} />;
return <Apply
workId={appId} {...otherProps}/>;
case "Audit": // 审批类
return <Audit location={routerConfig}
workId={appId} />;
return <Audit
workId={appId} {...otherProps}/>;
case "BatchAudit": // 批量审批
return <Audit location={routerConfig}
workId={appId} />;
return <Audit
workId={appId} {...otherProps}/>;
case "Detail": // 详情
return <Detail location={routerConfig}
{...otherProps} />;
return <Detail
{...otherProps} {...otherProps}/>;
default:
console.log(component, '没有找到此组件');
console.log(component, "没有找到此组件");
return <div>暂无此功能</div>;
}
......
import React 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"; // 批量审批
import Audit from "@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js"; // 审批
import Detail from "@/webPublic/FormInsertDiy/AffairPage/Detail"; //详情
import { getToken } from "@/utils/authority";
import config from "@/config/config";
export default function ActiveMenuComponent2({
routerConfig,
...otherProps
}) {
const { component = "", appId } = routerConfig;
switch (component) {
case "CheckRecord": // 查询类应用
return <CheckRecord2 workId={appId} {...otherProps} />;
case "Apply": // 申请类
return <Apply
iframeUrlDiy={config.gateWayPort + `/portal/#/showApplyIframe?id=${appId}&hasSingle=false&token=${getToken()}`}
iframeHeight={200}
workId={appId}
{...otherProps}
/>;
case "Audit": // 审批类
return <Audit
workId={appId}
{...otherProps} />;
case "BatchAudit": // 批量审批
return <Audit
workId={appId}
{...otherProps} />;
case "Detail": // 详情
return <Detail
from={routerConfig?.from}
{...otherProps}
/>;
default:
console.log(component, "没有找到此组件");
return <div>暂无此功能</div>;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论