reactor:refine code&&demo
This commit is contained in:
2
src/vendor/Export2Excel.js
vendored
2
src/vendor/Export2Excel.js
vendored
@@ -155,6 +155,6 @@ export function export_json_to_excel(th, jsonData, defaultTitle) {
|
||||
wb.Sheets[ws_name] = ws;
|
||||
|
||||
var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
|
||||
var title = defaultTitle || '列表'
|
||||
var title = defaultTitle || 'excel-list'
|
||||
saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx")
|
||||
}
|
||||
|
4
src/vendor/Export2Zip.js
vendored
4
src/vendor/Export2Zip.js
vendored
@@ -4,8 +4,8 @@ import JSZip from 'jszip'
|
||||
|
||||
export function export_txt_to_zip(th, jsonData, txtName, zipName) {
|
||||
const zip = new JSZip()
|
||||
const txt_name = txtName || '文本'
|
||||
const zip_name = zipName || '压缩包'
|
||||
const txt_name = txtName || 'file'
|
||||
const zip_name = zipName || 'file'
|
||||
const data = jsonData
|
||||
let txtData = `${th}\r\n`
|
||||
data.forEach((row) => {
|
||||
|
Reference in New Issue
Block a user