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

导出的搜索条件 不能传空对象字符串

上级 cfc0faf3
......@@ -8,48 +8,50 @@ import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { giveBase16EnCode } from '@/webPublic/one_stop_public/Base16';
export default function exportHandledInfo({
columns = [],
appId = '1492048888356405248',
type = 'handled',
searcherKeyValue = {},
}) {
const headers = columns.filter((g) => {
return g.dataIndex !== 'operationDiy';
})
.map((g) => {
if (g.title === '流程审核状态') {
return {
key: 'formStatusName',
title: g.title,
};
}
return {
key: g.dataIndex,
title: g.title,
};
});
const data = {
appId,
type,
headers: JSON.stringify(headers),
searcherKeyValue,
token: getToken(),
};
if (appId) {
message.info('正在导出文件,请耐心等待');
let url = window.CONFIG.OAUTH_ACTION_PATH + '/UnifiedAppFormApi/exportData';
giveBase16EnCode(data, url)
.then((newData) => {
console.log('newData', newData);
if (typeof newData === 'object' && newData.url && newData.datas) {
// newData.datas.rbin = true;
newData.datas.token = getToken();
return downloadFile(newData.url, newData.datas);
}else{
return downloadFile(url, newData);
}
// downloadFile(url, data);
});
}
columns = [],
appId = '1492048888356405248',
type = 'handled',
searcherKeyValue = '{}',
}) {
const headers = columns
.filter((g) => {
return g.dataIndex !== 'operationDiy';
})
.map((g) => {
if (g.title === '流程审核状态') {
return {
key: 'formStatusName',
title: g.title,
};
}
return {
key: g.dataIndex,
title: g.title,
};
});
const data = {
appId,
type,
headers: JSON.stringify(headers),
searcherKeyValue,
token: getToken(),
};
if (data.searcherKeyValue === "{}") {
delete data.searcherKeyValue;
}
if (appId) {
message.info('正在导出文件,请耐心等待');
let url = window.CONFIG.OAUTH_ACTION_PATH + '/UnifiedAppFormApi/exportData';
giveBase16EnCode(data, url).then((newData) => {
console.log('newData', newData);
if (typeof newData === 'object' && newData.url && newData.datas) {
// newData.datas.rbin = true;
newData.datas.token = getToken();
return downloadFile(newData.url, newData.datas);
} else {
return downloadFile(url, newData);
}
// downloadFile(url, data);
});
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论