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

发起页面修改

上级 1377d692
...@@ -10,7 +10,6 @@ import { getToken } from '@/utils/authority'; ...@@ -10,7 +10,6 @@ import { getToken } from '@/utils/authority';
import PageHeaderWrapper from '@/components/PageHeaderWrapper'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '@/baseComponent/Shell'; import Shell from '@/baseComponent/Shell';
// import config from '@/config/config';
import router from 'umi/router'; import router from 'umi/router';
import ApplyForZyd from '@/webPublic/one_stop_public/ForZydApply/index'; import ApplyForZyd from '@/webPublic/one_stop_public/ForZydApply/index';
...@@ -33,23 +32,23 @@ export default class AffairPage extends React.Component { ...@@ -33,23 +32,23 @@ export default class AffairPage extends React.Component {
message.error('您的数据未同步,请联系管理员!'); message.error('您的数据未同步,请联系管理员!');
return false; return false;
} }
window.addEventListener( // window.addEventListener(
'message', // 'message',
(event) => { // (event) => {
// 和Iframe页进行通迅 // // 和Iframe页进行通迅
if (event.data === 'returnList') { // if (event.data === 'returnList') {
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) {
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; // iframe.height = height;
} // }
} // }
}, // },
false, // false,
); // );
return true; return true;
} }
...@@ -63,11 +62,6 @@ export default class AffairPage extends React.Component { ...@@ -63,11 +62,6 @@ export default class AffairPage extends React.Component {
if (!workId) { if (!workId) {
return null; return null;
} }
// const url = config.onestopPC.split('/#/');
// const params = `id=${workId}&token=${getToken()}&init=${encodeURIComponent(
// JSON.stringify(init),
// )}`;
// let iframeUrl = `${url[0]}/#/IFrameForApply?${params}`;
return ( return (
<PageHeaderWrapper title=""> <PageHeaderWrapper title="">
<div <div
...@@ -94,6 +88,7 @@ export default class AffairPage extends React.Component { ...@@ -94,6 +88,7 @@ export default class AffairPage extends React.Component {
<ApplyForZyd <ApplyForZyd
{...this.props} {...this.props}
id={workId} id={workId}
returnList={this.returnList}
init={encodeURIComponent(JSON.stringify(init))} init={encodeURIComponent(JSON.stringify(init))}
/> />
{/* <iframe {/* <iframe
......
...@@ -135,7 +135,8 @@ class AffairPage extends React.Component { ...@@ -135,7 +135,8 @@ class AffairPage extends React.Component {
this.setState( this.setState(
{ {
showIframe: true, showIframe: true,
}, renderIframe: true,
},
() => {}, () => {},
); );
}, },
...@@ -244,7 +245,6 @@ class AffairPage extends React.Component { ...@@ -244,7 +245,6 @@ class AffairPage extends React.Component {
returnList = (needSearchList = false) => { returnList = (needSearchList = false) => {
console.log(needSearchList); console.log(needSearchList);
const { workId } = this.state; const { workId } = this.state;
this.setState( this.setState(
{ {
renderIframe: false, renderIframe: false,
...@@ -258,7 +258,6 @@ class AffairPage extends React.Component { ...@@ -258,7 +258,6 @@ class AffairPage extends React.Component {
} }
this.setState({ this.setState({
showIframe: false, showIframe: false,
renderIframe: true, // 重新挂载IFrame 保证申请数据不会再次显示出来
}); });
}, },
); );
...@@ -346,25 +345,9 @@ class AffairPage extends React.Component { ...@@ -346,25 +345,9 @@ class AffairPage extends React.Component {
/> : /> :
<ApplyForZyd <ApplyForZyd
{...this.props} {...this.props}
returnList={this.returnList}
id={workId} id={workId}
/> />
/* <iframe
src={iframeUrl}
frameBorder={0}
id="applyIframeId"
name="applyIframe"
marginWidth="0"
marginHeight="0"
allowtransparency="yes"
seamless
scrolling={'auto'}
style={{
width: '100%',
minHeight: '800px',
overflowY: 'hidden',
backgroundColor: '#fff',
}}
/>*/
) : null} ) : null}
</div> </div>
</PageHeaderWrapper> </PageHeaderWrapper>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* 2019年9月19日 * 2019年9月19日
* 事务发起提交多次弹框 * 事务发起提交多次弹框
*/ */
import React, {Component} from 'react' import React, {Component} from 'react';
import { getModal } from '@/webPublic/one_stop_public/utils/utils'; import { getModal } from '@/webPublic/one_stop_public/utils/utils';
const Modal = getModal(); const Modal = getModal();
...@@ -11,35 +11,11 @@ const Modal = getModal(); ...@@ -11,35 +11,11 @@ const Modal = getModal();
export default class AddModal extends Component { export default class AddModal extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {
top: 0,
}
}
componentDidMount() {
setTimeout(() => {
let dom = document.getElementById('tabsTableFromIframe');
if (dom && dom.offsetHeight) {
let height = dom.offsetHeight;
if (height > 700) {
this.setState({
top: height - 700,
})
}
// console.log(height, 'Iframe页面的高度');
}
}, 1500);
} }
render() { render() {
let {visible, handleCancel, handleOk, loading} = this.props; let {visible, handleCancel, handleOk, loading} = this.props;
const { top } = this.state;
const style = {
};
if(top){
style.top = top;
}
return ( return (
<Modal <Modal
title="提交申请" title="提交申请"
...@@ -48,7 +24,6 @@ export default class AddModal extends Component { ...@@ -48,7 +24,6 @@ export default class AddModal extends Component {
confirmLoading={loading} confirmLoading={loading}
onCancel={handleCancel} onCancel={handleCancel}
width={400} width={400}
style={style}
> >
<p style={{width: '100%', textAlign: 'center', fontSize: 14, color: '#666666'}}>确定要提交申请吗?</p> <p style={{width: '100%', textAlign: 'center', fontSize: 14, color: '#666666'}}>确定要提交申请吗?</p>
</Modal> </Modal>
......
...@@ -65,7 +65,7 @@ class SponsorForm extends Component { ...@@ -65,7 +65,7 @@ class SponsorForm extends Component {
/** /**
* 提交完成后用户提示 * 提交完成后用户提示
*/ */
info = () => { info = (applySubmitModalProps = undefined) => {
let top = this.countHeight(); let top = this.countHeight();
let style = {}; let style = {};
if (top) { if (top) {
...@@ -73,8 +73,9 @@ class SponsorForm extends Component { ...@@ -73,8 +73,9 @@ class SponsorForm extends Component {
top: 10, top: 10,
}; };
} }
let method = applySubmitModalProps && applySubmitModalProps.method ? applySubmitModalProps.method : 'info'; // 从流程发起回调里面拿配置项
Modal.info({ let config = (applySubmitModalProps && applySubmitModalProps.config) || {};
Modal[method]({
title: '提交申请', title: '提交申请',
centered: true, centered: true,
style, style,
...@@ -92,18 +93,20 @@ class SponsorForm extends Component { ...@@ -92,18 +93,20 @@ class SponsorForm extends Component {
</p> </p>
</div> </div>
), ),
okText: '确定', okText: '确定',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.setState({ this.setState({
disabled: true, disabled: true,
}); });
router.goBack(); if(this.props.returnList){
this.props.returnList(true);
}
resolve(true); resolve(true);
return true; return true;
}); });
}, },
...config,
}); });
}; };
/** /**
...@@ -226,12 +229,15 @@ class SponsorForm extends Component { ...@@ -226,12 +229,15 @@ class SponsorForm extends Component {
if (!resParams) { if (!resParams) {
return false; return false;
} }
let applySubmitModalProps = resParams?.applySubmitModalProps || undefined;
delete resParams.applySubmitModalProps;
message.info('正在提交申请,请等待');
dispatch({ dispatch({
type: 'affair/startProcess', type: 'affair/startProcess',
payload: resParams, payload: resParams,
callback: val => { callback: val => {
if (val) { if (val) {
this.info(); this.info(applySubmitModalProps);
} else { } else {
openToast('error', '保存失败', '请尝试'); openToast('error', '保存失败', '请尝试');
} }
......
...@@ -91,7 +91,7 @@ export default class IframeForApply extends React.Component { ...@@ -91,7 +91,7 @@ export default class IframeForApply extends React.Component {
noNeedApply, noNeedApply,
noNeedTitle, noNeedTitle,
} = this.state; } = this.state;
const { modileHome } = this.props; const { modileHome, returnList } = this.props;
return ( return (
<div <div
className={names('warp IframeDiy')} className={names('warp IframeDiy')}
...@@ -115,6 +115,7 @@ export default class IframeForApply extends React.Component { ...@@ -115,6 +115,7 @@ export default class IframeForApply extends React.Component {
<SponsorForm <SponsorForm
id={id} id={id}
setRadio={this.setRadio} setRadio={this.setRadio}
returnList={returnList}
radioValue={value} radioValue={value}
noNeedApplyButton={noNeedApply} noNeedApplyButton={noNeedApply}
init={init} // 表单的初始化数据 用于发起时传入默认值 init={init} // 表单的初始化数据 用于发起时传入默认值
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论