webadmin增加财务模块
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/** Download CSV (UTF-8 BOM) so Excel opens Chinese columns correctly. */
|
||||
export function downloadExcelCsv(csv: string, filename: string) {
|
||||
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = filename.endsWith('.csv') ? filename : `${filename}.csv`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
Reference in New Issue
Block a user