This commit is contained in:
parent
6547461637
commit
20c3a338c5
@ -12,7 +12,7 @@ export interface ParseParams {
|
||||
* If workbook is provided, parse function will not run a XLSX.read()
|
||||
* it will use this property instead. So the client must do a file read beforehand
|
||||
*/
|
||||
workbook?: XLSX.WorkBook,
|
||||
workbook?: XLSX.WorkBook
|
||||
/**
|
||||
* Parse function will manipulate and return the uploader array which can be provided with files already in the queue
|
||||
* Otherwise new empty instance will be created.
|
||||
|
@ -10,4 +10,4 @@ export default interface FoundRangeInfo {
|
||||
export interface MissingHeaders {
|
||||
sheetName: string
|
||||
missingHeaders: string[]
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { MissingHeaders } from "./RangeInfo"
|
||||
import { MissingHeaders } from './RangeInfo'
|
||||
|
||||
export interface SearchDataExcelResult {
|
||||
missing?: MissingHeaders[],
|
||||
missing?: MissingHeaders[]
|
||||
found?: {
|
||||
data: any,
|
||||
arrayData: any[],
|
||||
data: any
|
||||
arrayData: any[]
|
||||
sheetName: string
|
||||
headers: string[]
|
||||
startAddress?: string
|
||||
endAddress?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -219,10 +219,12 @@ export class MultiDatasetComponent implements OnInit {
|
||||
if (this.selectedFile) {
|
||||
this.fileLoadingState = FileLoadingState.reading
|
||||
|
||||
this.selectedFile.sizeMB = this.spreadsheetService.bytesToMB(this.selectedFile.size)
|
||||
this.selectedFile.sizeMB = this.spreadsheetService.bytesToMB(
|
||||
this.selectedFile.size
|
||||
)
|
||||
|
||||
// Read the excel file to be ready
|
||||
this.spreadsheetService.xlsxReadFile(this.selectedFile!).then(wb => {
|
||||
this.spreadsheetService.xlsxReadFile(this.selectedFile!).then((wb) => {
|
||||
this.fileLoadingState = FileLoadingState.parsing
|
||||
this.selectedFile!.workbook = wb
|
||||
})
|
||||
@ -314,7 +316,7 @@ export class MultiDatasetComponent implements OnInit {
|
||||
})
|
||||
})
|
||||
|
||||
this.workbookLoaded().then(workbook => {
|
||||
this.workbookLoaded().then((workbook) => {
|
||||
for (let parsedDataset of this.parsedDatasets) {
|
||||
this.spreadsheetService
|
||||
.parseExcelFile({
|
||||
|
@ -55,14 +55,14 @@ export class SpreadsheetService {
|
||||
let reader: FileReader = new FileReader()
|
||||
|
||||
reader.onload = (fileReaderResponse: any) => {
|
||||
spreadSheetUtil.xslxStartReading(
|
||||
fileReaderResponse,
|
||||
this.promptExcelPassword
|
||||
).then(response => {
|
||||
resolve(response)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
spreadSheetUtil
|
||||
.xslxStartReading(fileReaderResponse, this.promptExcelPassword)
|
||||
.then((response) => {
|
||||
resolve(response)
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
}
|
||||
|
||||
reader.readAsArrayBuffer(file)
|
||||
|
Loading…
x
Reference in New Issue
Block a user