이준호 전자조정시스템 커밋
- sms, email 발송 페이지 tabulator 버전 커밋
This commit is contained in:
parent
3f84ab49cc
commit
54758de8fa
@ -85,4 +85,10 @@ public class SendMgrSMSController {
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/kccadr/sendMgr/smsSendMgr_tabulator.do")
|
||||
public String smsSendMgrPage_tabulator() {
|
||||
|
||||
return "/kccadr/sendMgr/smsSendMgr_tabulator";
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,10 @@
|
||||
*/
|
||||
%>
|
||||
|
||||
<link href="/tabulator/dist/css/tabulator.css" rel="stylesheet">
|
||||
<!-- <link href="/tabulator/dist/css/tabulator.css" rel="stylesheet"> -->
|
||||
<!-- <link href="/tabulator/dist/css/tabulator_bulma.min.css" rel="stylesheet"> -->
|
||||
<link href="/tabulator/dist/css/tabulator_modern.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
|
||||
<!-------------------------- tabulator use js ---------------------------------->
|
||||
@ -117,21 +120,36 @@
|
||||
clipboard:true,
|
||||
reactiveData:true,
|
||||
clipboardPasteAction:"replace",
|
||||
validationMode:"highlight",
|
||||
columns:[
|
||||
{title:"메일주소", field:"mailAdress", width:200, editor:true},
|
||||
{formatter:"buttonCross", width:30, hozAlign:"center",
|
||||
{title:"메일주소", field:"mailAdress", width:200, editor:true},
|
||||
{formatter:"buttonCross", width:30, hozAlign:"center", headerSort:false,
|
||||
cellClick:function(e, cell){
|
||||
$("#tabulatorArea").tabulator("deleteRow", 0);
|
||||
cell.getRow().delete();
|
||||
}
|
||||
}
|
||||
],
|
||||
]
|
||||
});
|
||||
|
||||
//메일추가 클릭 시 tabulator에 추가
|
||||
document.getElementById("emailAdd").addEventListener("click", function(){
|
||||
var inputEmail = $("#callTo").val();
|
||||
|
||||
if(inputEmail == "" || inputEmail == null){
|
||||
alert("메일주소를 입력해 주세요");
|
||||
return;
|
||||
}
|
||||
|
||||
var taxExptext = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
|
||||
if(taxExptext.test(inputEmail)==false){
|
||||
alert("이메일주소 형식이 올바르지 않습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
tabledata.push({mailAdress:inputEmail});
|
||||
$("#callTo").val('');
|
||||
// var test = $("#tabulatorArea").tabulator("getInvalidCells");
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
@ -184,7 +202,7 @@
|
||||
<input type="text" class="write_info" id="callTo" name="callTo" placeholder="email주소를 입력하세요" onfocus="this.placeholder=''" onblur="this.placeholder='email주소를 입력하세요'">
|
||||
<button type="button" class="btnType01" id="emailAdd">메일추가</button>
|
||||
</br>
|
||||
<div id="tabulatorArea" ></div>
|
||||
<div id="tabulatorArea" style="border: 1px solid #d5d5d5; margin: 20px 0 0 0; border-radius: 10px;"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -0,0 +1,212 @@
|
||||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
<%@ taglib prefix="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%>
|
||||
<%
|
||||
/**
|
||||
* @Class Name : smsSendMgr.do
|
||||
* @Description : SMS 발송 화면
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------- -------- ---------------------------
|
||||
* @ 2023.09.13 원영현 최초 생성
|
||||
* @author 원영현
|
||||
* @since 2023.09.13
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
%>
|
||||
|
||||
<link href="/tabulator/dist/css/tabulator_modern.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
|
||||
<!-------------------------- tabulator use js ---------------------------------->
|
||||
<script type="text/javascript" src="/tabulator/jquery-ui-1.13.2.custom/external/jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="/tabulator/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/tabulator/dist/js/tabulator.min.js"></script>
|
||||
<script type="text/javascript" src="/tabulator/dist/js/jquery_wrapper.js"></script>
|
||||
<!-------------------------- tabulator use js ---------------------------------->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
tabulator_create();
|
||||
});
|
||||
|
||||
function fnSmsSend(){
|
||||
|
||||
|
||||
var phone = $("#tabulatorArea").tabulator("getData", "phone");
|
||||
|
||||
var sendLength = phone.length;
|
||||
var sendMsg = $("#sendMsg").val();
|
||||
|
||||
|
||||
if(sendLength == 0){
|
||||
alert("수신번호를 입력해 주세요");
|
||||
return;
|
||||
}
|
||||
if(sendMsg == ""){
|
||||
alert("발송내용을 입력해 주세요");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//배열 생성
|
||||
var phoneArr = new Array(sendLength);
|
||||
for(var i=0; i < sendLength; i++){
|
||||
phoneArr[i] = phone[i].phone;
|
||||
}
|
||||
$("#phoneList").val(phoneArr);
|
||||
|
||||
|
||||
var data = new FormData(document.smsForm);
|
||||
$.ajax({
|
||||
type: "POST"
|
||||
, url: "/kccadr/sendMgr/smsSendMgrAjax.do"
|
||||
, data: data
|
||||
, dataType:'json'
|
||||
, async: false
|
||||
, processData: false
|
||||
, contentType: false
|
||||
, cache: false
|
||||
, success: function (returnData, status) {
|
||||
console.log(returnData.result);
|
||||
if(returnData.result == 'SUCCESS'){
|
||||
alert("문자발송요청에 성공하였습니다.");
|
||||
location.reload();
|
||||
}else{
|
||||
alert(returnData.message);
|
||||
}
|
||||
}
|
||||
,error: function (e) {
|
||||
alert("요청에 실패하였습니다.");
|
||||
console.log("ERROR : ", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function tabulator_create(){
|
||||
|
||||
var tabledata = [
|
||||
];
|
||||
|
||||
//Build Tabulator
|
||||
//구현 편의성을 위해 jquery 로 만들기
|
||||
// jquery로 만들어서 jquery로 함수 호출 가능
|
||||
$("#tabulatorArea").tabulator({
|
||||
//table setup options
|
||||
height:"500px",
|
||||
data:tabledata,
|
||||
layout:"fitDataTable",
|
||||
clipboard:true,
|
||||
reactiveData:true,
|
||||
clipboardPasteAction:"replace",
|
||||
validationMode:"highlight",
|
||||
columns:[
|
||||
{title:"수신번호", field:"phone", width:200, editor:true},
|
||||
{formatter:"buttonCross", width:30, hozAlign:"center", headerSort:false,
|
||||
cellClick:function(e, cell){
|
||||
cell.getRow().delete();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//메일추가 클릭 시 tabulator에 추가
|
||||
document.getElementById("phoneAdd").addEventListener("click", function(){
|
||||
var inputPhone = $("#callTo").val();
|
||||
|
||||
if(inputPhone == "" || inputPhone == null){
|
||||
alert("수신번호를 입력해 주세요");
|
||||
return;
|
||||
}
|
||||
|
||||
var taxExptext = /^[0-9]{3}[0-9]{4}[0-9]{4}$/;
|
||||
if(taxExptext.test(inputPhone)==false){
|
||||
alert("휴대폰 번호 형식이 올바르지 않습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
tabledata.push({phone:inputPhone});
|
||||
$("#callTo").val('');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<form id="smsForm" name="smsForm" method="post">
|
||||
<input type="hidden" id="phoneList" name="phoneList"/>
|
||||
<!-- cont -->
|
||||
<div class="cont_wrap">
|
||||
<div class="box">
|
||||
<!-- cont_tit -->
|
||||
<div class="cont_tit">
|
||||
<h2>SMS 발송</h2>
|
||||
<ul class="cont_nav">
|
||||
<li class="home"><a href="/"><i></i></a></li>
|
||||
<li>
|
||||
<p>발송 관리</p>
|
||||
</li>
|
||||
<li>
|
||||
<span class="cur_nav">SMS 발송</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- //cont_tit -->
|
||||
|
||||
<div class="cont">
|
||||
<!-- list_상세 -->
|
||||
<div class="tbType02">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width: 220px;">
|
||||
<col style="width: auto;">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>발송내용</th>
|
||||
<td>
|
||||
<textarea name="sendMsg" id="sendMsg" cols="30" rows="10"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>수신번호</th>
|
||||
<td>
|
||||
<div class="input_form">
|
||||
<input type="text" class="write_info" id="callTo" name="callTo" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="번호를 입력하세요" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'">
|
||||
<button type="button" class="btnType01" id="phoneAdd">번호추가</button>
|
||||
</br>
|
||||
<div id="tabulatorArea" style="border: 1px solid #d5d5d5; margin: 20px 0 0 0; border-radius: 10px;"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- //list_상세 -->
|
||||
|
||||
<!-- btn_wrap -->
|
||||
<div class="btn_wrap btn_layout01">
|
||||
<div class="area_left">
|
||||
</div>
|
||||
<div class="area_right">
|
||||
<button class="btnType02" onclick="fnSmsSend(); return false;">발송</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //btn_wrap -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //cont -->
|
||||
</form>
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user