문자 미리보기 진행중
This commit is contained in:
parent
1411959cce
commit
822afdfc76
@ -326,16 +326,17 @@ function SetAddrMassSave(){
|
||||
// }
|
||||
if (confirm(confirmMsg)) {
|
||||
//로딩창 show
|
||||
// $('.loading_layer').addClass('active');
|
||||
fn_loadAddActive();
|
||||
|
||||
// setTimeout(setSenderList_advc, 1000);
|
||||
$('.loading_layer').addClass('active');
|
||||
setSenderList_advc();
|
||||
setTimeout(setSenderList_advc, 1000);
|
||||
|
||||
// fn_loadAddActive();
|
||||
// setSenderList_advc();
|
||||
}
|
||||
}
|
||||
|
||||
// 주소록 등록 advc
|
||||
function setSenderList_advc(){
|
||||
/* function setSenderList_advc(){
|
||||
|
||||
// tab에 해당하는 타블레이터 가져오기
|
||||
var $objTabul = fn_utils_getTabulator();
|
||||
@ -388,33 +389,36 @@ function setSenderList_advc(){
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
function setSenderList_advc(){
|
||||
var $objTabul = fn_utils_getTabulator();
|
||||
var dataToSend = $objTabul.getData();
|
||||
var addrGrpIdInfo = $("#addrGrpIdInfo").val();
|
||||
var addrGrpNmInfo = $("#addrGrpNm").val();
|
||||
|
||||
var batchSize = 20000; // 배치 크기
|
||||
var batchSize = 50000; // 배치 크기
|
||||
var totalBatches = Math.ceil(dataToSend.length / batchSize); // 총 배치 수
|
||||
var currentBatch = 0; // 현재 배치 인덱스
|
||||
|
||||
|
||||
fn_loadAddActive();
|
||||
|
||||
|
||||
function sendBatch() {
|
||||
if (currentBatch < totalBatches) {
|
||||
fn_loadAddActive();
|
||||
var start = currentBatch * batchSize;
|
||||
var end = Math.min(start + batchSize, dataToSend.length);
|
||||
var batchData = dataToSend.slice(start, end);
|
||||
|
||||
console.time('updateData');
|
||||
var updateData = batchData.map(row => {
|
||||
row.addrGrpId = addrGrpIdInfo;
|
||||
row.addrGrpNm = addrGrpNmInfo;
|
||||
return row;
|
||||
});
|
||||
|
||||
console.timeEnd('updateData');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/web/mjon/addr/addrMassInsertByTempAjax_advc.do",
|
||||
@ -423,6 +427,10 @@ function setSenderList_advc(){
|
||||
contentType: 'application/json',
|
||||
async: true,
|
||||
success: function (data) {
|
||||
|
||||
|
||||
fn_loadRemoveActive();
|
||||
|
||||
console.log('Batch ' + (currentBatch + 1) + ' success: ', data);
|
||||
if (data.status == 'OK') {
|
||||
if (currentBatch === totalBatches - 1) {
|
||||
@ -444,18 +452,20 @@ function setSenderList_advc(){
|
||||
beforeSend: function(xmlHttpRequest) {
|
||||
},
|
||||
complete: function(xhr, textStatus) {
|
||||
console.log('end : ', end);
|
||||
$('#lodingTxt').text(end);
|
||||
if (currentBatch === totalBatches - 1) {
|
||||
$('#lodingTxt').text('Loading');
|
||||
} else {
|
||||
$('#lodingTxt').text(end+'...');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 첫 번째 배치 전송 시작
|
||||
sendBatch();
|
||||
$('.loading_layer').removeClass('active');
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//주소록그룹 콤보박스 유지
|
||||
function setSelectMassSetting(selectMassVal) {
|
||||
|
||||
@ -53,6 +53,19 @@ $(document).ready(function(){
|
||||
$(".radio12_input").css("display","none");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 요청사항 글자수 제한
|
||||
$("textarea[name='customRequest']").on('input', function() {
|
||||
var maxLength = 2000;
|
||||
var currentLength = $(this).val().length;
|
||||
|
||||
if (currentLength > maxLength) {
|
||||
$(this).val($(this).val().substring(0, maxLength));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
//샘플 이미지 리스트
|
||||
|
||||
@ -10,6 +10,90 @@
|
||||
|
||||
<% pageContext.setAttribute("newLineChar", "\r\n"); %>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
var currentIndex = 0;
|
||||
var dataLength = tableL.getData().length;
|
||||
|
||||
|
||||
$('#btnFirst').on('click', function(){
|
||||
currentIndex = 0;
|
||||
updateButtons();
|
||||
fn_previewText(currentIndex);
|
||||
});
|
||||
|
||||
$('#btnPrev').on('click', function(){
|
||||
if (currentIndex > 0) {
|
||||
currentIndex--;
|
||||
updateButtons();
|
||||
fn_previewText(currentIndex);
|
||||
}
|
||||
});
|
||||
|
||||
$('#btnNext').on('click', function(){
|
||||
console.log('currentIndex : ', currentIndex);
|
||||
console.log('dataLength : ', dataLength);
|
||||
if (currentIndex < dataLength - 1) {
|
||||
currentIndex++;
|
||||
updateButtons();
|
||||
fn_previewText(currentIndex);
|
||||
}
|
||||
});
|
||||
|
||||
$('#btnLast').on('click', function(){
|
||||
currentIndex = dataLength - 1;
|
||||
updateButtons();
|
||||
fn_previewText(currentIndex);
|
||||
});
|
||||
|
||||
// Initialize buttons on page load
|
||||
updateButtons();
|
||||
|
||||
});
|
||||
|
||||
function updateButtons() {
|
||||
$('#btnPrev').data('index', currentIndex - 1);
|
||||
$('#btnNext').data('index', currentIndex + 1);
|
||||
|
||||
if (currentIndex <= 0) {
|
||||
$('#btnPrev').attr('disabled', true);
|
||||
} else {
|
||||
$('#btnPrev').attr('disabled', false);
|
||||
}
|
||||
|
||||
if (currentIndex >= dataLength - 1) {
|
||||
$('#btnNext').attr('disabled', true);
|
||||
} else {
|
||||
$('#btnNext').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
function fn_previewText(rowIndex){
|
||||
|
||||
var smsText = $('#smsTxtArea').val()
|
||||
// 데이터 가져오기
|
||||
var data = tableL.getData();
|
||||
|
||||
// 특정 인덱스(예: 1)로 행을 선택하여 치환
|
||||
var row = data[rowIndex]; // 인덱스 1의 행을 선택
|
||||
|
||||
// 이름 치환
|
||||
smsText = smsText.replace(/\[\*이름\*\]/g, row.name);
|
||||
|
||||
// rep1, rep2, rep3, rep4 치환
|
||||
smsText = smsText.replace(/\[\*1\*\]/g, row.rep1 || '');
|
||||
smsText = smsText.replace(/\[\*2\*\]/g, row.rep2 || '');
|
||||
smsText = smsText.replace(/\[\*3\*\]/g, row.rep3 || '');
|
||||
smsText = smsText.replace(/\[\*4\*\]/g, row.rep4 || '');
|
||||
|
||||
// 결과 출력 또는 다른 곳에 사용
|
||||
console.log(smsText);
|
||||
$('.realtime').text(smsText);
|
||||
}
|
||||
|
||||
var tableErrorData = [];
|
||||
var totRows = 0; // 좌측 받는사람 총 갯수
|
||||
|
||||
@ -29,8 +113,11 @@ function updateTotCnt(data){
|
||||
|
||||
//주소록 불러오기에서 수신자 리스트 tabulator에 데이터 추가해주기
|
||||
function addPhoneInfo_advc(tableAddr){
|
||||
|
||||
|
||||
// 기존 tableL의 데이터를 가져옵니다.
|
||||
var existingData = tableL.getData();
|
||||
|
||||
// 새로운 addrData를 만듭니다.
|
||||
var addrData = tableAddr.getData().map((row, index) => ({
|
||||
name: row.addrName,
|
||||
phone: removeDash(row.addrPhone),
|
||||
@ -39,9 +126,13 @@ function addPhoneInfo_advc(tableAddr){
|
||||
rep3: row.addrRep3,
|
||||
rep4: row.addrRep4,
|
||||
}));
|
||||
|
||||
tableL.setData(addrData);
|
||||
|
||||
// 기존 데이터와 새로운 데이터를 합칩니다.
|
||||
var combinedData = existingData.concat(addrData);
|
||||
|
||||
// 합쳐진 데이터를 tableL에 설정합니다.
|
||||
tableL.setData(combinedData);
|
||||
|
||||
/*
|
||||
var idx = 0;
|
||||
var newData = data;//중복 연락처는 하나만 남기고 모두 제거
|
||||
@ -590,6 +681,8 @@ $(document).ready(function (){
|
||||
|
||||
//문자 내용 입력시 바이트수 계산하기
|
||||
$('#smsTxtArea').keyup(function(e){
|
||||
console.log("11$('.preview_auto').test() :: ",$('.realtime').html())
|
||||
console.log("11$('.preview_auto').test() :: ",$('.realtime').text())
|
||||
|
||||
var contents = $(this).val();
|
||||
var adrYn = $("input[name=send_adYn]:checked").val();
|
||||
@ -614,7 +707,7 @@ $(document).ready(function (){
|
||||
fnByteString(contents);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2140,7 +2233,7 @@ function fnByteString(contents){
|
||||
$('.none_txt').text("내용을 입력해주세요.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
//미리보기에 내용 입력해 주기
|
||||
$('.realtime').text(contents);
|
||||
|
||||
@ -4159,14 +4252,14 @@ function getMjMsgSentListAll(pageNo) {
|
||||
<!-- //텍스트 미리보기 -->
|
||||
</div>
|
||||
</div>
|
||||
<p class="addText">※ 단말기 설정에 따라 다르게 보일 수 있습니다</p>
|
||||
<div class="preview_util">
|
||||
<button type="button"><img src="/publish/images/content/page_first.png"></button>
|
||||
<button type="button"><img src="/publish/images/content/page_prev.png"></button>
|
||||
<p>미리보기</p>
|
||||
<button type="button"><img src="/publish/images/content/page_next.png"></button>
|
||||
<button type="button"><img src="/publish/images/content/page_last.png"></button>
|
||||
</div>
|
||||
<p class="addText">※ 단말기 설정에 따라 다르게 보일 수 있습니다</p>
|
||||
<div class="preview_util">
|
||||
<button type="button" id="btnFirst"><img src="/publish/images/content/page_first.png"></button>
|
||||
<button type="button" id="btnPrev" data-index="0"><img src="/publish/images/content/page_prev.png"></button>
|
||||
<p>미리보기</p>
|
||||
<button type="button" id="btnNext" data-index="1"><img src="/publish/images/content/page_next.png"></button>
|
||||
<button type="button" id="btnLast"><img src="/publish/images/content/page_last.png"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="phone_bottom">
|
||||
<div class="send_rev">
|
||||
|
||||
@ -1136,7 +1136,7 @@ function fn_sendMsgData(){
|
||||
if(!emojiCheck(form.mmsSubject.value)) return false;
|
||||
}
|
||||
|
||||
//문자내용에 이모지가 있는지 체크
|
||||
//문자내용에 이모지가 있는지 체크
|
||||
if(!emojiCheck(strCont)) return false;
|
||||
|
||||
if(rtnStr.length > 0){
|
||||
|
||||
@ -245,7 +245,18 @@ $(document).ready(function(){
|
||||
rep4: row.addrInfo4,
|
||||
}));
|
||||
|
||||
tableL.setData(addrData);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 기존 tableL의 데이터를 가져옵니다.
|
||||
var existingData = tableL.getData();
|
||||
// 기존 데이터와 새로운 데이터를 합칩니다.
|
||||
var combinedData = existingData.concat(addrData);
|
||||
// 합쳐진 데이터를 tableL에 설정합니다.
|
||||
tableL.setData(combinedData);
|
||||
|
||||
|
||||
var totRows = tableL.getRows().length;
|
||||
updateTotCnt(totRows); //전체 데이터 갯수 구하기
|
||||
@ -330,10 +341,12 @@ function processExcelData(data) {
|
||||
|
||||
|
||||
// 3번째 행부터 입력
|
||||
data.slice(2).forEach((row, index) => {
|
||||
data.slice(0).forEach((row, index) => {
|
||||
var rowData = {};
|
||||
keys.forEach((key, idx) => { // index 변수명 변경 (내부와 외부에서 사용되므로 충돌 방지)
|
||||
rowData[key] = row[idx] ? row[idx].trim() : ""; // 각 컬럼에 대해 기본값을 설정
|
||||
// console.log('row[idx] : ', row[idx]);
|
||||
// rowData[key] = row[idx] ? row[idx].trim() : ""; // 각 컬럼에 대해 기본값을 설정
|
||||
rowData[key] = (typeof row[idx] === 'string') ? row[idx].trim() : row[idx];
|
||||
});
|
||||
tableData.push(rowData);
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ function fnReplCell(){
|
||||
}
|
||||
|
||||
|
||||
console.log('???smsTxtArea :: ', smsTxtArea);
|
||||
if(smsTxtArea.indexOf("[*이름*]") > -1
|
||||
|| smsTxtArea.indexOf("[*1*]") > -1
|
||||
|| smsTxtArea.indexOf("[*2*]") > -1
|
||||
@ -87,6 +88,9 @@ function fnReplCell(){
|
||||
|
||||
if(typeof recTableData[j].getData().name != 'undefined' && recTableData[j].getData().name != null && recTableData[j].getData().name != ""){
|
||||
|
||||
// console.log('name : ', name);
|
||||
// console.log('smsTxt : ', smsTxt);
|
||||
// console.log('orgSmsTxt : ', orgSmsTxt);
|
||||
var name = recTableData[j].getData().name;
|
||||
smsTxt = stringReplaceAll(smsTxt, "[*이름*]", name);
|
||||
orgSmsTxt = stringReplaceAll(orgSmsTxt, "[*이름*]", name);//광고, 선거 문자인 경우 상하단 문구 제거한 문자내용만 보여주도록 함. 치환문자 있으면 변환해서 보여줌
|
||||
@ -216,6 +220,7 @@ function fnReplCell(){
|
||||
//첫번째 수신자의 변환 텍스트 내용을 적용하여 미리보기 문자내용에 보여주자.
|
||||
if(j == 0){
|
||||
|
||||
console.log('adverTxt : ', adverTxt);
|
||||
//미리보기에 내용 입력해 주기
|
||||
if(adverTxt.length > 0){
|
||||
|
||||
|
||||
@ -52,13 +52,13 @@ $(document).ready(function () {
|
||||
/* 실시간 글 적용 */
|
||||
/*var jbTxt = $("#textarea").text();
|
||||
$(".realtime").text(jbTxt);*/
|
||||
|
||||
/*
|
||||
$("#textarea, #smsTxtArea").on("change keyup paste", function () {
|
||||
var crtTxt = $(this).val();
|
||||
$(".realtime").text(crtTxt);
|
||||
$(".none_txt").empty();
|
||||
});
|
||||
|
||||
*/
|
||||
$(".kakaotalksend_cont #textarea,.kakaotalkset_cont #textarea").on("change keyup paste", function () {
|
||||
var crtTxt = $(this).val();
|
||||
$(".template_text").text(crtTxt);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user