309 lines
8.9 KiB
Plaintext
309 lines
8.9 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ page import="java.util.*"%>
|
|
<%@include file="/init.jsp"%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
<style type="text/css">
|
|
#uploadedFileArea, #specAttachFileList, #reqAttachFileList, #resAttachFileList {
|
|
height: auto;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function(){
|
|
fnc_setFileDropZone("dropzone", "${boardInfo.OBJID}", "${NOTICE_ATTACH_CODE}", "${NOTICE_ATTACH_NAME}", "fn_fileCallback",false);
|
|
|
|
fn_fileCallback();
|
|
|
|
|
|
//체크박스 전체선택/전체해제
|
|
$("#allCheck").click(function() {
|
|
if ($("#allCheck").prop("checked")) {
|
|
$("input[name=commentCheck]").prop("checked", true);
|
|
} else {
|
|
$("input[name=commentCheck]").prop("checked", false);
|
|
}
|
|
});
|
|
|
|
$(".File").click(function(){
|
|
var popup_width = 800;
|
|
var popup_height = 335;
|
|
|
|
var objId = $(this).attr("data-OBJID");
|
|
var docType =$(this).attr("data-docType");
|
|
var docTypeName = $(this).attr("data-docTypeName");
|
|
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
|
|
var url = "/common/FileDetailPopup.do"+params
|
|
|
|
fn_centerPopup(popup_width, popup_height, url);
|
|
});
|
|
|
|
//팝업창 크기고정
|
|
window.addEventListener("resize", function() {
|
|
window.resizeTo(800, 600);
|
|
});
|
|
|
|
});
|
|
|
|
|
|
//게시물쓰기
|
|
function fn_openNoticeContentsFormPopUp(parentObjId,objId){
|
|
window.open("","openNoticeContentsFormPopUp","width=526 height=380 menubar=no status=no");
|
|
|
|
var url = "/notice/openComentsFormPopUp.do";
|
|
var hiddenForm = document.hiddenForm;
|
|
|
|
hiddenForm.parentObjId.value = parentObjId;
|
|
hiddenForm.objId.value = objId;
|
|
hiddenForm.target = "openNoticeContentsFormPopUp";
|
|
hiddenForm.action = url;
|
|
hiddenForm.submit();
|
|
}
|
|
|
|
//게시물 저장
|
|
function save(){
|
|
if(confirm("저장하시겠습니까?")){
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/notice/saveNotice.do",
|
|
data:$("#form1").serialize(),
|
|
dataType:"JSON",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
},
|
|
success: function(result){
|
|
alert(result.message);
|
|
opener.fn_search();
|
|
self.close();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
//게시물 삭제
|
|
function del(){
|
|
if(confirm("삭제하시겠습니까?")){
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/notice/delNotice.do",
|
|
data:$("#form1").serialize(),
|
|
dataType:"JSON",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
},
|
|
success: function(result){
|
|
Swal.fire(result.message);
|
|
self.close();
|
|
opener.fn_search();
|
|
// 댓글 삭제 성공시 페이지 새로고침
|
|
window.location.reload()
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
//게시물 닫기
|
|
function closed(){
|
|
self.close();
|
|
}
|
|
|
|
|
|
|
|
|
|
//댓글 체크리스트 삭제
|
|
function fn_delete(){
|
|
if($("input[name=commentCheck]:checked").length > 0){
|
|
if(confirm("해당 댓글을 삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/notice/deleteContents.do",
|
|
type:"POST",
|
|
data:$('#form1').serialize(),
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
Swal.fire(data.msg);
|
|
opener.document.form1.submit();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}else{
|
|
Swal.fire("선택된 댓글이 없습니다.");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
//파일 업로드
|
|
function fn_fileCallback(){
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${boardInfo.OBJID}", "docType":"${NOTICE_ATTACH_CODE}"},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
|
|
if(0 < data.length){
|
|
//파일드롭다운 영역 hide
|
|
//첨부파일 목록 영역 show
|
|
$("#specAttachFileList").show();
|
|
$("#uploadedFileArea").empty();
|
|
|
|
$.each(data, function(i){
|
|
var appendText = "";
|
|
appendText+= "<tr>";
|
|
appendText+= " <td><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>"+data[i].REAL_FILE_NAME+"</a></td>";
|
|
appendText+= " <td><div class='delete_btn' onclick='javascript:fnc_deleteFile(\""+data[i].OBJID+"\", \"fn_fileCallback\")'></div></td>";
|
|
appendText+= "</tr>";
|
|
|
|
$("#uploadedFileArea").append(appendText);
|
|
});
|
|
}else{
|
|
$("#dropzone").show();
|
|
$("#specAttachFileList")
|
|
$("#uploadedFileArea").empty();
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body class="backcolor_light_blue" style="overflow-y: hidden;">
|
|
<form name="hiddenForm" id="hiddenForm" method="post">
|
|
<input type="hidden" name="objId" id="objId">
|
|
<input type="hidden" name="parentObjId" id="parentObjId" value="${boardInfo.OBJID}">
|
|
</form>
|
|
|
|
<form name="form1" id="form1" method="post">
|
|
<input type="hidden" name="objId" id="objId" value="${boardInfo.OBJID}">
|
|
<input type="hidden" name="systemType" id="systemType" value="${empty boardInfo.SYSTEM_TYPE? systemType:boardInfo.SYSTEM_TYPE}">
|
|
<input type="hidden" name="actionType" id="actionType" value="${param.actionType}">
|
|
<section>
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>공지사항</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap"">
|
|
<table class="pmsPopupForm"">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="77%">
|
|
<col width="10%">
|
|
<col width="3%">
|
|
</colgroup>
|
|
<tr>
|
|
<td class=input_title><label for="" class="">제목</label></td>
|
|
<td>
|
|
<input type="text" style="width:100%;"maxlength="100" class="text_area" name="title" id="title" value="${boardInfo.TITLE}">
|
|
</td>
|
|
<td class="input_title"><label for="">중요</label></td>
|
|
<td>
|
|
<input type="checkbox" name="important" id="important" ${!empty boardInfo.IMPORTANT? 'checked': ''} value="checked">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label for="">내용</label></td>
|
|
<td colspan="3">
|
|
<textarea class="" style="width:100%;" rows="10" name="reqContents" id="reqContents" placeholder="내용을 입력하세요.">${boardInfo.REQ_CONTENTS}</textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title" rowspan="2">
|
|
<label for="">첨부파일</label>
|
|
</td>
|
|
<td colspan="3">
|
|
<div id="dropzone" class="dropzone" style="width:98.8%;">Drag & Drop Files Here</div>
|
|
<div id="specAttachFileList" style="height:50px;">
|
|
<table id="uploadedFileAreaTable" class="spec_data_in_table">
|
|
<colgroup>
|
|
<col width="*">
|
|
<col width="3%">
|
|
</colgroup>
|
|
<tbody id="uploadedFileArea">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="btnCenterWrap">
|
|
<center class="center_btns_wrap">
|
|
<input type="button" id="saveBtn" value="저장" class="plm_btns" onclick="javascript:save();">
|
|
<input type="button" id="deleteBtn" value="삭제" class="plm_btns" onclick="javascript:del();">
|
|
<input type="button" id="closeBtn" value="닫기" class="plm_btns" onclick="javascript:closed();">
|
|
</center>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 댓글영역 -->
|
|
|
|
<div class="contents_page_basic_margin">
|
|
<br id="title" style="float: left;">COMMENTS
|
|
<div class="ascendig_text" style="float: right; padding-right: 14px;">
|
|
<!-- boardinfo.objid= 댓글작성의 objid -->
|
|
<a href="#" class="plm_btns" style="height: 20px" onclick="fn_openNoticeContentsFormPopUp('${boardInfo.OBJID}','');">댓글작성</a>
|
|
<input type="button" id="btnDelete" value="삭제" class="plm_btns" onclick="javascript:fn_delete()">
|
|
</div>
|
|
|
|
<div class="in_table_scroll_wrap _table2" style="height:130px; width:99.4%;;">
|
|
<table class="plm_table" style="width: 100%">
|
|
<colgroup>
|
|
<col width="2.5%" />
|
|
<col width="3.5%" />
|
|
<col width="15%" />
|
|
<col width="52%" />
|
|
<col width="15%" />
|
|
<col width="10%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
|
|
<td>no</td>
|
|
<td>작성자</td>
|
|
<td>내용</td>
|
|
<td>작성일</td>
|
|
<td>첨부파일</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="2.5%" />
|
|
<col width="3.5%" />
|
|
<col width="15%" />
|
|
<col width="52%" />
|
|
<col width="15%" />
|
|
<col width="10%" />
|
|
</colgroup>
|
|
<c:forEach var="item" items="${postComments}" varStatus="status">
|
|
<tr>
|
|
<td><input type='checkbox' name='commentCheck' value="${item.COMMENT_OBJID}"></td>
|
|
<td title="${item.RNUM}">${item.RNUM}</td>
|
|
<td title="${item.U_NAME}">${item.U_NAME}</td>
|
|
<td title="${item.CONTENTS}">${item.CONTENTS}</td>
|
|
<td>${item.REGDATE_Y_M_D}</td>
|
|
<td><a href="#" class="File file_${item.FILE_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="CONTENTS_ATTACH_CODE" data-docTypeName="댓글 첨부파일"></a></td>
|
|
</tr>
|
|
</c:forEach>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |