提交 1af81177 authored 作者: 钟是志's avatar 钟是志

27155 个人就业信息-求职创业补贴申报,申报和信息修改页面没有切换成功20192602004密bdk@2022*$

上级 05070ee4
...@@ -44,7 +44,7 @@ class AffairPage extends React.Component { ...@@ -44,7 +44,7 @@ class AffairPage extends React.Component {
searchCondition: [], searchCondition: [],
dataBaseId: '', dataBaseId: '',
addFields: [], // 新增时填写的字段。 addFields: [], // 新增时填写的字段。
renderIframe: true, renderIframe: false,
allConfigSetInfo: null, allConfigSetInfo: null,
}; };
} }
...@@ -190,59 +190,70 @@ class AffairPage extends React.Component { ...@@ -190,59 +190,70 @@ class AffairPage extends React.Component {
}); });
}; };
componentDidMount() {
if (!getToken()) {
message.error('您的数据未同步,请联系管理员!');
return false;
}
const { pathname } = this.state;
const { dataBaseId, workId, iframeHeight } = this.props;
if (dataBaseId || workId) {
this.setState(
{
workId,
dataBaseId,
},
() => {
this.getColumns();
},
);
} else {
service.getId(pathname).then((x) => {
this.setState(
{
workId: x.workId,
dataBaseId: x.dataBaseId,
},
() => {
this.getColumns();
},
);
});
}
window.addEventListener( initData = () => {
'message', if (!getToken()) {
(event) => { message.error('您的数据未同步,请联系管理员!');
if (event.data === 'returnList') { return false;
this.returnList(true); }
} const { pathname } = this.state;
if (event && event.data && event.data.indexOf && event.data.indexOf('iframeHeight') > -1) { const { dataBaseId, workId, iframeHeight } = this.props;
console.log(event.data); if (dataBaseId || workId) {
let height = Number(event.data.split('-')[1]); this.setState(
const iframe = document.getElementById('applyIframeId'); {
if (iframe) { workId,
iframe.height = height + (iframeHeight || 50); dataBaseId,
} },
} () => {
}, this.getColumns();
false, },
); );
} else {
service.getId(pathname).then((x) => {
this.setState(
{
workId: x.workId,
dataBaseId: x.dataBaseId,
},
() => {
this.getColumns();
},
);
});
}
window.addEventListener(
'message',
(event) => {
if (event.data === 'returnList') {
this.returnList(true);
}
if (event && event.data && event.data.indexOf && event.data.indexOf('iframeHeight') > -1) {
console.log(event.data);
let height = Number(event.data.split('-')[1]);
const iframe = document.getElementById('applyIframeId');
if (iframe) {
iframe.height = height + (iframeHeight || 50);
}
}
},
false,
);
return true;
}
return true; componentDidMount() {
this.initData();
} }
returnList = (needSearchList = false) => { componentDidUpdate(prevProps, prevState) {
if(prevProps.workId !== this.props.workId){
this.initData();
}
}
returnList = (needSearchList = false) => {
console.log(needSearchList); console.log(needSearchList);
const { workId } = this.state; const { workId } = this.state;
this.setState( this.setState(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论