Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reader.onload = function (e: any) {
- var data = e.target.result;
- console.log(data);
- var result;
- var workbook = XLSX.read(data, { type: 'binary' });
- var sheet_name_list = workbook.SheetNames;
- sheet_name_list.forEach(function (y) { /* iterate through sheets */
- //Convert the cell value to Json
- var roa = XLSX.utils.sheet_to_json(workbook.Sheets[y]);
- if (roa.length > 0) {
- result = roa;
- }
- });
- result.forEach(element => {
- if (element.Permissao == "2") {
- element.Permissao = "Usuário Comum";
- }
- else if (element.Permissao == "1") {
- element.Permissao = "Administrador";
- }
- });
- //Get the first column first cell value;
- _component.validationFiles(result);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement