feat: 게시판관리 진행
parent
4c22683469
commit
0faee76a41
@ -1,50 +0,0 @@
|
||||
package kr.xit.framework.biz.mng.bbs.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kr.xit.framework.biz.mng.bbs.mapper.IBbsCreateMgtMapper;
|
||||
import kr.xit.framework.biz.mng.bbs.model.XitBbsCreateMngVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BbsCreateMgtService implements IBbsCreateMgtService{
|
||||
|
||||
private final IBbsCreateMgtMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<XitBbsCreateMngVO> findBbsCreateList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
|
||||
return mapper.selectBbsMastrs(paraMap, rowBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<XitBbsCreateMngVO> findBbsCreateList(final T t) {
|
||||
return mapper.selectBbsMastrs(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> XitBbsCreateMngVO findBbsCreate(final T t) {
|
||||
return mapper.selectBbsMastr(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBbsCreate(final XitBbsCreateMngVO vo) {
|
||||
vo.setFrstRegisterId(getUserUniqId());
|
||||
mapper.insertBbsMastr(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyBbsCreate(final XitBbsCreateMngVO vo) {
|
||||
vo.setLastUpdusrId(getUserUniqId());
|
||||
mapper.updateBbsMastr(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void removeBbsCreate(final T t) {
|
||||
mapper.deleteBbsMastr(t);
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package kr.xit.framework.biz.mng.bbs.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kr.xit.framework.biz.mng.bbs.mapper.IBbsUseMgtMapper;
|
||||
import kr.xit.framework.biz.mng.bbs.model.XitBbsUseMngVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BbsUseMgtService implements IBbsUseMgtService{
|
||||
|
||||
private final IBbsUseMgtMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<XitBbsUseMngVO> findBbsPrcuseList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
|
||||
return mapper.selectBbsPrcuseList(paraMap, rowBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<XitBbsUseMngVO> findBbsPrcuseList(T t) {
|
||||
return mapper.selectBbsPrcuseList(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> XitBbsUseMngVO findBbsPrcuse(T t) {
|
||||
return mapper.selectBbsPrcuse(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBbsPrcuse(XitBbsUseMngVO vo) {
|
||||
vo.setFrstRegisterId(getUserUniqId());
|
||||
mapper.insertBbsPrcuse(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyBbsPrcuse(XitBbsUseMngVO vo) {
|
||||
vo.setLastUpdusrId(getUserUniqId());
|
||||
mapper.updateBbsPrcuse(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void removeBbsPrcuse(T t) {
|
||||
mapper.deleteBbsPrcuse(t);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package kr.xit.framework.biz.mng.bbs.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kr.xit.framework.biz.mng.bbs.mapper.IBoardCreateMgtMapper;
|
||||
import kr.xit.framework.biz.mng.bbs.model.XitBbsCreateMngVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BoardCreateMgtService implements IBoardCreateMgtService {
|
||||
|
||||
private final IBoardCreateMgtMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<XitBbsCreateMngVO> findBoardCreateList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
|
||||
return mapper.selectBoardMastrs(paraMap, rowBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<XitBbsCreateMngVO> findBoardCreateList(final T t) {
|
||||
return mapper.selectBoardMastrs(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> XitBbsCreateMngVO findBoardCreate(final T t) {
|
||||
return mapper.selectBoardMastr(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBoardCreate(final XitBbsCreateMngVO vo) {
|
||||
vo.setFrstRegisterId(getUserUniqId());
|
||||
mapper.insertBoardMastr(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyBoardCreate(final XitBbsCreateMngVO vo) {
|
||||
vo.setLastUpdusrId(getUserUniqId());
|
||||
mapper.updateBoardMastr(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void removeBoardCreate(final T t) {
|
||||
mapper.deleteBoardMastr(t);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package kr.xit.framework.biz.mng.bbs.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kr.xit.framework.biz.mng.bbs.mapper.IBoardUseMgtMapper;
|
||||
import kr.xit.framework.biz.mng.bbs.model.XitBbsUseMngVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BoardUseMgtService implements IBoardUseMgtService {
|
||||
|
||||
private final IBoardUseMgtMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<XitBbsUseMngVO> findBoardPrcuseList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
|
||||
return mapper.selectBoardPrcuseList(paraMap, rowBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<XitBbsUseMngVO> findBoardPrcuseList(T t) {
|
||||
return mapper.selectBoardPrcuseList(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> XitBbsUseMngVO findBoardPrcuse(T t) {
|
||||
return mapper.selectBoardPrcuse(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBoardPrcuse(XitBbsUseMngVO vo) {
|
||||
vo.setFrstRegisterId(getUserUniqId());
|
||||
mapper.insertBoardPrcuse(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyBoardPrcuse(XitBbsUseMngVO vo) {
|
||||
vo.setLastUpdusrId(getUserUniqId());
|
||||
mapper.updateBoardPrcuse(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void removeBoardPrcuse(T t) {
|
||||
mapper.deleteBoardPrcuse(t);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,266 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="ufn" uri="/WEB-INF/tlds/egovfn.tld"%>
|
||||
<%@ taglib prefix="orderby" uri="/WEB-INF/tlds/orderby.tld" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
|
||||
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
|
||||
<validator:javascript formName="boardUseInf" staticJavascript="false" xhtml="true" cdata="false"/>
|
||||
<form id="boardUseInf" name="boardUseInf">
|
||||
<input type="hidden" name="mode" value="insert" />
|
||||
<input type="hidden" name="pageIndex" value="<c:out value='${searchVO.pageIndex}'/>" />
|
||||
|
||||
<div class="popup" style="min-width: 800px;">
|
||||
<div class="popup_inner" style="max-width: 800px;">
|
||||
<p class="pop_title">게시판 사용등록</p>
|
||||
|
||||
<table class="tbl03">
|
||||
<caption>게시판 사용등록</caption>
|
||||
<colgroup>
|
||||
<col style="width: 30%;"/>
|
||||
<col style="width: %;"/>
|
||||
<col style="width: %;"/>
|
||||
<col style="width: %;"/>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
게시판명<span style="color: red;">*</span>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<input name="bbsId" type="hidden" />
|
||||
<input style="width: 40%" name="bbsNm" type="text" size="40" value="" maxlength="40" title="게시판명" readonly />
|
||||
<a href="#LINK" id ="choiceLink" style="selector-dummy: expression(this.hideFocus=false);"><img src="<c:url value='/resources/images/img_search.gif' />"
|
||||
width="15" height="15" align="middle" alt="새창" /></a>
|
||||
<br/><form:errors path="bbsId" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
커뮤니티/통호회명
|
||||
<img src="<c:url value='/resources/images/required.gif' />" width="15" height="15" alt="required"/>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<select style="width: 40%" id="trgetType" name="trgetType" class="select" title="" >
|
||||
<option selected value=''>--선택하세요--</option>
|
||||
<option value="SYSTEM" >시스템</option>
|
||||
</select>
|
||||
<input type="hidden" name="trgetId" value="" />
|
||||
<input style="width: 40%" type="text" name="trgetNm" value="" size="40" title="" readOnly />
|
||||
<br/><form:errors path="trgetId" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="popup_btn">
|
||||
<span class="flr">
|
||||
<a href="#" class="btn blue" id="btnSave">저장</a>
|
||||
<a href="#" class="btn lightgray" id="btnClose">닫기</a>
|
||||
</span>
|
||||
</div>
|
||||
<!-- //등록버튼 -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- //popup -->
|
||||
</form>
|
||||
|
||||
<script type="text/javascript" src="<c:url value='/resources/framework/js/egov/showModalDialog.js'/>" ></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
XitBbsUseMng_input.init();
|
||||
});
|
||||
|
||||
function showModalDialogCallback(obj) {
|
||||
if(obj != null){
|
||||
document.boardUseInf.bbsId.value = obj['bbsId'];
|
||||
document.boardUseInf.bbsNm.value = obj['bbsNm'];
|
||||
}
|
||||
}
|
||||
/* *******************************
|
||||
* 게시판 사용관리 등록화면 Functions
|
||||
******************************* */
|
||||
var XitBbsUseMng_input = {
|
||||
/* ========================
|
||||
* 초기화
|
||||
======================== */
|
||||
init : function(){
|
||||
//날짜 입력 항목 설정
|
||||
|
||||
//닫기 버튼 EVENT 설정
|
||||
$("#btnClose").on({
|
||||
click : function(){
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
|
||||
//입력값 유효성 설정
|
||||
XitBbsUseMng_input.fn_setInputLimit();
|
||||
|
||||
|
||||
//저장 버튼 Event 설정
|
||||
$('#btnSave').on({
|
||||
click: function(){
|
||||
XitBbsUseMng_input.addData();
|
||||
}
|
||||
});
|
||||
$('#choiceLink').on({
|
||||
click:function(){
|
||||
//팝업 URL
|
||||
var url = "<c:url value='/framework/biz/mng/bbs/BbsCreateMng_choice_popup.do'/>";
|
||||
//팝업 가로/세로 사이즈(px)
|
||||
var w = 890;
|
||||
var h = 520;
|
||||
//팝업 위치 계산(가운데 정렬)
|
||||
var left = window.screenX + (window.outerWidth/2) - (w/2);
|
||||
var top = window.screenY + (window.outerHeight/2) - (h/2);
|
||||
//팝업 옵션
|
||||
var openParam = "width="+w+"px, height="+h+"px, resizable=no, scrollbars=yes, location=no, left="+left+"px, top="+top+"px";
|
||||
//팝업 OPEN
|
||||
window.open(url,"showdialog",openParam);
|
||||
}
|
||||
});
|
||||
$('#trgetType').on({
|
||||
change:function(event){
|
||||
var typeSelect = document.getElementById("trgetType");
|
||||
var value = typeSelect.options[document.getElementById("trgetType").selectedIndex].value
|
||||
|
||||
var retVal;
|
||||
var _strType = value;
|
||||
if (_strType == 'CMMNTY') {
|
||||
retVal = fn_egov_inqire_cmmnty();
|
||||
} else if (_strType == 'CLUB') {
|
||||
retVal = fn_egov_inqire_club();
|
||||
} else if (_strType == '') {
|
||||
retVal = "|";
|
||||
} else {
|
||||
retVal = "SYSTEM_DEFAULT_BOARD"+"|"+"시스템 활용";
|
||||
}
|
||||
if (retVal != null) {
|
||||
var tmp = retVal.split("|");
|
||||
document.boardUseInf.trgetId.value = tmp[0];
|
||||
document.boardUseInf.trgetNm.value = tmp[1];
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/* ========================
|
||||
* 입력값 언어 선택
|
||||
======================== */
|
||||
fn_showModalDialogCallback : function(obj){
|
||||
if(obj != null){
|
||||
document.boardUseInf.bbsId.value = obj['bbsId'];
|
||||
document.boardUseInf.bbsNm.value = obj['bbsNm'];
|
||||
}
|
||||
},
|
||||
fn_setInputLimit : function(){
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 조회
|
||||
======================== */
|
||||
findData : function(){
|
||||
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 등록
|
||||
======================== */
|
||||
addData : function(){
|
||||
if (!validateBoardUseInf(document.boardUseInf))
|
||||
return;
|
||||
if (!confirm('<spring:message code="common.regist.msg" />'))
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
var param = $("#boardUseInf").serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/bbs/BbsUseMng_insert_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitBbsUseMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 수정
|
||||
======================== */
|
||||
modifyData : function(){
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 삭제
|
||||
======================== */
|
||||
removeData : function(){
|
||||
},
|
||||
/* ========================
|
||||
* 유효성 검증
|
||||
-flag에 따라 유효성 검증을 분기처리한다.
|
||||
======================== */
|
||||
validate : function(flag){
|
||||
switch(flag){
|
||||
case 'update' : //수정
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
/* ========================
|
||||
* 페이지 이동
|
||||
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main )
|
||||
======================== */
|
||||
pageLink: function(flag, url, params){
|
||||
switch (flag) {
|
||||
case "move": //페이지 이동
|
||||
document.frmSearch.searchKeyword.value = "";
|
||||
document.frmSearch.action = url;
|
||||
document.frmSearch.submit();
|
||||
break;
|
||||
case "popup": //팝업 OPEN
|
||||
XitBbsUseMng_input.pagePopup(flag, url, params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ========================
|
||||
* 페이지 Open
|
||||
-팝업페이지를 Open 한다.
|
||||
======================== */
|
||||
pagePopup: function(flag, url, params){
|
||||
var popUrl = url;
|
||||
if(!(params == undefined || params == null)){
|
||||
popUrl += "?";
|
||||
popUrl += params;
|
||||
}
|
||||
var popTitle = '';
|
||||
var popOption = '';
|
||||
switch (flag) {
|
||||
case "adres": //주소 팝업 OPEN
|
||||
popTitle = "주소 찾기";
|
||||
popOption = "width=570px, height=420px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px;";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
window.open(popUrl, popTitle ,popOption);
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************
|
||||
* 처리결과메시지 출력
|
||||
******************************************************** */
|
||||
<c:if test="${!empty message}">alert("${message}");</c:if>
|
||||
</script>
|
@ -0,0 +1,160 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
|
||||
<c:set var="isUpdate" value="${!empty boardUseInf.bbsId}"/>
|
||||
<c:set var="bizName" value="게시판 사용"/>
|
||||
|
||||
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
|
||||
<validator:javascript formName="boardUseInf" staticJavascript="false" xhtml="true" cdata="false"/>
|
||||
|
||||
<div class="popup" style="min-width: 100px;">
|
||||
<div class="popup_inner" style="max-width: 800px;">
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp" %>
|
||||
|
||||
<form id="boardUseInf" name="boardUseInf">
|
||||
<table class="tbl03">
|
||||
<caption><c:out value="${bizName}"/> 등록 / 변경</caption>
|
||||
<colgroup>
|
||||
<col style="width: 20%;"/>
|
||||
<col/>
|
||||
<col/>
|
||||
<col/>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="required" scope="row" nowrap>
|
||||
<label for="bbsNm">게시판명</label>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<input id="bbsNm" title="게시판명" size="60" maxlength="60" value="${boardUseInf.bbsNm}"/>
|
||||
<input type="hidden" id="bbsId" value="${boardUseInf.bbsId}"/>
|
||||
<form:errors path="bbsNm" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" scope="row" nowrap>
|
||||
<label for="trgetNm">커뮤니티/동호회 명</label>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<c:choose>
|
||||
<c:when test="${not empty boardUseInf.cmmntyNm}">
|
||||
<c:out value="${boardUseInf.cmmntyNm}" />
|
||||
<input style="width: 40%" type="hidden" name="trgetNm" value="${boardUseInf.cmmntyNm}" size="40" title="" readOnly />
|
||||
</c:when>
|
||||
<c:when test="${not empty boardUseInf.clbNm}">
|
||||
<c:out value="${boardUseInf.clbNm}" />
|
||||
<input style="width: 40%" type="hidden" name="trgetNm" value="${boardUseInf.cmmntyNm}" size="40" title="" readOnly />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
(시스템 활용)
|
||||
<input style="width: 40%" type="hidden" name="trgetNm" value="(시스템 활용)" size="40" title="" readOnly />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<%-- <form:errors path="trgetNm" />--%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" scope="row" nowrap>
|
||||
<label>사용여부</label>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<input type="radio" name="useAt" class="validate-one-required" value="Y" <c:if test="${boardUseInf.useAt == 'Y' || !isUpdate}">checked</c:if>> 사용
|
||||
<input type="radio" name="useAt" class="validate-one-required" value="N" <c:if test="${boardUseInf.useAt == 'N'}">checked</c:if>> 사용중지
|
||||
<%-- <form:errors path="useAt" />--%>
|
||||
</td>
|
||||
</tr>
|
||||
<c:choose>
|
||||
<c:when test="${not empty boardUseInf.provdUrl}">
|
||||
<tr>
|
||||
<th width="20%" height="23" class="" nowrap >제공 URL</th>
|
||||
<td width="80%" nowrap colspan="3">
|
||||
<a href="<c:url value="${boardUseInf.provdUrl}?tilesDef=base" />" target="_blank">
|
||||
<c:url value="${boardUseInf.provdUrl}" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-use-btn.jsp" %>
|
||||
<!-- //등록버튼 -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- //popup -->
|
||||
|
||||
<script type="text/javascript" src="<c:url value='/resources/framework/js/egov/showModalDialog.js'/>" ></script>
|
||||
<script type="text/javascript">
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
let orgData;
|
||||
|
||||
/* *******************************
|
||||
* Biz function
|
||||
******************************* */
|
||||
const fnBiz = {
|
||||
add: () => {
|
||||
if (!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('add', {
|
||||
url: '<c:url value="/framework/biz/mng/bbs/addBoardPrcuse"/>'
|
||||
, data: $("#boardUseInf").serialize()
|
||||
})
|
||||
}
|
||||
,modify: () => {
|
||||
if (!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('modify', {
|
||||
url: '<c:url value="/framework/biz/mng/bbs/modifyBoardPrcuse"/>'
|
||||
,data: $("#boardUseInf").serialize()
|
||||
});
|
||||
}
|
||||
,remove: () => {
|
||||
$("input[name=useAt]").val('N');
|
||||
cmmBizAjax('remove', {
|
||||
url: '<c:url value="/framework/biz/mng/bbs/modifyBoardPrcuse"/>'
|
||||
,data: $("#boardUseInf").serialize()
|
||||
});
|
||||
}
|
||||
,validate: () => {
|
||||
if(orgData === $('form').serialize()){
|
||||
alert('변경된 내용이 없습니다.');
|
||||
return false;
|
||||
}
|
||||
if(!validateBoardUseInf(document.getElementById("boardUseInf"))) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* event
|
||||
**************************************************************************/
|
||||
$(() => {
|
||||
$('#btnRegist').on('click', () => {
|
||||
fnBiz.add();
|
||||
});
|
||||
|
||||
$('#btnModify').on('click', () => {
|
||||
fnBiz.modify();
|
||||
});
|
||||
|
||||
$('#btnPreview').on('click', () => {
|
||||
fnBiz.preview();
|
||||
});
|
||||
|
||||
$('#btnRemove').on('click', () => {
|
||||
fnBiz.remove();
|
||||
});
|
||||
});
|
||||
|
||||
/**************************************************************************
|
||||
* initialize
|
||||
**************************************************************************/
|
||||
$(document).ready(function () {
|
||||
orgData = $('form').serialize();
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue