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

发起页面修改

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