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

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

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