提交 20e9aea3 authored 作者: 钟是志's avatar 钟是志
上级 ea5d3583
......@@ -13,6 +13,13 @@ import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16
import SelectModal from '@/webPublic/one_stop_public/App/ExportCurrentInfo/SelectModal';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
const getFileName = (fileName = '导出文件', ext = 'xlsx') => {
fileName = fileName.replaceAll('.', '');
ext = ext.replaceAll('.', '');
return fileName + '.' + ext;
}
/**
*
* 2019/02/21 修改导出方式为fetch
......@@ -95,8 +102,7 @@ export default class ExportCurrentInfo extends React.Component {
if (data instanceof Blob) {
let a = document.createElement('a');
let url = window.URL.createObjectURL(data);
let filename =
(this.props.fileName ? this.props.fileName + '.' : '导出文件.') + (this.props.ext || 'xlsx');
let filename = getFileName(this.props.fileName, this.props.ext);
a.href = url;
a.download = filename;
a.click();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论