<Button
type=“primary”
onClick={async RepeatClickHandler => {
if (tableArr.length > 0) {
const paramsExport = JSON.parse(JSON.stringify(query));
paramsExport.withAA = true;
delete paramsExport.page;
delete paramsExport.size;
RepeatClickHandler(false);
await vehicleStatusDownload(paramsExport);
const hide = message.loading(F({ id: ‘data.newStatus.Downloading’ }), 0);
const getDownloadAsync = new Promise(resolve => {
const loop = () => {
getVehicleDownload({
serviceModel: ‘vehiclegroupAnalisys’,
}).then(res => {
if (res.sub_code && res.sub_code === ‘05200001’) {
setTimeout(() => {
loop();
}, 500);
} else if (res.success) {
resolve(res.data);
}
});
};
loop();
});
// 轮训
getDownloadAsync.then(res => {
const a = document.createElement('a');
const href = '/pdfserver/' + res.split('.com/')[1];
a.href = href;
a.download = F({ id: 'chartStatistics.vehicle-upgrade-status' });
hide();
RepeatClickHandler(true);
a.click();
});
} else {
notification.warning({
message: F({ id: 'vehicle.operation.record.data.no' }),
});
}
}}
>
{F({ id: 'menu.log-management.user-action-log.export' })}
</Button>**加粗样式**