From e6068da47c1bef5517c9e5fdc8c726766867ad4e Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 14 七月 2023 15:10:02 +0800
Subject: [PATCH] Merge branch 'master' into LEXUpgrade2023-Deloitte

---
 force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js |   71 ++++++++---------------------------
 1 files changed, 16 insertions(+), 55 deletions(-)

diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
index 6e97e38..dddc5bf 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
@@ -89,7 +89,7 @@
         reader.onloadend = function () {};
         reader.readAsDataURL(file);
     },
-    isNumber: function(str) {
+    isNumber: function (str) {
         return /^\d+$/.test(str);
     },
     saveRecords: function (component, event, helper) {
@@ -115,37 +115,29 @@
                     for (var i = 0; i < ress.length; i++) {
                         res1 += ress[i].substr(7) + '\n';
                         if (ress[i] != '') {
-<<<<<<< HEAD
                             let errorData = {};
+                            if (
+                                !this.isNumber(
+                                    ress[i].substr(7).substring(1, 2)
+                                )
+                            ) {
+                                continue;
+                            }
                             let index = errorDataRow.indexOf(
                                 ress[i].substr(7).substring(1, 2)
                             );
-=======
-                            let errorData = {}
-                            if(!this.isNumber(ress[i].substr(7).substring(1, 2))){
-                                continue
-                            }
-                            let index = errorDataRow.indexOf(ress[i].substr(7).substring(1, 2));
->>>>>>> LEXCommunityLiJun
                             if (index == -1) {
                                 errorData.errorRow = ress[i]
                                     .substr(7)
                                     .substring(1, 2);
                                 errorDataRow.push(errorData.errorRow);
-<<<<<<< HEAD
                                 errorData.errorInfo = ress[i]
                                     .substr(7)
-                                    .substring(6);
+                                    .substring(5);
                                 errorDatas.push(errorData);
                             } else {
                                 errorDatas[index].errorInfo +=
-                                    '; ' + ress[i].substr(7).substring(6);
-=======
-                                errorData.errorInfo = ress[i].substr(7).substring(5);
-                                errorDatas.push(errorData);
-                            } else {
-                                errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5);
->>>>>>> LEXCommunityLiJun
+                                    '; ' + ress[i].substr(7).substring(5);
                             }
                         }
                     }
@@ -153,13 +145,12 @@
                         .get('v.fileContentData')
                         .split('\n');
                     let errorColumns = [
-<<<<<<< HEAD
                         {
                             label: '閿欒琛�',
                             fieldName: 'errorRow',
                             type: 'text',
                             hideDefaultActions: true,
-                            initialWidth: 50
+                            initialWidth: 100
                         },
                         {
                             label: '閿欒淇℃伅',
@@ -169,10 +160,6 @@
                             initialWidth: 300,
                             wrapText: true
                         }
-=======
-                        { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
-                        { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true,initialWidth: 300,wrapText: true }
->>>>>>> LEXCommunityLiJun
                     ];
                     for (
                         var i = 0;
@@ -180,37 +167,23 @@
                         i++
                     ) {
                         errorColumns.push({
-<<<<<<< HEAD
                             label: fileContentData[0].split(',')[i],
                             fieldName: 'field' + i,
                             type: 'text',
                             hideDefaultActions: true,
-                            wrapText: true
-=======
-                            label: fileContentData[0].split(',')[i], 
-                            fieldName: 'field' + i, 
-                            type: 'text', 
-                            hideDefaultActions: true,
                             wrapText: true,
                             initialWidth: 120
->>>>>>> LEXCommunityLiJun
                         });
                     }
 
                     for (var i = 0; i < errorDatas.length; i++) {
                         let data = fileContentData[errorDatas[i].errorRow];
                         console.log('data = ' + JSON.stringify(data));
-<<<<<<< HEAD
-                        for (var j = 0; j < data.split(',').length; j++) {
-                            let label = 'field' + j;
-                            errorDatas[i][label] = data.split(',')[j];
-=======
-                        if(data){
-                            for(var j = 0; j < data.split(',').length; j++){
+                        if (data) {
+                            for (var j = 0; j < data.split(',').length; j++) {
                                 let label = 'field' + j;
                                 errorDatas[i][label] = data.split(',')[j];
                             }
->>>>>>> LEXCommunityLiJun
                         }
                     }
                     console.log('errorDatas = ' + JSON.stringify(errorDatas));
@@ -224,14 +197,14 @@
                     component.set('v.errorMessage', res1 + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
                     this.showErrorToast(component);
                     component.set('v.login', false);
-                    component.find('save_con').set('v.disabled', true); 
+                    component.find('save_con').set('v.disabled', true);
                 } else {
                     // this.success('瀵煎叆鎴愬姛');
                     component.set('v.successMessage', '瀵煎叆鎴愬姛');
                     this.showSuccessToast01(component);
                     component.set('v.showMain', true);
                     component.set('v.login', false);
-                    component.find('save_con').set('v.disabled', false); 
+                    component.find('save_con').set('v.disabled', false);
                 }
             } else if (state === 'INCOMPLETE') {
                 component.set('v.login', false);
@@ -289,18 +262,11 @@
     //寮瑰嚭 閿欒鎻愮ず
     showErrorToast: function (component) {
         $A.util.removeClass(component.find('errorDiv'), 'slds-hide');
-<<<<<<< HEAD
         window.setTimeout(
             $A.getCallback(function () {
                 $A.util.addClass(component.find('errorDiv'), 'slds-hide');
             }),
-            4000
-=======
-        window.setTimeout($A.getCallback(function () {
-            $A.util.addClass(component.find('errorDiv'), 'slds-hide');
-        }),
             7000
->>>>>>> LEXCommunityLiJun
         );
     },
     success: function (message) {
@@ -392,15 +358,10 @@
     downloadCSV: function (component, csv) {
         var link = document.createElement('a');
         // 璁剧疆瀛楃闆嗗拰鏂囦欢澶�
-<<<<<<< HEAD
-        let bom = '\uFEFF';
+        var bom = '\uFEFF';
         link.href =
             'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
-=======
-        var bom = "\uFEFF";
-        link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
         //link.href = URL.createObjectURL(csvFile);
->>>>>>> LEXCommunityLiJun
         link.download = 'data.csv';
         document.body.appendChild(link);
         link.click();

--
Gitblit v1.9.1