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

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

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