const derivation = (list: any, type: any = 'xls') => {
const newt = xlsx.utils.json_to_sheet(list);
const wopts: WoptsInter = {
bookType: type || 'xls',
bookSST: false,
type: 'binary',
};
const wb = {
SheetNames: ['mySheet'],
Sheets: {
mySheet: newt,
},
};
const t = xlsx.write(wb, wopts);
const y: any = s2ab(t);
saveAs(new Blob([y], { type: 'application/octet-stream' }), `${format('yyyy_MM_dd_hh_mm_ss')}.${type}`);
};
导出文件方法封装
最新推荐文章于 2024-10-03 20:14:40 发布