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

增加签章组件

上级 5b66f912
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal, Button } from 'antd'; import { Modal, Button } from 'antd';
import styles from './index.less'; import styles from './index.less';
import {getContainer} from "@/webPublic/one_stop_public/utils/utils";
export default class WebModal extends Component { export default class WebModal extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -48,6 +49,7 @@ export default class WebModal extends Component { ...@@ -48,6 +49,7 @@ export default class WebModal extends Component {
closable={false} closable={false}
visible={visible} visible={visible}
footer={null} footer={null}
getContainer={getContainer}
destroyOnClose={true} destroyOnClose={true}
width={!!width ? width : 800} width={!!width ? width : 800}
handleCancel={handleCancel} handleCancel={handleCancel}
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Modal, Popconfirm} from 'antd'; import {Modal, Popconfirm} from 'antd';
import {checkIsImage} from '@/webPublic/one_stop_public/libs/UploadCom'; import {checkIsImage} from '@/webPublic/one_stop_public/libs/UploadCom';
import {getContainer} 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');
...@@ -95,7 +96,7 @@ export default class index extends Component { ...@@ -95,7 +96,7 @@ export default class index extends Component {
visible={visible} visible={visible}
width={1200} width={1200}
destroyOnClose destroyOnClose
getContainer={false} getContainer={getContainer}
centered={true} centered={true}
onOk={this.handleOk} onOk={this.handleOk}
onCancel={this.handleCancel}> onCancel={this.handleCancel}>
......
...@@ -3,6 +3,7 @@ import styles from './styles.less'; ...@@ -3,6 +3,7 @@ import styles from './styles.less';
import { Modal, Button, Icon } from 'antd'; import { Modal, Button, Icon } from 'antd';
import ShowItem, { dragEventList } from './ShowItem'; import ShowItem, { dragEventList } from './ShowItem';
import { apiRequest } from "../../utils/request"; import { apiRequest } from "../../utils/request";
import {getContainer} from "../../utils/utils";
let fakeFileInfo = { let fakeFileInfo = {
path: '/u/202112/09145847wsz2.jpg', path: '/u/202112/09145847wsz2.jpg',
...@@ -18,6 +19,7 @@ export default function PictureSignature({ ...@@ -18,6 +19,7 @@ export default function PictureSignature({
openEdit = true, openEdit = true,
}) { }) {
let fileInfo = fakeFileInfo; let fileInfo = fakeFileInfo;
let imageRef = useRef();
const [showModal, setShowModal] = useState(false); const [showModal, setShowModal] = useState(false);
const [otherProps, setOtherProps] = useState({}); const [otherProps, setOtherProps] = useState({});
const [imageInfo, setImageInfo] = useState({ const [imageInfo, setImageInfo] = useState({
...@@ -94,6 +96,7 @@ export default function PictureSignature({ ...@@ -94,6 +96,7 @@ export default function PictureSignature({
{fileInfo && fileInfo?.path && ( {fileInfo && fileInfo?.path && (
<img <img
className={styles.onePic} className={styles.onePic}
ref={imageRef}
src={basicUrl + fileInfo?.path} src={basicUrl + fileInfo?.path}
alt={fileInfo.name} alt={fileInfo.name}
onClick={changeShowModal} onClick={changeShowModal}
...@@ -105,12 +108,13 @@ export default function PictureSignature({ ...@@ -105,12 +108,13 @@ export default function PictureSignature({
destroyOnClose={true} destroyOnClose={true}
maskClosable={false} maskClosable={false}
onCancel={changeShowModal} onCancel={changeShowModal}
getContainer={getContainer}
className={styles.ModalClass} className={styles.ModalClass}
footer={<Footer />} footer={<Footer />}
title={'图片签章'} title={'图片签章'}
width={'90vw'} width={'90vw'}
bodyStyle={{ bodyStyle={{
minHeight: '80vh', minHeight: '800px',
overflow: 'auto', overflow: 'auto',
}} }}
{...ModalProps} {...ModalProps}
......
...@@ -4,6 +4,7 @@ import {queryApiActionPath} from '../utils/queryConfig'; ...@@ -4,6 +4,7 @@ import {queryApiActionPath} from '../utils/queryConfig';
import config from '@/webPublic/one_stop_public/config'; import config from '@/webPublic/one_stop_public/config';
import styles from './style.less'; import styles from './style.less';
import UploadComDiyForQnZy from '@/webPublic/one_stop_public/libs/UploadComDiyForQnZy'; import UploadComDiyForQnZy from '@/webPublic/one_stop_public/libs/UploadComDiyForQnZy';
import {getContainer} from "@/webPublic/one_stop_public/utils/utils";
export function checkIsImage(path) { export function checkIsImage(path) {
if (!path) { if (!path) {
...@@ -224,6 +225,7 @@ class UploadCom extends React.Component { ...@@ -224,6 +225,7 @@ class UploadCom extends React.Component {
<Modal <Modal
visible={previewVisible} visible={previewVisible}
footer={null} footer={null}
getContainer={getContainer}
onCancel={() => this.setState({previewVisible: false})} onCancel={() => this.setState({previewVisible: false})}
width={'90vw'} width={'90vw'}
> >
......
...@@ -26,3 +26,11 @@ export { isAntDesignProOrDev, isAntDesignPro, isUrl }; ...@@ -26,3 +26,11 @@ export { isAntDesignProOrDev, isAntDesignPro, isUrl };
export const dispatch = (type, payload, callback) => { export const dispatch = (type, payload, callback) => {
window.g_app._store.dispatch({ type, payload, callback }); window.g_app._store.dispatch({ type, payload, callback });
}; };
export const getContainer = () => {
if(window.location.href.indexOf('localhost') > -1) {
return document.body;
}else{
return window.parent?.document?.body || document.body;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论