퍼블 수정에 따른 보완 처리

This commit is contained in:
KNKIM 2021-12-07 17:21:56 +09:00
parent 0c6b56f51b
commit a3cd82e1c6
6 changed files with 42 additions and 27 deletions

View File

@ -172,6 +172,10 @@ public class ArticleVO extends PagingVO {
public String getRegNm() {
return regNm;
}
public String getRegNmSec() {
if(StringUtil.isEmpty(regNm)) return null;
return StringUtil.maskName(regNm);
}
public void setRegNm(String regNm) {
this.regNm = regNm;
}

View File

@ -325,7 +325,9 @@ public class StringUtil extends StringUtils {
return name;
}
if (name.length() == 2) {
if (name.length() == 1) {
return "*";
} else if (name.length() == 2) {
return name.substring(0, 1) + "*";
} else if (name.length() > 2) {
String str = "";

View File

@ -48,6 +48,7 @@
$("#btnSearch").on("click", function(e) {
fn_searchArticle(1);
});
$("#searchKeyword").on("keydown", function(e) {
if(e.keyCode == 13) {
fn_searchArticle(1);
@ -127,16 +128,16 @@
}
// 기존 데이터 CLEAR
$( ".list-notice thead").not('.t-tit-line').not('.no-result').remove();
$(".list-notice tbody tr").filter('.tableTrData').remove();
if(!jsonObj.data || jsonObj.data.length <= 0 ) {
$(".list-notice li.no-result").show();
$(".list-notice tbody tr.no-result").show();
} else {
$(".list-notice li.no-result").hide();
$(".list-notice tbody tr.no-result").hide();
// 출력
$.each(jsonObj.data,function(key,obj) {
var li = $(document.createElement('tr'));
var li = $('<tr class="tableTrData" />');
li.append($('<td />').attr('class', 't-num').html(obj.rno));
li.append($('<td />').attr('class', 't-tit').html("<a href=\"javascript:void(0)\" onclick=\"fn_viewDetail('" + obj.articleId + "')\">" +
(obj.notiYn == "Y" ? '<span>공지</span>' : '') +
@ -157,6 +158,13 @@
});
}
function fn_checkEnter() {
if (window.event.keyCode == 13) {
fn_searchArticle(1);
return false;
}
}
</script>
@ -210,7 +218,7 @@
</div>
<div class="list-input">
<input type="text" id="searchKeyword" name="searchKeyword" placeholder="검색어를 입력하세요" title="검색어" value="${searchArticle.searchKeyword }" maxlength="20" >
<input type="text" id="searchKeyword" name="searchKeyword" placeholder="검색어를 입력하세요" title="검색어" value="${searchArticle.searchKeyword }" onkeydown="fn_checkEnter()" maxlength="20" >
<label for="searchKeyword" style="display:none">검색어</label>
<label for="btnSearch">
<button name="btnSearch" id="btnSearch" type="button" title="검색">검색</button>
@ -225,7 +233,7 @@
<table class="list-notice">
<caption>공지사항 목록 표 NO, 제목, 등록자, 등록일, 첨부로 구성</caption>
<thead class="t-tit-line">
<tr>
<tr class="tableHeader">
<th class="t-num">NO</th>
<th class="t-tit">제목</th>
<th class="t-writer">등록자</th>
@ -235,7 +243,7 @@
</thead>
<tbody>
<tr class="no-result" style="display:none;">
<td>검색결과가 없습니다.</td>
<td colspan="5">검색결과가 없습니다.</td>
</tr>
</tbody>
</table>

View File

@ -48,6 +48,7 @@ $( document ).ready(function() {
$("#btnSearch").on("click", function(e) {
fn_searchArticle(1);
});
$("#searchKeyword").on("keydown", function(e) {
if(e.keyCode == 13) {
fn_searchArticle(1);

View File

@ -50,9 +50,6 @@
}
});
//초기 자료 조회
fn_searchArticle(1);
// 메시지 표출
if(!gfn_isEmpty('${message}')) {
setTimeout(function() {
@ -60,6 +57,9 @@
}, 1000); // 화면 표출되도록 딜레이 줌
}
//초기 자료 조회
fn_searchArticle();
}); // document ready
@ -140,23 +140,22 @@
}
// 기존 데이터 CLEAR
$( ".list-notice thead").not('.t-tit-line').not('.no-result').remove();
$(".list-notice tbody tr").filter('.tableTrData').remove();
if(!jsonObj.data || jsonObj.data.length <= 0 ) {
$(".list-notice .no-result").show();
$(".list-notice tbody tr.no-result").show();
} else {
$(".list-notice .no-result").hide();
$(".list-notice tbody tr.no-result").hide();
// 출력
$.each(jsonObj.data,function(key,obj) {
var li = $(document.createElement('tr'));
var li = $('<tr class="tableTrData" />');
li.append($('<td />').attr('class', 't-num').html(obj.rno));
li.append($('<td />').attr('class', 't-tit').html("<a href=\"javascript:void(0)\" onclick=\"fn_viewDetail('" + obj.articleId + "','" + obj.secretYn + "','" + obj.myQnaYn + "')\">" +
obj.title +
(obj.secretYn == "Y" ? '<img src="/images/icon/icon-password.png" alt="자물쇠 아이콘">&nbsp;' : '') +
"</a>"));
li.append($('<td />').attr('class', 't-writer').html(obj.regNm));
li.append($('<td />').attr('class', 't-writer').html(obj.regNmSec));
li.append($('<td />').attr('class', 't-date').html(obj.regDd));
li.append($('<td />').attr('class', 't-answer').html((obj.answerYn == "Y" ? '<span class="compl">답변완료</span>' : '<span class="wait">답변대기</span>')));
@ -201,17 +200,10 @@
//게시글 작성으로 이동
function fn_newArticle() {
<sec:authorize access="not isAuthenticated()">
alert("로그인 후, 이용하여 주시기 바랍니다.");
return false;
</sec:authorize>
<sec:authorize access="isAuthenticated()">
$("#articleNo").val("");
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/insertQnaForm.do");
$('#articleForm').removeAttr('onsubmit');
$("#articleForm").submit();
</sec:authorize>
}
</script>
@ -297,7 +289,7 @@
</thead>
<tbody>
<tr class="no-result" style="display:none;">
<td>검색결과가 없습니다.</td>
<td colspan="5">검색결과가 없습니다.</td>
</tr>
</tbody>
</table>

View File

@ -46,7 +46,13 @@ $( document ).ready(function() {
//목록으로 이동
function fn_list() {
$("#articleForm").submit();
if($("#searchQuestionType").val() == "USER") {
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/listMyQnas.do");
} else {
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/listQnas.do");
}
$("#articleForm").submit();
}
function fn_update() {
@ -187,6 +193,8 @@ function fn_downloadFile(attachFileId, fileSn) {
<input type="hidden" name="searchType" id="searchType" title="검색구분" value="${searchArticle.searchType}" />
<input type="hidden" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchArticle.searchKeyword}" />
<input type="hidden" name="articleId" id="articleId" title="선택글번호" value="${searchArticle.articleId}" />
<input type="hidden" name="searchQuestionType" id="searchQuestionType" value="${searchArticle.searchQuestionType}" />
</form>
<!-- 첨부파일 다운로드용 폼 -->