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

iframe页面的Modal 直接从父级获取

上级 abd61200
......@@ -4,9 +4,11 @@
* Modal定制样式
*/
import React, {Component} from 'react';
import {Modal, Button} from 'antd';
import { Button } from 'antd';
import styles from './index.less';
import { getModal } from '@/webPublic/one_stop_public/utils/utils';
const Modal = getModal();
export default class WebModal extends Component {
constructor(props) {
......
......@@ -4,7 +4,9 @@
* 事务发起提交多次弹框
*/
import React, { Component } from 'react';
import { Modal, Button } from 'antd';
import { getModal } from '@/webPublic/one_stop_public/utils/utils';
const Modal = getModal();
export default class AddModal extends Component {
render() {
let { visible, handleCancel, handleOk, loading } = this.props;
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './styles.less';
import { Modal, Button, Icon, message } from 'antd';
import { Button, Icon, message } from 'antd';
import ShowItem, { dragEventList, zipImage } from './ShowItem';
import { apiRequest } from '../../utils/request';
import { deepCopy } from '@/webPublic/one_stop_public/utils/myutils';
import { getModal } from '@/webPublic/one_stop_public/utils/utils';
const Modal = getModal();
let fakeFileInfo = {
path: '/u/202112/25143111x0ki.jpg', // 超大的图片
......
......@@ -26,14 +26,18 @@ const isAntDesignProOrDev = () => {
export { isAntDesignProOrDev, isAntDesignPro, isUrl };
export const dispatch = (type, payload, callback) => {
window.g_app._store.dispatch({ type, payload, callback });
window.g_app._store.dispatch({
type,
payload,
callback,
});
};
export const getModal = () =>{
if(window?.parent?.iframeParentComponent?.Modal){
export const getModal = () => {
if (window?.parent?.iframeParentComponent?.Modal) {
return window?.parent?.iframeParentComponent?.Modal;
}else{
} else {
return Modal;
}
}
};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论