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

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

上级 05070ee4
......@@ -44,7 +44,7 @@ class AffairPage extends React.Component {
searchCondition: [],
dataBaseId: '',
addFields: [], // 新增时填写的字段。
renderIframe: true,
renderIframe: false,
allConfigSetInfo: null,
};
}
......@@ -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(
'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,
);
initData = () => {
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(
'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);
const { workId } = this.state;
this.setState(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论