perf: optimize import file-saver way(#2347)
This commit is contained in:
parent
6c05e7ddb9
commit
e4f2b1e587
|
@ -1,5 +1,5 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
require('script-loader!file-saver');
|
import { saveAs } from 'file-saver'
|
||||||
import XLSX from 'xlsx'
|
import XLSX from 'xlsx'
|
||||||
|
|
||||||
function generateArray(table) {
|
function generateArray(table) {
|
||||||
|
@ -151,14 +151,14 @@ export function export_json_to_excel({
|
||||||
filename,
|
filename,
|
||||||
merges = [],
|
merges = [],
|
||||||
autoWidth = true,
|
autoWidth = true,
|
||||||
bookType= 'xlsx'
|
bookType = 'xlsx'
|
||||||
} = {}) {
|
} = {}) {
|
||||||
/* original data */
|
/* original data */
|
||||||
filename = filename || 'excel-list'
|
filename = filename || 'excel-list'
|
||||||
data = [...data]
|
data = [...data]
|
||||||
data.unshift(header);
|
data.unshift(header);
|
||||||
|
|
||||||
for (let i = multiHeader.length-1; i > -1; i--) {
|
for (let i = multiHeader.length - 1; i > -1; i--) {
|
||||||
data.unshift(multiHeader[i])
|
data.unshift(multiHeader[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
require('script-loader!file-saver');
|
import { saveAs } from 'file-saver'
|
||||||
import JSZip from 'jszip'
|
import JSZip from 'jszip'
|
||||||
|
|
||||||
export function export_txt_to_zip(th, jsonData, txtName, zipName) {
|
export function export_txt_to_zip(th, jsonData, txtName, zipName) {
|
||||||
|
|
Loading…
Reference in New Issue