2021-12-15 09:33:47 +00:00
|
|
|
$(function(){
|
|
|
|
|
setSearchCondition();
|
|
|
|
|
|
|
|
|
|
$("#dateSelectorDiv").datepicker({
|
|
|
|
|
format: "yyyy-mm-dd",
|
|
|
|
|
language: "ko"
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '.contentTr', function (){
|
|
|
|
|
$(".contentCheckBox").prop('checked', false);
|
|
|
|
|
const target = $(this).find(".contentCheckBox")[0];
|
|
|
|
|
target.checked = true;
|
|
|
|
|
const selectedTab = $(".nav-tabs").find(".active")[0].id;
|
|
|
|
|
if(selectedTab === "contentTab"){
|
|
|
|
|
getBoardContent(target.value);
|
|
|
|
|
}else if(selectedTab === "logTab"){
|
|
|
|
|
getBoardLog(target.value);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2021-12-16 08:36:05 +00:00
|
|
|
$(document).on('change', '#fileCheckAll', function (){
|
|
|
|
|
$(".fileCheckBox").prop("checked", this.checked);
|
|
|
|
|
})
|
|
|
|
|
|
2021-12-15 09:33:47 +00:00
|
|
|
$(document).on('click', '#contentTab', function (){
|
|
|
|
|
getBoardContent(getContentSeq())
|
|
|
|
|
})
|
|
|
|
|
$(document).on('click', '#logTab', function (){
|
|
|
|
|
getBoardLog(getContentSeq())
|
|
|
|
|
})
|
|
|
|
|
|
2021-12-16 08:36:05 +00:00
|
|
|
$(document).on('click', '.fileDownLink', function (){
|
|
|
|
|
let url = "/board/fileDownload?"
|
|
|
|
|
url += "contentSeq="+Number($("#detailViewContentSeq").val());
|
|
|
|
|
url += "&fileSeq="+$(this).attr("data-fileseq");
|
|
|
|
|
window.open(encodeURI(url));
|
|
|
|
|
})
|
|
|
|
|
$(document).on('click', '#zipDownBtn', function (){
|
|
|
|
|
const checkFiles = $(".fileCheckBox:checked");
|
|
|
|
|
if(checkFiles.length>0){
|
|
|
|
|
let url = "/board/fileDownloadToZip?"
|
|
|
|
|
url += "contentSeq="+Number($("#detailViewContentSeq").val());
|
|
|
|
|
checkFiles.each(function (idx, el){
|
|
|
|
|
url += "&fileSeq="+Number($(el).attr("data-fileseq"))
|
|
|
|
|
});
|
|
|
|
|
window.open(encodeURI(url));
|
|
|
|
|
}else{
|
|
|
|
|
alert("선택된 파일이 없습니다.")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2021-12-15 09:33:47 +00:00
|
|
|
function getContentSeq(){
|
|
|
|
|
return $(".contentCheckBox:checked").val();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getBoardContent(contentSeq){
|
|
|
|
|
if(contentSeq !== undefined){
|
2021-12-16 08:36:05 +00:00
|
|
|
const viewContentSeq = $("#detailViewContentSeq").val();
|
|
|
|
|
if(contentSeq !== viewContentSeq){
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/board/selectBoardContent',
|
|
|
|
|
data: {contentSeq: contentSeq},
|
|
|
|
|
type: 'GET',
|
|
|
|
|
dataType:"html",
|
|
|
|
|
success: function(html){
|
|
|
|
|
$("#contentDiv").empty().append(html)
|
|
|
|
|
const viewCntTd = $(".contentCheckBox:checked").parents("tr").find(".viewCntTd");
|
|
|
|
|
viewCntTd.text(Number(viewCntTd.text())+1);
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
2021-12-15 09:33:47 +00:00
|
|
|
|
2021-12-16 08:36:05 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2021-12-15 09:33:47 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function getBoardLog(contentSeq){
|
|
|
|
|
if(contentSeq !== undefined){
|
2021-12-16 08:48:09 +00:00
|
|
|
$.ajax({
|
|
|
|
|
url: '/board/selectBoardLog',
|
|
|
|
|
data: {contentSeq: contentSeq},
|
|
|
|
|
type: 'GET',
|
|
|
|
|
dataType:"html",
|
|
|
|
|
success: function(html){
|
|
|
|
|
$("#logDiv").empty().append(html)
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
2021-12-15 09:33:47 +00:00
|
|
|
|
2021-12-16 08:48:09 +00:00
|
|
|
}
|
|
|
|
|
});
|
2021-12-15 09:33:47 +00:00
|
|
|
}
|
|
|
|
|
}
|