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

增加签章组件

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