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

流程发起按钮修改 显示条件 通过 isCloseStart 判断

上级 92a611a6
......@@ -19,6 +19,7 @@ import pageSetting from './pageSetting';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '@/baseComponent/Shell';
import config from '@/config/config';
import { deepCopy } from '@/webPublic/zyd_public/utils/utils';
export default function index(props) {
const { state = {} } = props.location;
......@@ -43,6 +44,7 @@ class AffairPage extends React.Component {
dataBaseId: '',
addFields: [], // 新增时填写的字段。
renderIframe: true,
allConfigSetInfo: null,
};
}
......@@ -105,9 +107,26 @@ class AffairPage extends React.Component {
handleButtonSet = () => {
const { canApply, otherButtons = [] } = this.props;
if (canApply === false) {
const { allConfigSetInfo } = this.state;
if (!allConfigSetInfo) {
return [];
}
const isCloseStart = allConfigSetInfo?.isCloseStart;
// if(isCloseStart){
// setTimeout(()=>{
// this.setState({
// allConfigSetInfo: {
// ...allConfigSetInfo,
// isCloseStart: false,
// },
// });
// }, 3000);
// }
if (canApply === false || isCloseStart) {
return [...otherButtons];
}
return [
{
type: 'add',
......@@ -118,7 +137,8 @@ class AffairPage extends React.Component {
{
showIframe: true,
},
() => {},
() => {
},
);
},
},
......@@ -220,6 +240,9 @@ class AffairPage extends React.Component {
}
returnList = (needSearchList = false) => {
console.log(needSearchList);
const { workId } = this.state;
this.setState(
{
renderIframe: false,
......@@ -227,6 +250,9 @@ class AffairPage extends React.Component {
() => {
if (needSearchList) {
this.ListComponent.getPage();
setTimeout(() => {
this.getFormDetail(workId);
}, 2000);
}
this.setState({
showIframe: false,
......@@ -237,23 +263,30 @@ class AffairPage extends React.Component {
};
render() {
const { workId, dataBaseId, addFields, showIframe, renderIframe } = this.state;
if (!workId) {
const { workId, dataBaseId, addFields, showIframe, renderIframe, allConfigSetInfo } = this.state;
if (!workId || !allConfigSetInfo) {
return null;
}
console.log(allConfigSetInfo.isCloseStart);
const url = config.onestopPC.split('/#/');
let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getToken()}`;
console.log(iframeUrl);
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getToken()}`;
let buttons = this.handleButtonSet({});
let listConfig = pageSetting.listConfig;
if (!buttons.length) {
listConfig = deepCopy(listConfig);
listConfig.buttonArea = false;
}
return (
<PageHeaderWrapper title="">
<PageHeaderWrapper title=''>
<div
style={{
display: showIframe ? 'none' : 'block',
}}>
<List
listConfig={pageSetting.listConfig}
pageButton={this.handleButtonSet({})}
listConfig={listConfig}
pageButton={buttons}
pageSearch={this.handleSearchSet({})}
addFields={addFields}
ref={(ListComponent) => (this.ListComponent = ListComponent)}
......@@ -276,10 +309,10 @@ class AffairPage extends React.Component {
display: showIframe ? 'block' : 'none',
}}>
<ButtonDiy
name="返回"
className="defaultBlue"
name='返回'
className='defaultBlue'
handleClick={this.returnList}
icon="arrow-left"
icon='arrow-left'
/>
</div>
</Shell>
......@@ -287,11 +320,11 @@ class AffairPage extends React.Component {
<iframe
src={iframeUrl}
frameBorder={0}
id="applyIframeId"
name="applyIframe"
marginWidth="0"
marginHeight="0"
allowtransparency="yes"
id='applyIframeId'
name='applyIframe'
marginWidth='0'
marginHeight='0'
allowtransparency='yes'
seamless
scrolling={'auto'}
style={{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论