1
0
mirror of synced 2025-12-10 07:18:03 +08:00
This commit is contained in:
xuliangzhan
2020-04-07 16:44:30 +08:00
parent 7ec98e9f4f
commit 3efd0ff96f
2 changed files with 7 additions and 7 deletions

View File

@@ -14,13 +14,13 @@ import XLSX from 'xlsx'
let _vxetable: typeof VXETable
function getFooterCellValue ($table: Table, opts: ExportOptons, rows: any[], column: ColumnConfig) {
var cellValue = XEUtils.toString(rows[$table.$getColumnIndex(column)])
const cellValue = XEUtils.toString(rows[$table.$getColumnIndex(column)])
return cellValue
}
function toBuffer (wbout: any) {
let buf = new ArrayBuffer(wbout.length)
let view = new Uint8Array(buf)
const buf = new ArrayBuffer(wbout.length)
const view = new Uint8Array(buf)
for (let index = 0; index !== wbout.length; ++index) view[index] = wbout.charCodeAt(index) & 0xFF
return buf
}
@@ -66,7 +66,7 @@ function downloadFile (blob: Blob, options: ExportOptons) {
if (navigator.msSaveBlob) {
navigator.msSaveBlob(blob, `${filename}.${type}`)
} else {
var linkElem = document.createElement('a')
const linkElem = document.createElement('a')
linkElem.target = '_blank'
linkElem.download = `${filename}.${type}`
linkElem.href = URL.createObjectURL(blob)
@@ -106,9 +106,9 @@ function parseCsv (columns: ColumnConfig[], content: string) {
}
function checkImportData (columns: ColumnConfig[], fields: string[], rows: any[]) {
let tableFields: string[] = []
const tableFields: string[] = []
columns.forEach((column) => {
let field = column.property
const field = column.property
if (field) {
tableFields.push(field)
}