|
@@ -166,19 +166,19 @@
|
|
|
await userStaticsApi(searchInfo);
|
|
|
});
|
|
|
async function handleExport() {
|
|
|
- await companyChatExportApi(searchInfo);
|
|
|
- // const downloadBlob = new Blob([data], {
|
|
|
- // type: 'text/csv',
|
|
|
- // });
|
|
|
- // const url = URL.createObjectURL(downloadBlob);
|
|
|
- // const a: HTMLAnchorElement = document.createElement('a');
|
|
|
- // document.body.appendChild(a);
|
|
|
- // a.style.display = 'none';
|
|
|
- // a.href = url;
|
|
|
- // const name = new Date().getTime();
|
|
|
- // a.download = `${name}.csv`;
|
|
|
- // a.click();
|
|
|
- // window.URL.revokeObjectURL(url);
|
|
|
+ const data = await companyChatExportApi(searchInfo);
|
|
|
+ const downloadBlob = new Blob([data], {
|
|
|
+ type: 'application/msexcel',
|
|
|
+ });
|
|
|
+ const url = URL.createObjectURL(downloadBlob);
|
|
|
+ const a: HTMLAnchorElement = document.createElement('a');
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.style.display = 'none';
|
|
|
+ a.href = url;
|
|
|
+ const name = new Date().getTime();
|
|
|
+ a.download = `${name}.csv`;
|
|
|
+ a.click();
|
|
|
+ window.URL.revokeObjectURL(url);
|
|
|
}
|
|
|
|
|
|
setTimeout(() => {
|