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

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

上级 818f8e38
...@@ -38,7 +38,11 @@ export default class index extends Component { ...@@ -38,7 +38,11 @@ export default class index extends Component {
}; };
download = () => { download = () => {
let {path, pathName} = this.props; let {path, pathName} = this.props;
window.open(path, '_blank'); if(window?.parent?.open && typeof window.parent.open === 'function'){
window.parent.open(path, '_blank');
}else{
window.open(path, '_blank');
}
}; };
render() { render() {
...@@ -71,8 +75,9 @@ export default class index extends Component { ...@@ -71,8 +75,9 @@ export default class index extends Component {
<Popconfirm <Popconfirm
title='该附件支持预览,是否预览?' title='该附件支持预览,是否预览?'
onConfirm={this.download} onConfirm={this.download}
onCancel={this.showModal}
okText='下载' okText='下载'
onCancel={this.showModal}
cancelText='预览'> cancelText='预览'>
{isImg ? ( {isImg ? (
<img <img
...@@ -119,7 +124,7 @@ export default class index extends Component { ...@@ -119,7 +124,7 @@ export default class index extends Component {
height: 650, height: 650,
maxWidth: 1200, maxWidth: 1200,
}}> }}>
<a target={'_blank'} href={path} download={pathName}> <a onClick={this.download}>
下载文件 下载文件
</a> </a>
{FileViewer && ( {FileViewer && (
......
...@@ -89,7 +89,6 @@ export default function PictureSignature({ ...@@ -89,7 +89,6 @@ export default function PictureSignature({
let func = new Function(json.otherProps); let func = new Function(json.otherProps);
let otherPropsX = func(); let otherPropsX = func();
setOtherProps(otherPropsX); setOtherProps(otherPropsX);
console.log(otherPropsX);
} catch (e) { } catch (e) {
console.log('签章组件 其余配置项出错,没有返回一个正确的值'); console.log('签章组件 其余配置项出错,没有返回一个正确的值');
return false; return false;
......
...@@ -275,6 +275,7 @@ export function diGuiTree(treeData = [], i = 0) { ...@@ -275,6 +275,7 @@ export function diGuiTree(treeData = [], i = 0) {
* 本地开发可能会存在跨域问题 * 本地开发可能会存在跨域问题
* */ * */
export function downloadFile(url, params, fileName = "导出文件", ext = "xlsx", method = 'POST') { export function downloadFile(url, params, fileName = "导出文件", ext = "xlsx", method = 'POST') {
console.log(arguments);
fetch(url, { fetch(url, {
method, method,
body: method === 'GET' ? undefined : FormdataWrapper(params), body: method === 'GET' ? undefined : FormdataWrapper(params),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论