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

增加code 的显示

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