diff --git a/src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp b/src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp index d6a1ed9d..f2af9aff 100644 --- a/src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp @@ -474,7 +474,7 @@ function upImgClick(){ if (!link) { - if(!confirm("URL먼저 입력을 안하면 이미지에 URL 저장이 안됩니다.\n계속하시겠습니까?")){ + if(!confirm("먼저 URL을 입력하지 않으면 이미지에 URL이 저장되지 않습니다. 계속하시겠습니까?")){ return false; } @@ -1551,6 +1551,9 @@ function updateButtons(){ } + + + @@ -2143,13 +2146,13 @@ function updateButtons(){
-
+
diff --git a/src/main/webapp/js/kakao/ft/ftTabulator.js b/src/main/webapp/js/kakao/ft/ftTabulator.js index 5abe6116..7e35e719 100644 --- a/src/main/webapp/js/kakao/ft/ftTabulator.js +++ b/src/main/webapp/js/kakao/ft/ftTabulator.js @@ -20,46 +20,41 @@ $(document).ready(function (){ tableL = new Tabulator(".callList_box", { height:"255px", layout:"fitColumns", - //data:tabledata, - //autoColumns:true, headerHozAlign:"center", validationMode:"highlight", - //clipboard:false, - //clipboardCopySelector:"table", - //clipboardPasteAction:"insert", // insert, update, replace placeholder:"복사(Ctrl+C)한 내용을 여기에 붙여넣기(Ctrl+V) 해주세요.", //fit columns to width of table (optional) resizableColumns:false, columnDefaults:{ // 공통설정 hozAlign: "center", headerHozAlign: "center", - editor: "input", + editor: false, editor: false }, columns:[ //Define Table Columns {formatter:"rowSelection", headerHozAlign:"center", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", width:5, headerSort:false, cellClick:function(e, cell){ cell.getRow().toggleSelect(); }}, - {title:"이름", hozAlign:"center", field:"name", editor:"input", validator:["maxLength:12"], cellEdited:function(cell){ + {title:"이름", hozAlign:"center", field:"name", validator:["maxLength:12"], cellEdited:function(cell){ //cell - cell component fnReplCell(); }}, - {title:"휴대폰", hozAlign:"center", field:"phone", editor:"input", width:100, validator:["required","minLength:10", "maxLength:12"], cellEdited:function(cell){ + {title:"휴대폰", hozAlign:"center", field:"phone", width:100, validator:["required","minLength:10", "maxLength:12"], cellEdited:function(cell){ //cell - cell component fnDuplPhone(); }}, - {title:"[*1*]", hozAlign:"center", field:"rep1", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ + {title:"[*1*]", hozAlign:"center", field:"rep1", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ //cell - cell component fnReplCell(); }}, - {title:"[*2*]", hozAlign:"center", field:"rep2", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ + {title:"[*2*]", hozAlign:"center", field:"rep2", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ //cell - cell component fnReplCell(); }}, - {title:"[*3*]", hozAlign:"center", field:"rep3", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ + {title:"[*3*]", hozAlign:"center", field:"rep3", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ //cell - cell component fnReplCell(); }}, - {title:"[*4*]", hozAlign:"center", field:"rep4", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ + {title:"[*4*]", hozAlign:"center", field:"rep4", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){ //cell - cell component fnReplCell(); }}, @@ -556,6 +551,207 @@ $(document).ready(function (){ }); + + + + + //받는사람 목록에 복사/붙여넣기 기능 처리 + $('.callList_box').on('paste', function (e) { + console.log(' :: callList _box :: '); + + var element = e.originalEvent.clipboardData.getData('text'); // 클립보드에 복사한 데이터 가져오기 + + var elmSplit= []; + + elmSplit = element.split("\n"); + + var elmLen = elmSplit.length; + + + if(elmLen < 0){ + + alert("붙여넣을 연락처를 복사해주세요."); + return false; + + }else{ + tableErrorData.length = 0; // 오류 번호 배열 초기화 + + var splitData = []; + var realPhone = []; + for(var i=0; i < elmLen; i++){ + + var splitStr = elmSplit[i]; + var tabData = []; + var comData = []; + + if(splitStr.indexOf('\t') != -1){ + splitData = splitStr.split('\t'); //탭 구분으로 데이터 분할 + }else if(splitStr.indexOf(',') != -1){ + splitData = splitStr.split(','); //콤마 구분으로 데이터 분할 + }else{ + splitData = splitStr.split(' '); + } + + + if(splitData.length == 0){// 데이터가 없는경우 + + alert("탭으로 구분하여 데이터를 복사해 주세요."); + return false; + + }else if(splitData.length == 1){// 데이터가 탭으로 구분이 없는 경우 + + for(var j=0; j < splitData.length; j++){ + if(checkHpNum(splitData[j].trim())){//핸드폰 양식이 맞는지 확인 + //배열 끝에 데이터 추가해 주기 + realPhone.push({phone: removeDash(splitData[j].trim()), name: ""}); + } + else { + if (splitData[j].trim() != '' && splitData[j].trim() != null && splitData[j].trim() != undefined) { + tableErrorData.push(splitData[j].trim()); + } + } + } + + }else{//데이터가 탭으로 구분되어 이름, 연락처로 구분된 경우 + + var phone = ""; //핸드폰번호 + var name = ""; //이름 + var rep1 = ""; //치환문자1 + var rep2 = ""; //치환문자2 + var rep3 = ""; //치환문자3 + var rep4 = ""; //치환문자4 + var isPhoneValid = false; + for(var j=0; j < splitData.length; j++){ + + if(j == 0){ + + name = splitData[j].trim(); + + } + + if(j == 1){ + + if(checkHpNum(splitData[j].trim())){//핸드폰 양식이 맞는지 확인 + phone = removeDash(splitData[j].trim()); + isPhoneValid = true; + }else{ + if (splitData[j].trim() != '' && splitData[j].trim() != null && splitData[j].trim() != undefined) { + tableErrorData.push(splitData[j].trim()); + } + } + + } + + if(j == 2){ //치환문자1 + + rep1 = splitData[j].trim(); + + } + + if(j == 3){ //치환문자2 + + rep2 = splitData[j].trim(); + + } + + if(j == 4){ //치환문자3 + + rep3 = splitData[j].trim(); + + } + + if(j == 5){ //치환문자4 + + rep4 = splitData[j].trim(); + + } + + } + + if (isPhoneValid == true) { + //배열 끝에 데이터 추가해 주기 + realPhone.push({phone: phone, name: name, rep1 : rep1, rep2 : rep2, rep3 : rep3, rep4 : rep4 }); + } + + }//else end + + } + + var recTableData = tableL.getRows(); // 받는사람 리스트의 전체 목록을 저장 + var tableData = []; + + //기존 받는사람 리스트를 배열에 미리 담아둔다. + if(recTableData.length > 0){ + + for(var j=0; j < recTableData.length; j++){ + + tableData.push({phone: removeDash(recTableData[j].getData().phone.trim()) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4, }); + + } + + } + + if(realPhone.length > 0){ + + for(var j=0; j < realPhone.length; j++){ + + tableData.push({phone: removeDash(realPhone[j].phone.trim()) , name: realPhone[j].name, rep1: realPhone[j].rep1, rep2: realPhone[j].rep2, rep3: realPhone[j].rep3, rep4: realPhone[j].rep4}); + + } + + } + + //tableData.push(realPhone); + + //중복 연락처 1개만 남기고 삭제하기 + var removeDuplPhone = dupliPhoneData(tableData); + + //수신자 리스트에 전화번호 추가해주기 + //tableL.addData(removeDuplPhone); + tableL.setData(removeDuplPhone); + + totRows = tableL.getRows().length; + updateTotCnt(totRows); //전체 데이터 갯수 구하기 + + var smsTxtArea = $('#smsTxtArea').val(); + + //일괄변환 문구 결제금액 처리 + if(smsTxtArea.indexOf("[*이름*]") > -1 + || smsTxtArea.indexOf("[*1*]") > -1 + || smsTxtArea.indexOf("[*2*]") > -1 + || smsTxtArea.indexOf("[*3*]") > -1 + || smsTxtArea.indexOf("[*4*]") > -1){ + + fnReplCell_advc(); + }else{ + //결제 금액 구하기 + totalPriceSum(totRows); + } + + if (tableErrorData.length > 0) { + alert("올바르지 않은 휴대폰 번호가 "+ tableErrorData.length +" 건 있습니다."); + } + + + // 미리보기 버튼 활성화 + updateButtons(0); + + } + + }); + + + + + + + + + + + + + }); var tableErrorData = []; @@ -566,9 +762,9 @@ var totRows = 0; // 좌측 받는사람 총 갯수 * 토탈 카운트 화면에 노출 * 변수 없는 리스트만 체크 */ -function updateTotCnt(){ +function updateTotCnt(cnt){ - $("#rowTotCnt").text($('#wrap01_body .list_body').length); + $("#rowTotCnt").text(cnt); } @@ -927,3 +1123,8 @@ $('.check_validity').click(function(){ } }); + + + + +