문자전송, 선거문자 주소록 불러오기 속도 개선
- 주소록 불러오기 팝업 그룹 선택시 로딩바 표시 추가 - 주소 추가시 중복 번호 체크 로직 속도 개선
This commit is contained in:
parent
8668d2af82
commit
ab889486ae
@ -65,7 +65,9 @@ function addPhoneInfo(data){
|
|||||||
|
|
||||||
//기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다.
|
//기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다.
|
||||||
tableL.clearData(); //기존 받는사람 목록을 삭제.
|
tableL.clearData(); //기존 받는사람 목록을 삭제.
|
||||||
tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
|
//tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
|
||||||
|
tableL.addData(getSpupDupliPhoneDataChk(tableData)); // 속도 개선된 중복 검사 호출
|
||||||
|
|
||||||
_fileForm2 = []; //form file data 초기화
|
_fileForm2 = []; //form file data 초기화
|
||||||
_fileIdx = 0; //form file idx 초기화
|
_fileIdx = 0; //form file idx 초기화
|
||||||
|
|
||||||
@ -2429,7 +2431,7 @@ function loadAddrList(){
|
|||||||
url: url,
|
url: url,
|
||||||
data: data,
|
data: data,
|
||||||
dataType:'json',
|
dataType:'json',
|
||||||
async: false,
|
async: true,
|
||||||
cache: false,
|
cache: false,
|
||||||
success: function (returnData, status) {
|
success: function (returnData, status) {
|
||||||
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||||
@ -2467,7 +2469,17 @@ function loadAddrList(){
|
|||||||
alert("주소록 불러오기에 실패하였습니다. !!");
|
alert("주소록 불러오기에 실패하였습니다. !!");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (e) { alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e); }
|
error: function (e) {
|
||||||
|
alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e);
|
||||||
|
},
|
||||||
|
beforeSend : function(xmlHttpRequest) {
|
||||||
|
//로딩창 show
|
||||||
|
$('.loading_layer').addClass('active');
|
||||||
|
},
|
||||||
|
complete : function(xhr, textStatus) {
|
||||||
|
//로딩창 hide
|
||||||
|
$('.loading_layer').removeClass('active');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2564,13 +2564,12 @@ function loadAddrList(){
|
|||||||
url: url,
|
url: url,
|
||||||
data: data,
|
data: data,
|
||||||
dataType:'json',
|
dataType:'json',
|
||||||
async: false,
|
async: true,
|
||||||
cache: false,
|
cache: false,
|
||||||
success: function (returnData, status) {
|
success: function (returnData, status) {
|
||||||
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||||
|
|
||||||
if(returnData.result == "success"){
|
if(returnData.result == "success"){
|
||||||
|
|
||||||
var addrList = returnData.resultAddrList;
|
var addrList = returnData.resultAddrList;
|
||||||
var tableData = [];
|
var tableData = [];
|
||||||
|
|
||||||
@ -2580,14 +2579,12 @@ function loadAddrList(){
|
|||||||
tableAddr.setData(tableData);
|
tableAddr.setData(tableData);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다.
|
//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다.
|
||||||
for(var i=0; i < addrList.length; i++){
|
for(var i=0; i < addrList.length; i++){
|
||||||
|
|
||||||
tableData.push({addrGroupNm: addrList[i].addrGrpNm, addrPhone: removeDash(addrList[i].addrPhoneNo) , addrName: addrList[i].addrNm, addrRep1: addrList[i].addrInfo1, addrRep2: addrList[i].addrInfo2, addrRep3: addrList[i].addrInfo3, addrRep4: addrList[i].addrInfo4});
|
tableData.push({addrGroupNm: addrList[i].addrGrpNm, addrPhone: removeDash(addrList[i].addrPhoneNo) , addrName: addrList[i].addrNm, addrRep1: addrList[i].addrInfo1, addrRep2: addrList[i].addrInfo2, addrRep3: addrList[i].addrInfo3, addrRep4: addrList[i].addrInfo4});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//우측 주소록 리스트 Tabulator에 입력해주기
|
//우측 주소록 리스트 Tabulator에 입력해주기
|
||||||
tableAddr.setData(tableData);
|
tableAddr.setData(tableData);
|
||||||
|
|
||||||
@ -2602,7 +2599,17 @@ function loadAddrList(){
|
|||||||
alert("주소록 불러오기에 실패하였습니다. !!");
|
alert("주소록 불러오기에 실패하였습니다. !!");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (e) { alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e); }
|
error: function (e) {
|
||||||
|
alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e);
|
||||||
|
},
|
||||||
|
beforeSend : function(xmlHttpRequest) {
|
||||||
|
//로딩창 show
|
||||||
|
$('.loading_layer').addClass('active');
|
||||||
|
},
|
||||||
|
complete : function(xhr, textStatus) {
|
||||||
|
//로딩창 hide
|
||||||
|
$('.loading_layer').removeClass('active');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,9 @@ function addPhoneInfo(data){
|
|||||||
|
|
||||||
//기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다.
|
//기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다.
|
||||||
tableL.clearData(); //기존 받는사람 목록을 삭제.
|
tableL.clearData(); //기존 받는사람 목록을 삭제.
|
||||||
tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
|
//tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
|
||||||
|
tableL.addData(getSpupDupliPhoneDataChk(tableData)); // 받는사람 목록에 주소 정보 입력하기
|
||||||
|
|
||||||
_fileForm2 = []; //form file data 초기화
|
_fileForm2 = []; //form file data 초기화
|
||||||
_fileIdx = 0; //form file idx 초기화
|
_fileIdx = 0; //form file idx 초기화
|
||||||
|
|
||||||
@ -2691,7 +2693,7 @@ function loadAddrList(){
|
|||||||
url: url,
|
url: url,
|
||||||
data: data,
|
data: data,
|
||||||
dataType:'json',
|
dataType:'json',
|
||||||
async: false,
|
async: true,
|
||||||
cache: false,
|
cache: false,
|
||||||
success: function (returnData, status) {
|
success: function (returnData, status) {
|
||||||
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||||
@ -2729,7 +2731,17 @@ function loadAddrList(){
|
|||||||
alert("주소록 불러오기에 실패하였습니다. !!");
|
alert("주소록 불러오기에 실패하였습니다. !!");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (e) { alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e); }
|
error: function (e) {
|
||||||
|
alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e);
|
||||||
|
},
|
||||||
|
beforeSend : function(xmlHttpRequest) {
|
||||||
|
//로딩창 show
|
||||||
|
$('.loading_layer').addClass('active');
|
||||||
|
},
|
||||||
|
complete : function(xhr, textStatus) {
|
||||||
|
//로딩창 hide
|
||||||
|
$('.loading_layer').removeClass('active');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -575,6 +575,7 @@ var dupliPhoneDataRealList = [];
|
|||||||
|
|
||||||
//중복 전화번호 체크하기
|
//중복 전화번호 체크하기
|
||||||
function dupliPhoneData(data){
|
function dupliPhoneData(data){
|
||||||
|
|
||||||
var chk = true; //중복값 유무
|
var chk = true; //중복값 유무
|
||||||
var uniqData = []; // 중복값 삭제 후 데이터 저장
|
var uniqData = []; // 중복값 삭제 후 데이터 저장
|
||||||
var dupCnt = 0;
|
var dupCnt = 0;
|
||||||
@ -622,6 +623,23 @@ function dupliPhoneData(data){
|
|||||||
return uniqData;
|
return uniqData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//연락처 중복검사 속도 개선 버전
|
||||||
|
function getSpupDupliPhoneDataChk(data){
|
||||||
|
|
||||||
|
var dataLen = data.length;
|
||||||
|
const arrUnique = data.filter((character, idx, arr)=>{
|
||||||
|
return arr.findIndex((item) => item.phone === character.phone) === idx
|
||||||
|
});
|
||||||
|
|
||||||
|
var uniqLen = arrUnique.length;
|
||||||
|
var dupCnt = dataLen - uniqLen;
|
||||||
|
//중복건수 텍스트 입력해 주기
|
||||||
|
$("#rowDupCnt").text(dupCnt);
|
||||||
|
|
||||||
|
return arrUnique;
|
||||||
|
}
|
||||||
|
|
||||||
// Get 중복 연락처
|
// Get 중복 연락처
|
||||||
function GetDupliPhoneDataReal(item) {
|
function GetDupliPhoneDataReal(item) {
|
||||||
var isDuplicate = false;
|
var isDuplicate = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user