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

2.0的页面嵌入到学工中

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