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

25020 流程审核时弹窗优化

上级 d9cecbce
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
*/ */
import React, {Component} from 'react'; import React, {Component} from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import styles from './index.less';
import { getModal } from '@/webPublic/one_stop_public/utils/utils'; import { getModal } from '@/webPublic/one_stop_public/utils/utils';
import stylesList from '@/webPublic/one_stop_public/AffairButton/AuditButton/Modal/stylesList';
const Modal = getModal(); const Modal = getModal();
...@@ -60,10 +60,11 @@ export default class WebModal extends Component { ...@@ -60,10 +60,11 @@ export default class WebModal extends Component {
width={!!width ? width : 800} width={!!width ? width : 800}
handleCancel={handleCancel} handleCancel={handleCancel}
style={style}> style={style}>
<div className={styles.content_div}> <div style={stylesList.content_div}>
<div className={styles.title}> <div style={stylesList.title}>
{title} {title}
<Button className={styles.button} onClick={handleCancel}> <Button style={stylesList.button}
onClick={handleCancel}>
X X
</Button> </Button>
</div> </div>
......
const stylesList = {
content_div: {
margin: '-24px',
position: 'relative',
},
title: {
color: '#333',
fontSize: '16px',
fontWeight: 'bold',
width: '100%',
lineHeight: '44px',
textAlign: 'center',
backgroundColor: '#E0E7EE',
},
button: {
backgroundColor: 'rgba(255, 255, 255, 0)',
border: '0 solid #cccccc',
float: 'right',
marginTop: '5px',
},
};
export default stylesList;
const styleList = {
btn_page: {
width: '100%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexWrap: 'wrap',
},
btn: {
minWidth: '90px',
minHeight: '32px',
borderRadius: '2px',
},
btn_margin: {
marginRight: '16px',
},
btn_no: {
color: '#FF5350',
border: '1px solid #FF5350',
},
btn_reject: {
color: '#FF9B00',
border: '1px solid #FF9B00',
},
};
export default styleList;
...@@ -9,7 +9,7 @@ import { Input, Checkbox } from 'antd'; ...@@ -9,7 +9,7 @@ import { Input, Checkbox } from 'antd';
import Btn from '../pagesBtn'; import Btn from '../pagesBtn';
import MyModal from '../Modal'; import MyModal from '../Modal';
import styles from './styles.less'; import styles from './styles.less';
import stylesList from './styles-in-line';
const { TextArea } = Input; const { TextArea } = Input;
export default class userButton extends Component { export default class userButton extends Component {
constructor() { constructor() {
...@@ -171,13 +171,17 @@ export default class userButton extends Component { ...@@ -171,13 +171,17 @@ export default class userButton extends Component {
title={isSecond ? '重新发起' : '审批'} title={isSecond ? '重新发起' : '审批'}
width={600} width={600}
handleCancel={this.handleCancelOk}> handleCancel={this.handleCancelOk}>
<div className={styles.is_ok}> <div style={stylesList.is_ok}>
<p className={styles.header}> <p style={stylesList.header}>
<span>{isSecond ? '当前状态' : '审批结果'}</span> <span style={{...stylesList.headerSpan, ...stylesList.headerSpan_1}}>
{isSecond ? '当前状态' : '审批结果'}
</span>
{this.getUser()} {this.getUser()}
</p> </p>
<div className={styles.body}> <div style={stylesList.body}>
<span>{isSecond ? '发起说明' : '审批说明'}</span> <span style={{...stylesList.body_span, ...stylesList.body_span_1}}>
{isSecond ? '发起说明' : '审批说明'}
</span>
<span> <span>
<TextArea <TextArea
value={value} value={value}
...@@ -188,9 +192,11 @@ export default class userButton extends Component { ...@@ -188,9 +192,11 @@ export default class userButton extends Component {
</span> </span>
</div> </div>
{Sign ? ( {Sign ? (
<div className={styles.body}> <div style={stylesList.body}>
<span>使用签名</span> <span style={{...stylesList.body_span, ...stylesList.body_span_1}}>
<span> 使用签名
</span>
<span style={{...stylesList.body_span}}>
<Checkbox defaultChecked={user.isUseBackImage} onChange={this.onChange1} /> <Checkbox defaultChecked={user.isUseBackImage} onChange={this.onChange1} />
</span> </span>
</div> </div>
......
const styles = {
is_ok: {
minHeight: '336px',
boxSizing: 'border-box',
padding: '60px 81px 0px 59px',
overflow: 'hidden',
},
header: {
marginBottom: '23px',
},
headerSpan: {
fontSize: '14px',
lineHeight: '24px',
},
headerSpan_1: {
color: '#666',
textAlign: 'right',
marginRight: '24px',
},
headerSpan_2: {
fontWeight: 'bold',
},
body: {
display: 'flex',
marginBottom: '60px',
},
body_span: {
fontSize: '14px',
lineHeight: '24px',
color: '#666',
},
body_span_1: {
textAlign: 'right',
marginRight: '24px',
},
};
export default styles;
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
import React, {Component} from 'react'; import React, {Component} from 'react';
import {checkIsImage} from '@/webPublic/one_stop_public/libs/UploadCom'; import {checkIsImage} from '@/webPublic/one_stop_public/libs/UploadCom';
import { getModal, getPopconfirm } from '@/webPublic/one_stop_public/utils/utils'; import { getModal, getPopconfirm, isFromIframe } from '@/webPublic/one_stop_public/utils/utils';
const FileViewer = CLIENT_TYPE === 'mobile' ? null : require('react-file-viewer'); const FileViewer = CLIENT_TYPE === 'mobile' ? null : require('react-file-viewer');
const Modal = getModal(); const Modal = getModal();
...@@ -20,7 +20,7 @@ export default class index extends Component { ...@@ -20,7 +20,7 @@ export default class index extends Component {
} }
showModal = () => { showModal = () => {
if(window?.parent?.iframeParentComponent){ if(isFromIframe()){
return false; return false;
} }
this.setState({ this.setState({
...@@ -81,7 +81,7 @@ export default class index extends Component { ...@@ -81,7 +81,7 @@ export default class index extends Component {
okText='下载' okText='下载'
onCancel={this.showModal} onCancel={this.showModal}
cancelText={ window?.parent?.iframeParentComponent ? '取消' : '预览'}> cancelText={ isFromIframe() ? '取消' : '预览'}>
{isImg ? ( {isImg ? (
<img <img
ref={(node)=>{ this.imageDom = node;}} ref={(node)=>{ this.imageDom = node;}}
......
import React from "react"; import React from "react";
import {queryApiActionPath} from "@/webPublic/one_stop_public/utils/queryConfig"; import {queryApiActionPath} from "@/webPublic/one_stop_public/utils/queryConfig";
import {getToken} from "@/webPublic/one_stop_public/utils/token"; import {getToken} from "@/webPublic/one_stop_public/utils/token";
import { isFromIframe } from '@/webPublic/one_stop_public/utils/utils';
const oneSetItemP = { const oneSetItemP = {
marginBottom: 0, marginBottom: 0,
...@@ -51,7 +52,7 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => { ...@@ -51,7 +52,7 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => {
export const dragEventList = (setOtherProps, otherProps) => { export const dragEventList = (setOtherProps, otherProps) => {
let draggedRef = null; let draggedRef = null;
let documentThis = window?.parent?.iframeParentComponent?.Modal ? window?.parent?.document : document; let documentThis = isFromIframe() ? window?.parent?.document : document;
documentThis.onmousedown = function(evt){ documentThis.onmousedown = function(evt){
startX = evt.offsetX; startX = evt.offsetX;
startY = evt.offsetY; startY = evt.offsetY;
......
...@@ -34,26 +34,18 @@ export const dispatch = (type, payload, callback) => { ...@@ -34,26 +34,18 @@ export const dispatch = (type, payload, callback) => {
}; };
export const isFromIframe = () => { // 判断是否来自iframe 嵌入页面
return !!window?.parent?.iframeParentComponent?.Modal;
}
export const getModal = () => { export const getModal = () => {
if (window?.parent?.iframeParentComponent?.Modal) { return isFromIframe() ? window?.parent?.iframeParentComponent?.Modal : Modal;
return window?.parent?.iframeParentComponent?.Modal;
} else {
return Modal;
}
}; };
export const getPopconfirm = () => { export const getPopconfirm = () => {
if (window?.parent?.iframeParentComponent?.Popconfirm) { return isFromIframe() ? window?.parent?.iframeParentComponent?.Popconfirm : Popconfirm;
return window?.parent?.iframeParentComponent?.Popconfirm;
} else {
return Popconfirm;
}
}; };
export const getMessage = () => { export const getMessage = () => {
if (window?.parent?.iframeParentComponent?.Popconfirm) { return isFromIframe() ? window?.parent?.iframeParentComponent?.message : message;
return window?.parent?.iframeParentComponent?.message;
} else {
return message;
}
}; };
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论