提交 543986fb authored 作者: 钟是志's avatar 钟是志

bug修改

上级 b2e5d127
...@@ -257,6 +257,12 @@ export default class List extends Component { ...@@ -257,6 +257,12 @@ export default class List extends Component {
} }
if(columnsLength > 10 && item.title && !item.width){ if(columnsLength > 10 && item.title && !item.width){
item.width = item.title.length * 30; item.width = item.title.length * 30;
if(item.title === '学号'){
item.width = 140;
}
if(item.title.indexOf('时间') > -1){
item.width = 150;
}
} }
} }
......
...@@ -9,7 +9,7 @@ import { message } from 'antd'; ...@@ -9,7 +9,7 @@ import { message } from 'antd';
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import * as service from '../publicApiService'; import * as service from '../publicApiService';
import * as destructionFunc from '../destruction'; import * as destructionFunc from '../destruction';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import { getApplyPage } from '../publicApiService'; import { getApplyPage } from '../publicApiService';
import { getToken } from '@/utils/authority'; import { getToken } from '@/utils/authority';
...@@ -35,6 +35,7 @@ export default class AffairPage extends React.Component { ...@@ -35,6 +35,7 @@ export default class AffairPage extends React.Component {
searchCondition: [], searchCondition: [],
dataBaseId: idObj.dataBaseId, dataBaseId: idObj.dataBaseId,
addFields: [], // 新增时填写的字段。 addFields: [], // 新增时填写的字段。
renderIframe: true,
}; };
}; };
...@@ -138,11 +139,7 @@ export default class AffairPage extends React.Component { ...@@ -138,11 +139,7 @@ export default class AffairPage extends React.Component {
window.addEventListener('message', (event) => { window.addEventListener('message', (event) => {
if (event.data === 'returnList') { if (event.data === 'returnList') {
this.setState({ this.returnList(true);
showIframe: false,
}, () => {
this.ListComponent.getPage();
});
} }
if (event.data.indexOf('iframeHeight') > -1) { if (event.data.indexOf('iframeHeight') > -1) {
let height = Number(event.data.split('-')[1]); let height = Number(event.data.split('-')[1]);
...@@ -153,11 +150,25 @@ export default class AffairPage extends React.Component { ...@@ -153,11 +150,25 @@ export default class AffairPage extends React.Component {
return true; return true;
} }
returnList = (needSearchList = false) => {
this.setState({
renderIframe: false,
},()=>{
if(needSearchList){
this.ListComponent.getPage();
}
this.setState({
showIframe: false,
renderIframe: true, // 重新挂载IFrame 保证申请数据不会再次显示出来
});
});
};
render() { render() {
const { workId, dataBaseId, addFields, showIframe } = this.state; const { workId, dataBaseId, addFields, showIframe, renderIframe } = this.state;
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()}`;
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getHuanGeToken()}`; // iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getToken()}`;
return ( return (
<PageHeaderWrapper title=""> <PageHeaderWrapper title="">
<div style={{ <div style={{
...@@ -186,31 +197,31 @@ export default class AffairPage extends React.Component { ...@@ -186,31 +197,31 @@ export default class AffairPage extends React.Component {
}}> }}>
<ButtonDiy name="返回" <ButtonDiy name="返回"
className="defaultBlue" className="defaultBlue"
handleClick={() => { handleClick={this.returnList}
this.setState({
showIframe: false,
});
}}
icon="arrow-left" icon="arrow-left"
/> />
</div> </div>
</Shell> </Shell>
<iframe src={iframeUrl} {
frameBorder={0} renderIframe ?
id='applyIframeId' <iframe src={iframeUrl}
name='applyIframe' frameBorder={0}
marginWidth="0" id='applyIframeId'
marginHeight="0" name='applyIframe'
allowTransparency="yes" marginWidth="0"
seamless marginHeight="0"
scrolling={'no'} allowTransparency="yes"
style={{ seamless
width: '100%', scrolling={'no'}
minHeight: '800px', style={{
overflowY: 'hidden', width: '100%',
backgroundColor: '#fff', minHeight: '800px',
}} overflowY: 'hidden',
/> backgroundColor: '#fff',
}}
/> : null
}
</div> </div>
</PageHeaderWrapper> </PageHeaderWrapper>
); );
......
...@@ -311,6 +311,12 @@ export default class List extends Component { ...@@ -311,6 +311,12 @@ export default class List extends Component {
if(columnsLength > 10 && item.title && !item.width){ if(columnsLength > 10 && item.title && !item.width){
item.width = item.title.length * 30; item.width = item.title.length * 30;
if(item.title === '学号'){
item.width = 140;
}
if(item.title.indexOf('时间') > -1){
item.width = 150;
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论