Remove jszip dependency and unused Export2Zip.js
This commit is contained in:
parent
41e7b9c7ad
commit
d77d8e4ebb
2 changed files with 0 additions and 25 deletions
|
@ -51,7 +51,6 @@
|
|||
"fuse.js": "3.4.2",
|
||||
"js-cookie": "2.2.0",
|
||||
"jsonlint": "1.6.3",
|
||||
"jszip": "3.1.5",
|
||||
"localforage": "^1.7.3",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
|
|
24
src/vendor/Export2Zip.js
vendored
24
src/vendor/Export2Zip.js
vendored
|
@ -1,24 +0,0 @@
|
|||
/* eslint-disable */
|
||||
require('script-loader!file-saver');
|
||||
import JSZip from 'jszip'
|
||||
|
||||
export function export_txt_to_zip(th, jsonData, txtName, zipName) {
|
||||
const zip = new JSZip()
|
||||
const txt_name = txtName || 'file'
|
||||
const zip_name = zipName || 'file'
|
||||
const data = jsonData
|
||||
let txtData = `${th}\r\n`
|
||||
data.forEach((row) => {
|
||||
let tempStr = ''
|
||||
tempStr = row.toString()
|
||||
txtData += `${tempStr}\r\n`
|
||||
})
|
||||
zip.file(`${txt_name}.txt`, txtData)
|
||||
zip.generateAsync({
|
||||
type: "blob"
|
||||
}).then((blob) => {
|
||||
saveAs(blob, `${zip_name}.zip`)
|
||||
}, (err) => {
|
||||
alert('导出失败')
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue