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

增加code 的显示

上级 d9100e52
......@@ -37,16 +37,21 @@ export default class Detail extends Component {
super(props);
const { state } = this.props.location;
let id = '';
if (state && state.record && state.record.id) {
const { record } = state;
id = record.id;
let code = '';
if (state && state.record) {
if (state.record.id) {
id = state.record.id;
}
if (state.record.code) {
code = state.record.code;
}
}
if (!id) {
id = getUrlInfo()?.id;
}
console.log(id);
this.state = {
id,
code,
showAll: props.from !== 'onestopApp2.0'
};
}
......@@ -58,8 +63,8 @@ export default class Detail extends Component {
if (event.data && event.data.indexOf && event.data.indexOf('iframeDetailHeight') > -1) {
const height = Number(event.data.split('-')[1]);
const dom = document.getElementById('detailIframeId');
if(dom){
document.getElementById('detailIframeId').height = height + 50;
if (dom) {
document.getElementById('detailIframeId').height = height + 50;
}
}
},
......@@ -75,10 +80,14 @@ export default class Detail extends Component {
render() {
const { from } = this.props;
const { id, showAll } = this.state;
const {
id,
showAll,
code,
} = this.state;
const url = config.onestopPC.split('/#/');
let showPrint = this.props.location?.state?.showPrint;
if(getIsGui_Jian() && !showPrint){
if (getIsGui_Jian() && !showPrint) {
// 27590 寝室调整管理-寝室调整申请,详情的打印预览按钮不见了210301080119-122617
// 贵建把打印预览显示出来
showPrint = true;
......@@ -88,12 +97,12 @@ export default class Detail extends Component {
iframeUrl = iframeUrl + '&showPrint=true';
}
if (from === 'onestopApp2.0') {
iframeUrl = config.gateWayPort + `/portal/#/showAuditIframe?id=${id}&hasSingle=false&token=${getToken()}&isPrint=false`;
iframeUrl = config.gateWayPort + `/portal/#/showAuditIframe?id=${id}&code=${code}&hasSingle=false&token=${getToken()}&isPrint=false`;
}
// iframeUrl = `http://localhost:8000/onestop/IframeForDetail?id=${id}&token=${getToken()}`;
// console.log(showPrint);
return (
<PageHeaderWrapper title=''>
<PageHeaderWrapper title="">
<Shell>
<div
style={{
......@@ -102,20 +111,21 @@ export default class Detail extends Component {
}}>
{showAll ? (
<ButtonDiy
name='返回'
className='defaultBlue'
name="返回"
className="defaultBlue"
handleClick={() => {
router.goBack();
}}
icon='arrow-left'
icon="arrow-left"
/>
) : null}
<ButtonDiy
name={'全屏查看'}
className='defaultBlue'
className="defaultBlue"
handleClick={() => {
document.getElementById('detailIframeId').requestFullscreen();
}} />
document.getElementById('detailIframeId')
.requestFullscreen();
}}/>
</div>
</Shell>
<Shell>
......@@ -124,12 +134,12 @@ export default class Detail extends Component {
<iframe
src={iframeUrl}
frameBorder={0}
id='detailIframeId'
name='applyIframe'
marginWidth='0'
marginHeight='0'
id="detailIframeId"
name="applyIframe"
marginWidth="0"
marginHeight="0"
onLoad={this.showAll}
allowtransparency='yes'
allowtransparency="yes"
seamless
scrolling={'no'}
style={{
......@@ -139,7 +149,10 @@ export default class Detail extends Component {
}}
/> :
<div id={'detailIframeId'}>
<DetailOneStop id={id} {...this.props} showPrint={showPrint || false}/>
<DetailOneStop id={id}
{...this.props}
code={code}
showPrint={showPrint || false}/>
</div>
}
......@@ -152,12 +165,12 @@ export default class Detail extends Component {
}}>
{showAll ? (
<ButtonDiy
name='返回'
className='defaultBlue'
name="返回"
className="defaultBlue"
handleClick={() => {
router.goBack();
}}
icon='arrow-left'
icon="arrow-left"
/>
) : null}
<ButtonDiy
......@@ -165,8 +178,9 @@ export default class Detail extends Component {
type={'primary'}
// className='primaryBlue'
handleClick={() => {
document.getElementById('detailIframeId').requestFullscreen();
}} />
document.getElementById('detailIframeId')
.requestFullscreen();
}}/>
</div>
</Shell>
</PageHeaderWrapper>
......
......@@ -144,7 +144,7 @@ class DetailSplit extends Component {
const code = this.props.history.location.state && this.props.history.location.state.code;
const queryId = this.props.history.location.query && this.props.history.location.query.id;
const taskId = this.props.history.location.state && this.props.history.location.state.taskId;
if (!id) {
if (!id && !code) {
if (queryId) {
} else {
openToast('error', '数据已过期', '当前页面数据已过期,请重新进入');
......
......@@ -3,64 +3,65 @@
* 2019年12月11日 17:30:41
* 查看详情页面的iframe嵌套到中医大里面
*/
import React, {Component} from 'react';
import React, { Component } from 'react';
import { setToken } from '@/webPublic/one_stop_public/utils/token';
import {getUrlInfo} from './utils';
import { getUrlInfo } from './utils';
import DetailSplit from './DetailSplit';
import styles from './styles.less';
import {getOneStopConfigList} from '@/webPublic/one_stop_public/publicServices';
import { getOneStopConfigList } from '@/webPublic/one_stop_public/publicServices';
export default class GetDetail extends Component {
constructor(props) {
super(props);
const token = getUrlInfo().token;
if(token && token.length > 10){
setToken(token);
}
getOneStopConfigList();
this.state = {
id: getUrlInfo().id || props.id,
constructor(props) {
super(props);
const token = getUrlInfo().token;
if (token && token.length > 10) {
setToken(token);
}
getOneStopConfigList();
this.state = {
id: getUrlInfo().id || props.id,
code: getUrlInfo().code || props.code,
};
}
};
}
componentDidMount() {}
componentDidMount() {
}
/***
* 需要加入跳转功能;
* 钟是志
* 在iframe中打开时 直接返回一个postMessage;
* */
/***
* 需要加入跳转功能;
* 钟是志
* 在iframe中打开时 直接返回一个postMessage;
* */
render() {
const {id} = this.state;
const {
detailInfoDivStyle = {
backgroundColor: '#FFFFFF',
overflow: 'auto',
height: '100%',
width: 'calc(100vw - 300px)',
padding: 0,
}
} = this.props;
let {location} = this.props.history;
location = {
...location,
state: {
id,
fromIframe: false,
},
};
return (
<div className={styles.detail_div}
id={'detailInfoDiv'}
style={detailInfoDivStyle}
>
<DetailSplit history={{...this.props.history, location}}
showPrint={this.props.showPrint || false}
/>
</div>
);
}
render() {
const { id, code } = this.state;
const {
detailInfoDivStyle = {
backgroundColor: '#FFFFFF',
overflow: 'auto',
height: '100%',
width: 'calc(100vw - 300px)',
padding: 0,
},
} = this.props;
let { location } = this.props.history;
location = {
...location,
state: {
id,
code,
fromIframe: false,
},
};
return (
<div className={styles.detail_div} id={'detailInfoDiv'} style={detailInfoDivStyle}>
<DetailSplit
history={{
...this.props.history,
location,
}}
showPrint={this.props.showPrint || false}
/>
</div>
);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论