QNA 등 템플릿 적용

This commit is contained in:
KNKIM 2021-11-04 18:15:13 +09:00
parent a5be071b81
commit 8db2f7292d
14 changed files with 871 additions and 520 deletions

View File

@ -37,6 +37,8 @@ public class ArticleVO extends PagingVO {
private String bdAttachFileId; /* 첨부파일아이디 */ private String bdAttachFileId; /* 첨부파일아이디 */
private String attachYn; /* 첨부파일존재여부 */ private String attachYn; /* 첨부파일존재여부 */
private List<AttachFileVO> attachFiles; /* 첨부파일목록 */ private List<AttachFileVO> attachFiles; /* 첨부파일목록 */
private List<AttachFileVO> removedAttachFiles; /* 삭제첨부파일목록 */
private String regId; /* 등록자아이디 */ private String regId; /* 등록자아이디 */
private String regNm; /* 등록자명 */ private String regNm; /* 등록자명 */
@ -333,4 +335,12 @@ public class ArticleVO extends PagingVO {
this.resultCode = resultCode; this.resultCode = resultCode;
} }
public List<AttachFileVO> getRemovedAttachFiles() {
return removedAttachFiles;
}
public void setRemovedAttachFiles(List<AttachFileVO> removedAttachFiles) {
this.removedAttachFiles = removedAttachFiles;
}
} }

View File

@ -12,6 +12,7 @@ import nlib.bbs.service.ArticleVO;
import nlib.bbs.service.AttachFileService; import nlib.bbs.service.AttachFileService;
import nlib.bbs.service.AttachFileVO; import nlib.bbs.service.AttachFileVO;
import nlib.bbs.service.QnaService; import nlib.bbs.service.QnaService;
import nlib.util.StringUtil;
import nlib.util.UUID; import nlib.util.UUID;
@Service("qnaService") @Service("qnaService")
@ -49,6 +50,19 @@ public class QnaServiceImpl extends BoardServiceImpl implements QnaService
articleVO.setResultMessage("정상적으로 등록되었습니다."); articleVO.setResultMessage("정상적으로 등록되었습니다.");
if(articleVO.getAttachFileCnt() > 0) { if(articleVO.getAttachFileCnt() > 0) {
addAttachFiles(articleVO);
}
return articleVO;
}
/**
* 첨부파일을 추가한다.
*
* @param articleVO
* @throws Exception
*/
public void addAttachFiles(ArticleVO articleVO) throws Exception {
int savedCnt = 0; int savedCnt = 0;
List<AttachFileVO> attachFileList = articleVO.getAttachFiles(); List<AttachFileVO> attachFileList = articleVO.getAttachFiles();
@ -74,10 +88,44 @@ public class QnaServiceImpl extends BoardServiceImpl implements QnaService
} else { } else {
articleVO.setResultMessage("게시글은 등록되었으나, 첨부파일그룹 등록에 실패하여 첨부파일 등록처리가 수행되지 않았습니다."); articleVO.setResultMessage("게시글은 등록되었으나, 첨부파일그룹 등록에 실패하여 첨부파일 등록처리가 수행되지 않았습니다.");
} }
} }
return articleVO;
/**
* 첨부파일을 삭제한다.
*
* @param articleVO
* @throws Exception
*/
public void removeAttachFiles(ArticleVO articleVO) throws Exception {
int savedCnt = 0;
List<AttachFileVO> attachFileList = articleVO.getRemovedAttachFiles();
if(attachFileList == null || attachFileList.size() < 1) return;
String attachFileId = attachFileList.get(0).getAttachFileId();
if(StringUtil.isNotEmpty(attachFileId)) {
// 첨부파일 삭제
for(int i=0; i<attachFileList.size(); i++) {
AttachFileVO attachFileVO = attachFileList.get(i);
int retAttFile = attachFileService.deleteAttachFile(attachFileVO);
savedCnt += retAttFile;
if(retAttFile < 1) {
log.error("insertArticle > 첨부파일 삭제에 실패하였습니다 : " + attachFileVO.getOrignlFileNm());
}
}
if(savedCnt != attachFileList.size()) {
articleVO.setResultMessage(String.format("총 %d개 파일 중 %개 파일만 정상 삭제되었습니다.", attachFileList.size(), savedCnt));
}
} else {
articleVO.setResultMessage("첨부파일그룹ID 정보가 누락되어 첨부파일 삭제가 불가합니다.");
}
return;
} }
/** /**
@ -86,8 +134,23 @@ public class QnaServiceImpl extends BoardServiceImpl implements QnaService
* @param reqVO * @param reqVO
* @return * @return
*/ */
public int updateArticle(ArticleVO articleVO) { public int updateArticle(ArticleVO articleVO) throws Exception {
return qnaDAO.updateArticle(articleVO); int updateRet = qnaDAO.updateArticle(articleVO);
// 첨부파일 추가
List<AttachFileVO> addedFiles = articleVO.getAttachFiles();
if(addedFiles != null && addedFiles.size() > 0) {
addAttachFiles(articleVO);
}
List<AttachFileVO> removedAttachFiles = articleVO.getRemovedAttachFiles();
if(removedAttachFiles != null && removedAttachFiles.size() > 0) {
removeAttachFiles(articleVO);
}
// 첨부파일 삭제
return updateRet;
} }
/** /**

View File

@ -177,7 +177,7 @@ public class QnaController extends NlibCommonController {
searchArticleVO = redirectSearchArticleVO; searchArticleVO = redirectSearchArticleVO;
} else { } else {
ArticleVO articleVO = qnaService.selectArticle(searchArticleVO); ArticleVO articleVO = qnaService.selectArticle(searchArticleVO);
if(articleVO != null && StringUtil.isEmpty(redirectSearchArticleVO.getTitle())) { if(articleVO != null && !StringUtil.isEmpty(articleVO.getTitle())) {
articleVO.setSearchKeyword(searchArticleVO.getSearchKeyword()); articleVO.setSearchKeyword(searchArticleVO.getSearchKeyword());
articleVO.setPageIndex(searchArticleVO.getPageIndex()); articleVO.setPageIndex(searchArticleVO.getPageIndex());
articleVO.setPageSize(searchArticleVO.getPageSize()); articleVO.setPageSize(searchArticleVO.getPageSize());
@ -332,6 +332,8 @@ public class QnaController extends NlibCommonController {
public String updateQnaArticle( public String updateQnaArticle(
HttpServletRequest request HttpServletRequest request
, ArticleVO articleVO , ArticleVO articleVO
, String fileList
, String removedfile
, RedirectAttributes redirectAttrs , RedirectAttributes redirectAttrs
, ModelMap model) throws Exception { , ModelMap model) throws Exception {
@ -346,6 +348,148 @@ public class QnaController extends NlibCommonController {
return "redirect:/bbs/insertQnaForm.do"; return "redirect:/bbs/insertQnaForm.do";
} }
//---------------------------
// 첨부파일 정보 설정
//---------------------------
if(StringUtil.isNotEmpty(fileList)) {
String fileListJsonStr = fileList;
if(fileListJsonStr.startsWith("&")) fileListJsonStr = StringEscapeUtils.unescapeHtml(fileListJsonStr);
if(fileListJsonStr.startsWith("\"")) fileListJsonStr = fileListJsonStr.substring(1);
if(fileListJsonStr.endsWith("\"")) fileListJsonStr = fileListJsonStr.substring(0, fileListJsonStr.length()-1);
fileListJsonStr = fileListJsonStr.replaceAll("\\\\", "");
log.debug("fileListJsonStr : " + fileListJsonStr);
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> fileListObj = null;
try {
fileListObj = mapper.readValue(fileListJsonStr, new TypeReference<List<Map<String, Object>>>() {
});
for (Map<String, Object> map : fileListObj) {
MapUtils.debugPrint(System.out, "map", map);
}
} catch (JsonMappingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JsonProcessingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(fileListObj != null && fileListObj.size() > 0) {
String attachFileId = (String)(fileListObj.get(0).get("attachFileId"));
if(StringUtil.isEmpty(attachFileId)) {
log.error("첨부파일 아이디(attachFileId) 값은 필수 항목입니다. 첨부파일 처리에 실패하였습니다. 그러나, 게시물 등록은 계속 진행됩니다.");
}
if(StringUtil.isNotEmpty(attachFileId)) {
articleVO.setBdAttachFileId(attachFileId);
String fileSStreCours = NlibProperty.getProperty("fileupload.base.path") + NlibProperty.getProperty("fileupload.bbs.qna.subpath") + "/";
List<AttachFileVO> attachFiles = new ArrayList<AttachFileVO>();
for(int i=0; i<fileListObj.size(); i++) {
Map finfo = fileListObj.get(i);
AttachFileVO fVO = new AttachFileVO();
fVO.setAttachFileId(attachFileId);
fVO.setFileStreCours(fileSStreCours);
fVO.setStreFileNm((String)finfo.get("streFileNm"));
fVO.setOrignlFileNm((String)finfo.get("orignlFileNm"));
fVO.setFileExtsn((String)finfo.get("fileExtsn"));
fVO.setFileSize(((Integer)finfo.get("fileSize")).intValue());
File f = new File(fVO.getFileStreCours() + fVO.getStreFileNm());
if(!f.exists() || !f.isFile()) continue;
attachFiles.add(fVO);
}
articleVO.setAttachFiles(attachFiles);
}
}
}
// 첨부파일 삭제
if(StringUtil.isNotEmpty(removedfile)) {
String removedFileListJsonStr = removedfile;
if(removedFileListJsonStr.startsWith("&")) removedFileListJsonStr = StringEscapeUtils.unescapeHtml(removedFileListJsonStr);
if(removedFileListJsonStr.startsWith("\"")) removedFileListJsonStr = removedFileListJsonStr.substring(1);
if(removedFileListJsonStr.endsWith("\"")) removedFileListJsonStr = removedFileListJsonStr.substring(0, removedFileListJsonStr.length()-1);
removedFileListJsonStr = removedFileListJsonStr.replaceAll("\\\\", "");
log.debug("removedFileListJsonStr : " + removedFileListJsonStr);
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> removedFileListObj = null;
try {
removedFileListObj = mapper.readValue(removedFileListJsonStr, new TypeReference<List<Map<String, Object>>>() {
});
for (Map<String, Object> map : removedFileListObj) {
MapUtils.debugPrint(System.out, "map", map);
}
} catch (JsonMappingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JsonProcessingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(removedFileListObj != null && removedFileListObj.size() > 0) {
String attachFileId = (String)(removedFileListObj.get(0).get("attachFileId"));
if(StringUtil.isEmpty(attachFileId)) {
log.error("첨부파일 아이디(attachFileId) 값은 필수 항목입니다. 첨부파일 삭제에 실패하였습니다. 그러나, 게시물 등록은 계속 진행됩니다.");
}
if(StringUtil.isNotEmpty(attachFileId)) {
articleVO.setBdAttachFileId(attachFileId);
String fileSStreCours = NlibProperty.getProperty("fileupload.base.path") + NlibProperty.getProperty("fileupload.bbs.qna.subpath") + "/";
List<AttachFileVO> removedAttachFiles = new ArrayList<AttachFileVO>();
for(int i=0; i<removedFileListObj.size(); i++) {
Map remFinfo = removedFileListObj.get(i);
AttachFileVO fVO = new AttachFileVO();
String fileSnStr = (String)remFinfo.get("fileSn");
if(StringUtil.isEmpty(fileSnStr)) {
log.error("파일순번 정보가 존재하지 않습니다. : " + (String)remFinfo.get("streFileNm"));
continue;
}
int fileSn = 0;
try {
fileSn = Integer.parseInt(fileSnStr);
}catch(Exception e) {
log.error("삭제할 파일순번 정보 오류입니다. : " + fileSnStr + " OF " + (String)remFinfo.get("streFileNm"));
continue;
}
fVO.setAttachFileId(attachFileId);
fVO.setStreFileNm((String)remFinfo.get("streFileNm"));
fVO.setFileSn(fileSn);
fVO.setFileSize(((Integer)remFinfo.get("fileSize")).intValue());
File f = new File(fVO.getFileStreCours() + fVO.getStreFileNm());
if(!f.exists() || !f.isFile()) continue;
removedAttachFiles.add(fVO);
}
articleVO.setRemovedAttachFiles(removedAttachFiles);
}
}
}
// 수정 처리 // 수정 처리
int ret = qnaService.updateArticle(articleVO); int ret = qnaService.updateArticle(articleVO);
if(ret < 1) { if(ret < 1) {

View File

@ -73,6 +73,8 @@
, NOW() , NOW()
, 'Y' , 'Y'
) )
ON DUPLICATE KEY
UPDATE REG_DD = REG_DD;
</insert> </insert>
<insert id="insertAttachFile" parameterType="AttachFileVO"> <insert id="insertAttachFile" parameterType="AttachFileVO">

View File

@ -36,6 +36,7 @@
, IFNULL(A.ANSWER_YN, 'N') AS ANSWER_YN , IFNULL(A.ANSWER_YN, 'N') AS ANSWER_YN
, IFNULL(A.USE_YN, 'Y') AS USE_YN , IFNULL(A.USE_YN, 'Y') AS USE_YN
, IFNULL(A.SECRET_YN, 'N') AS SECRET_YN , IFNULL(A.SECRET_YN, 'N') AS SECRET_YN
, IFNULL(A.EMAIL_RECV_YN, 'N') AS EMAIL_RECV_YN
, A.VIEW_CNT , A.VIEW_CNT
, CASE WHEN A.BD_ATTACH_FILE_ID IS NULL OR A.BD_ATTACH_FILE_ID = '' THEN 'N' ELSE 'Y' END AS ATTACH_YN , CASE WHEN A.BD_ATTACH_FILE_ID IS NULL OR A.BD_ATTACH_FILE_ID = '' THEN 'N' ELSE 'Y' END AS ATTACH_YN
, DATE_FORMAT(A.REG_DD, '%Y-%m-%d') AS REG_DD , DATE_FORMAT(A.REG_DD, '%Y-%m-%d') AS REG_DD
@ -87,6 +88,7 @@
, A.TITLE , A.TITLE
, A.CONTENT , A.CONTENT
, IFNULL(A.ANSWER_YN, 'N') AS ANSWER_YN , IFNULL(A.ANSWER_YN, 'N') AS ANSWER_YN
, IFNULL(A.EMAIL_RECV_YN, 'N') AS EMAIL_RECV_YN
, A.ANSWER , A.ANSWER
, IFNULL(A.USE_YN, 'Y') AS USE_YN , IFNULL(A.USE_YN, 'Y') AS USE_YN
, IFNULL(A.SECRET_YN, 'N') AS SECRET_YN , IFNULL(A.SECRET_YN, 'N') AS SECRET_YN
@ -94,6 +96,7 @@
, A.BD_ATTACH_FILE_ID , A.BD_ATTACH_FILE_ID
, CASE WHEN A.BD_ATTACH_FILE_ID IS NULL OR A.BD_ATTACH_FILE_ID = '' THEN 'N' ELSE 'Y' END AS ATTACH_YN , CASE WHEN A.BD_ATTACH_FILE_ID IS NULL OR A.BD_ATTACH_FILE_ID = '' THEN 'N' ELSE 'Y' END AS ATTACH_YN
, DATE_FORMAT(A.REG_DD, '%Y-%m-%d') AS REG_DD , DATE_FORMAT(A.REG_DD, '%Y-%m-%d') AS REG_DD
, DATE_FORMAT(A.MOD_DD, '%Y-%m-%d') AS MOD_DD
, C.USER_NM AS REG_NM , C.USER_NM AS REG_NM
, CASE , CASE
WHEN #{loginedMbInfoId} IS NULL OR #{loginedMbInfoId} = '' THEN 'N' WHEN #{loginedMbInfoId} IS NULL OR #{loginedMbInfoId} = '' THEN 'N'
@ -114,7 +117,6 @@
ON A.REG_ID = C.USER_ID ON A.REG_ID = C.USER_ID
WHERE A.QNA_ID = #{articleId} WHERE A.QNA_ID = #{articleId}
AND IFNULL(A.USE_YN, 'Y') = 'Y' AND IFNULL(A.USE_YN, 'Y') = 'Y'
ORDER BY A.REG_DD DESC
]]> ]]>
</select> </select>

View File

@ -30,22 +30,19 @@
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> <%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<c:set var="pageTitle">Q&amp;A</c:set>
<c:if test='${searchArticle.articleId != null and searchArticle.articleId != ""}'> <c:if test='${searchArticle.articleId != null and searchArticle.articleId != ""}'>
<c:set var="pageTitle">Q&A - 수정</c:set> <c:set var="pageTitleSub">수정</c:set>
</c:if> </c:if>
<c:if test='${searchArticle.articleId == null or searchArticle.articleId == ""}'> <c:if test='${searchArticle.articleId == null or searchArticle.articleId == ""}'>
<c:set var="pageTitle">Q&A - 등록</c:set> <c:set var="pageTitleSub">등록</c:set>
</c:if> </c:if>
<!DOCTYPE html> <!-- File Upload :
<html>
<head>
<title>${pageTitle}</title>
<!-- File Upload : 시작 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/js/fileupload/dropzone.css" /> <link rel="stylesheet" href="${pageContext.request.contextPath}/js/fileupload/dropzone.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/js/fileupload/style.css" /> <link rel="stylesheet" href="${pageContext.request.contextPath}/js/fileupload/style.css" />
시작-->
<script src="${pageContext.request.contextPath}/js/fileupload/dropzone.js"></script> <script src="${pageContext.request.contextPath}/js/fileupload/dropzone.js"></script>
<!-- File Upload : 종료 --> <!-- File Upload : 종료 -->
@ -57,6 +54,7 @@
<script type="text/javaScript"> <script type="text/javaScript">
var myDropzone = null; <% // 파일드롭다운 객체 %> var myDropzone = null; <% // 파일드롭다운 객체 %>
var fileList = new Array(); <% // 업로드된 파일 정보 %> var fileList = new Array(); <% // 업로드된 파일 정보 %>
var delFileList = new Array(); <% // 삭제된 파일 정보 %>
var IN_PROC = false; <% // 현재 상태가 업로드처리중에 있는지 여부 %> var IN_PROC = false; <% // 현재 상태가 업로드처리중에 있는지 여부 %>
var isModified = false; var isModified = false;
@ -65,11 +63,43 @@ var oEditors = [];
$(window.document).ready(function() { $(window.document).ready(function() {
if(!fn_isEmpty('${message}')) {
alert("${message}");
}
/**
* 스마트 에디터
*/
nhn.husky.EZCreator.createInIFrame({
oAppRef: oEditors,
elPlaceHolder: "content",
sSkinURI: "${pageContext.request.contextPath}/js/smartEditor/SmartEditor2Skin.html",
fCreator: "createSEditor2"
});
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// 파일 업로드 처리 : 시작 // 파일 업로드 처리 : 시작
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// 파일업로드 객체 생성 // 파일업로드 객체 생성
myDropzone = new Dropzone("form#myDropzone", { url: "${pageContext.request.contextPath}/fileupload/uploadFilesAjax.do?subPathKey=fileupload.bbs.qna.subpath&attachFileId=${searchArticle.bdAttachFileId}"}); myDropzone = new Dropzone("form#myDropzone", {
url: "${pageContext.request.contextPath}/fileupload/uploadFilesAjax.do?subPathKey=fileupload.bbs.qna.subpath&attachFileId=${searchArticle.bdAttachFileId}"
});
<c:if test="${searchArticle.attachFileCnt > 0}">
// 기존 첨부파일 출력
var re = /(?:\.([^.]+))?$/;
<c:forEach var="attachFile" items="${searchArticle.attachFiles }" varStatus="status">
myDropzone.addFile({
name: '${attachFile.orignlFileNm}',
size:${attachFile.fileSize},
type:re.exec('${attachFile.orignlFileNm}')[1],
attachFileId: '${attachFile.attachFileId}',
streFileNm: '${attachFile.streFileNm}',
fileSn: '${attachFile.fileSn}',
fileUploadType: 'uploaded'
});
</c:forEach>
</c:if>
// 각 파일별 업로드 성공시 호출됨 (1th called) // 각 파일별 업로드 성공시 호출됨 (1th called)
myDropzone.on("success", function(file, responseText) { myDropzone.on("success", function(file, responseText) {
@ -88,6 +118,24 @@ $(window.document).ready(function() {
console.log("success : " + file.name + " -> " + "data > " + jobj[0].streFileNm); console.log("success : " + file.name + " -> " + "data > " + jobj[0].streFileNm);
}); });
/*
myDropzone.on("error", function(file, message) {
myDropzone.removeFile(file);
alert(message);
});
*/
myDropzone.on("removedfile", function(file) {
var idx = delFileList.length;
if(!fn_isEmpty(file.streFileNm) && !fn_isEmpty(file.fileSn)) {
delFileList[idx++] = {
"attachFileId" : file.attachFileId,
"streFileNm" : file.streFileNm,
"fileSn" : file.fileSn
};
}
});
// 각 파일별 업로드 처리 완료 시 호출됨 (2th called) // 각 파일별 업로드 처리 완료 시 호출됨 (2th called)
myDropzone.on("complete", function(file) { myDropzone.on("complete", function(file) {
console.log("개별 파일 처리 완료 > file = " + JSON.stringify(file)); console.log("개별 파일 처리 완료 > file = " + JSON.stringify(file));
@ -97,12 +145,13 @@ $(window.document).ready(function() {
myDropzone.on("queuecomplete", function() { myDropzone.on("queuecomplete", function() {
var targetCnt = this.getAcceptedFiles().length; var targetCnt = this.getAcceptedFiles().length;
var uploadCnt = fileList.length; var uploadCnt = fileList.length;
var queuedCnt = this.getQueuedFiles();
if(uploadCnt > 0) { if(uploadCnt > 0) {
$("#fileList").val(JSON.stringify(JSON.stringify(fileList))); $("#fileList").val(JSON.stringify(JSON.stringify(fileList)));
} }
if(IN_PROC) { if(IN_PROC) {
if(targetCnt > 0 && targetCnt != uploadCnt) { if(queuedCnt > 0 && targetCnt > 0 && targetCnt != uploadCnt) {
alert("일부 첨부파일 등록이 실패하였습니다.\n총 " + targetCnt + "건의 첨부파일 중 " + uploadCnt + "건이 정상적으로 업로드 되었습니다.\n글 등록을 계속 진행합니다."); alert("일부 첨부파일 등록이 실패하였습니다.\n총 " + targetCnt + "건의 첨부파일 중 " + uploadCnt + "건이 정상적으로 업로드 되었습니다.\n글 등록을 계속 진행합니다.");
} }
@ -116,16 +165,6 @@ $(window.document).ready(function() {
/**
* 스마트 에디터
*/
nhn.husky.EZCreator.createInIFrame({
oAppRef: oEditors,
elPlaceHolder: "content",
sSkinURI: "${pageContext.request.contextPath}/js/smartEditor/SmartEditor2Skin.html",
fCreator: "createSEditor2"
});
}); });
function fn_getContent() { function fn_getContent() {
@ -147,12 +186,25 @@ function fn_list() {
var MAX_LEN_OF_CONTENT = 65000; // 내용 최대 길이 var MAX_LEN_OF_CONTENT = 65000; // 내용 최대 길이
//등록버튼 클릭
function fn_pressSaveBtn() {
$("#articleForm").submit();
}
// 등록 처리 // 등록 처리
function fn_save() { function fn_save() {
// 스마트에디터의 내용 적용 // 스마트에디터의 내용 적용
fn_getContent(); fn_getContent();
// 내용 작성 유무
if(fn_isEmpty($("#title").val())) {
alert("제목을 입력하여 주시기 바랍니다.");
$("#title").focus();
return false;
}
// 내용 작성 유무 // 내용 작성 유무
var ctext = fn_extractContentText($("#content").val()); var ctext = fn_extractContentText($("#content").val());
if(ctext.trim() == "") { if(ctext.trim() == "") {
@ -184,6 +236,8 @@ function fn_save() {
IN_PROC = true; IN_PROC = true;
$("#delFileList").val(JSON.stringify(JSON.stringify(delFileList)));
// 파일 업로드 처리 // 파일 업로드 처리
if(myDropzone.getAcceptedFiles().length > 0) { if(myDropzone.getAcceptedFiles().length > 0) {
myDropzone.processQueue(); myDropzone.processQueue();
@ -200,92 +254,104 @@ function fn_saveSubmit() {
} }
</script> </script>
</head>
<body>
<h1>${pageTitle }</h1> <!-- Q&amp;A 섹션 -->
<div class="location qna-data">
<h2 class="blind">Q&amp;A 섹션영역</h2>
<div class="inner">
<div class="row-top">
<div class="location-box">
<ul class="loc">
<li>HOME</li>
<li>고객지원</li>
<li class="on">${pageTitle }</li>
</ul>
<ul class="tit">
<li><span>${pageTitle } ${pageTitleSub }</span></li>
</ul>
</div>
<div class="arr"><img src="/images/icon/icon-join-arr2.png" alt="화살표 아이콘"></div>
</div>
<div class="contents row-bottom">
메시지 : <span style="color:red;">${message }</span> <div class="community qna">
<br /> <div class="contents-frame inner-center">
<div class="community-write">
<legend>Q&amp;A 작성</legend>
<p class="required-text"><span>*</span> 표시는 필수 입력 항목입니다.</p>
<div class="qna-write-table">
<ul>
<form name="articleForm" id="articleForm" method="post" onsubmit="return fn_save();">
<input type="hidden" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex}" />
<input type="hidden" name="pageSize" id="pageSize" title="목록에 보여줄 글개수" value="${searchArticle.pageSize}" />
<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="regId" id="regId" value="${searchArticle.loginedMbInfoId}" />
<input type="hidden" name="regName" id="regName" value="${searchArticle.loginedName}" />
<input type="hidden" name="fileList" id="fileList" title="첨부파일정보" />
<form name="articleForm" id="articleForm" <fieldset>
method="post" <li class="wt-title fl">
onsubmit="return fn_save();"> <div class="w-tit">제목</div>
<div class="w-form">
delFileList : <input type="text" name="delFileList" id="delFileList" title="삭제첨부파일정보" />
bdAttachFileId : <input type="text" name="bdAttachFileId" id="bdAttachFileId" value="${searchArticle.bdAttachFileId}" />
<!-- HIDDEN 영역 : 시작 --> <input type="text" name="title" id="title" title="제목" value="${searchArticle.title}" size="100" maxlength="200" class="grid-1" placeholder="제목을 입력하세요." required />
<input type="text" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex}" readonly /> </div>
<input type="text" name="pageSize" id="pageSize" title="목록에 보여줄 글개수" value="${searchArticle.pageSize}" readonly /> </li>
<input type="text" name="searchType" id="searchType" title="검색구분" value="${searchArticle.searchType}" readonly /> <li class="wt-secret fl check">
<input type="text" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchArticle.searchKeyword}" readonly /> <div class="w-tit">
<input type="text" name="articleId" id="articleId" title="선택글번호" value="${searchArticle.articleId}" readonly /> <input type="checkbox" id="chk-1" name="" value="N">
<!-- HIDDEN 영역 : 종료 -->
&nbsp;<br/>
&nbsp;<br/>
<table class="table_content" style="width:100% !important;">
<tr>
<th>제목</th>
<td><input type="text" name="title" id="title" title="제목" value="${searchArticle.title}" size="100" maxlength="200" required />
<br>
${title}
</td>
</tr>
<tr>
<th>작성자</th>
<td>
<input type="text" name="regId" id="regId" title="작성자" value="${searchArticle.loginedMbInfoId}" size="100" maxlength="200" readonly />
<input type="text" name="regName" id="regName" title="작성자" value="${searchArticle.loginedName}" size="100" maxlength="200" readonly />
</td>
</tr>
<tr>
<th>비밀글</th>
<td><input type="checkbox" name="searchArticle.secretYn" id="searchArticle.secretYn" title="비밀글" value="Y"
<c:if test='${searchArticle.secretYn == "Y" }'> checked </c:if>
/><br/>
</td>
</tr>
<tr>
<th>답변메일 수신여부</th>
<td><input type="checkbox" name="searchArticle.emailRecvYn" id="searchArticle.emailRecvYn" title="답변메일 수신여부" value="Y"
<c:if test='${searchArticle.emailRecvYn == "Y" }'> checked </c:if>
/>
${searchArticle.email}
(답변 수신메일 주소는 내 정보에서 수정하실 수 있습니다.)
<br/>
</td>
</tr>
<tr>
<th>질문내용</th>
<td><textarea name="content" id="content" cols="80" rows="10">${searchArticle.content}</textarea> <br/>
</td>
</tr>
</table>
<br/>
<input type="input" name="fileList" id="fileList" title="첨부파일정보" />
<input type="button" name="btnCancel" id="btnCancel" title="취소버튼" class="float" value="취소"
onclick="fn_list()" />
<input type="submit" name="btnSave" id="btnSave" title="저장버튼" class="float" value="저장" />
<input type="checkbox" name="secretYn" id="secretYn" value="Y"
<c:if test='${searchArticle.secretYn == "Y" }'> checked </c:if> />
<label for="secretYn">비밀글</label>
</div>
</li>
<li class="wt-mail check">
<div class="w-tit">답변메일 수신여부</div>
<div class="w-form">
<input type="checkbox" name="emailRecvYn" id="emailRecvYn" value="Y" <c:if test='${searchArticle.emailRecvYn == "Y" }'> checked </c:if> />
<label for="emailRecvYn">${searchArticle.loginedName} /&nbsp; ${searchArticle.email} &nbsp; (답변 수신메일 주소는 내 정보에서 수정하실 수 있습니다.)</label>
</div>
</li>
<li class="wt-question">
<div class="w-tit">내용</div>
<div class="w-form">
<textarea name="content" id="content" cols="80" rows="10" placeholder="질문하실 내용을 입력하세요.">${searchArticle.content}</textarea>
</div>
</li>
</fieldset>
</form> </form>
&nbsp;<br/> <li class="wt-attachments">
&nbsp;<br/> <div class="w-tit">첨부파일</div>
&nbsp;<br/> <div id="dropzone" class="w-form">
<div id="dropzone">
<form id="myDropzone" name="myDropzone" <form id="myDropzone" name="myDropzone"
action="${pageContext.request.contextPath}/fileupload/uploadFile.do" action="${pageContext.request.contextPath}/fileupload/uploadFile.do"
class="dropzone needsclick" > class="dropzone needsclick" >
<div class="dz-message needsclick"> <div class="dz-message needsclick" style="cursor:pointer">
<button type="button" class="dz-button">Drop files here or click to select files.</button><br /> <button type="button" id="attachFileBtn" name="attachFileBtn" class="attachments-btn">파일첨부</button>
<span class="note needsclick">이곳에 파일을 끌어다 놓거나, 클릭하여 올릴 파일을 선택하세요.</span> <label for="attachFileBtn">※ 이곳에 파일을 끌어다 놓거나(Drag&Drop), 클릭하여 파일을 선택하세요.</label>
</div> </div>
</form> </form>
</div>
</li>
</ul>
</div>
<div class="btn-wrap">
<button type="button" name="btnSave" id="btnSave" title="저장버튼" class="btn btn-color" onclick="fn_pressSaveBtn()">저장</button>
<button type="button" name="btnCancel" id="btnCancel" title="취소버튼" class="btn btn-gray" onclick="fn_list()">취소</button>
</div>
</div>
</div><!-- //contents-frame -->
</div>
</div>
</div>
</div> </div>
</body>
</html>

View File

@ -60,7 +60,8 @@
// 선택한 글 상세 보기로 이동 // 선택한 글 상세 보기로 이동
function fn_viewDetail(articleId) { function fn_viewDetail(articleId) {
$('#articleForm').removeAttr('onsubmit');
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/selectAncmntArticle.do");
$("#articleId").val(articleId); $("#articleId").val(articleId);
$("#articleForm").submit(); $("#articleForm").submit();
} }
@ -124,7 +125,12 @@
} }
// 기존 데이터 CLEAR // 기존 데이터 CLEAR
$( "ul.list-notice li").not('.t-tit-line').remove(); $( "ul.list-notice li").not('.t-tit-line').not('.no-result').remove();
if(!jsonObj.data || jsonObj.data.length <= 0 ) {
$("ul.list-notice li.no-result").show();
} else {
$("ul.list-notice li.no-result").hide();
// 출력 // 출력
$.each(jsonObj.data,function(key,obj) { $.each(jsonObj.data,function(key,obj) {
@ -139,6 +145,7 @@
$( "ul.list-notice").append(li); $( "ul.list-notice").append(li);
}); });
}
pageLoad("fn_searchArticle", jsonObj.pagingPageIndex, jsonObj.pagingTotRecordCount, jsonObj.pagingStartPage, jsonObj.pagingEndPage, jsonObj.pagingLastPage); pageLoad("fn_searchArticle", jsonObj.pagingPageIndex, jsonObj.pagingTotRecordCount, jsonObj.pagingStartPage, jsonObj.pagingEndPage, jsonObj.pagingLastPage);
@ -219,6 +226,9 @@
<span class="t-date">등록일</span> <span class="t-date">등록일</span>
<span class="t-file">첨부</span> <span class="t-file">첨부</span>
</li> </li>
<li class="no-result" style="display:none;">
<span>검색결과가 없습니다.</span>
</li>
</ul> </ul>
</div> </div>

View File

@ -154,7 +154,12 @@ $( document ).ready(function() {
} }
// 기존 데이터 CLEAR // 기존 데이터 CLEAR
$( "ul.list-faq li").remove(); $( "ul.list-faq li").not('.no-result').remove();
if(!jsonObj.data || jsonObj.data.length <= 0 ) {
$("ul.list-faq li.no-result").show();
} else {
$("ul.list-faq li.no-result").hide();
// 출력 // 출력
$.each(jsonObj.data,function(key,obj) { $.each(jsonObj.data,function(key,obj) {
@ -168,6 +173,9 @@ $( document ).ready(function() {
li.append($('<div></div>').attr('class', 'answer').attr('style', 'display: none;')); li.append($('<div></div>').attr('class', 'answer').attr('style', 'display: none;'));
$( "ul.list-faq").append(li); $( "ul.list-faq").append(li);
}); });
}
pageLoad("fn_searchArticle", jsonObj.pagingPageIndex, jsonObj.pagingTotRecordCount, jsonObj.pagingStartPage, jsonObj.pagingEndPage, jsonObj.pagingLastPage); pageLoad("fn_searchArticle", jsonObj.pagingPageIndex, jsonObj.pagingTotRecordCount, jsonObj.pagingStartPage, jsonObj.pagingEndPage, jsonObj.pagingLastPage);
}).fail(function (jqXHR, textStatus, errorThrown) { }).fail(function (jqXHR, textStatus, errorThrown) {
@ -271,6 +279,9 @@ function fn_changeQuestionType(searchQuestionType) {
<div class="list-accordion"> <div class="list-accordion">
<ul class="list-faq"> <ul class="list-faq">
<li class="no-result" style="display:none;">
<span>검색결과가 없습니다.</span>
</li>
</ul> </ul>
</div> </div>

View File

@ -30,60 +30,67 @@
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> <%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<c:set var="pageTitle">묻고답하기(DB)</c:set> <c:set var="pageTitle">Q&amp;A</c:set>
<!DOCTYPE html>
<html lang="ko">
<head>
<title>${pageTitle}</title>
<!-- GRID -->
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/js/jsgrid/nlib-jsgrid.css" />
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/js/jsgrid/nlib-jsgrid-theme.css" />
<script src="${pageContext.request.contextPath}/js/jsgrid/nlib-jsgrid.js"></script>
<script type="text/javaScript" language="javascript"> <script type="text/javaScript" language="javascript">
$( document ).ready(function() { $( document ).ready(function() {
// 메시지 표출
if(!fn_isEmpty('${message}')) { if(!fn_isEmpty('${message}')) {
alert("${message}"); alert("${message}");
} }
//======================================================= // 검색 수행 이벤트
// 그리드 생성 환경설정 $("#btnSearch").on("click", function(e) {
//======================================================= fn_searchArticle(1);
$("#jsGrid").jsGrid({ });
pageSize : $("#pageSize").val(), $("#searchKeyword").on("keydown", function(e) {
scrollOffset:0, if(e.keyCode == 13) {
controller: { fn_searchArticle(1);
loadData: function (filter) { // 그리드에 데이터를 가져올 때 실팽되는 함수 }
var data = $.Deferred(); });
//======================================
// 요청 정보 구성 : 시작 (각 요청에 맞게 조정)
//======================================
var reqUrl = "${pageContext.request.contextPath}/bbs/listQnasAjax.do";
var pageIndex = ( filter && filter.pageIndex ? filter.pageIndex : $("#pageIndex").val());
var pageSize = ( filter && filter.pageSize ? filter.pageSize : $("#pageSize").val());
var searchType = $("#searchType").val(); //초기 자료 조회
var searchKeyword = $("#searchKeyword").val(); fn_searchArticle();
var searchQuestionType = $("#searchQuestionType").val();
}); // document ready
// 선택한 글 상세 보기로 이동
function fn_viewDetail(articleId, secretYn, myQnaYn) {
// 비밀글인 경우, 본인에 한하여 조회 가능
if(secretYn == "Y" && myQnaYn == "N") {
alert("비공개 게시물은 작성자만 확인할 수 있습니다.");
return;
}
$('#articleForm').removeAttr('onsubmit');
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/selectQnaArticle.do");
$("#articleId").val(articleId);
$("#articleForm").submit();
}
// 그리드 데이터 조회 호출
function fn_searchArticle(pageIndex) {
if(fn_isEmpty(pageIndex)) pageIndex = $("#pageIndex").val();
if(fn_isEmpty(pageIndex)) pageIndex = "1";
$("#pageIndex").val(pageIndex); $("#pageIndex").val(pageIndex);
var reqUrl = "${pageContext.request.contextPath}/bbs/listQnasAjax.do";;
var inputData = { var inputData = {
"pageIndex" : pageIndex "pageIndex" : $("#pageIndex").val()
, "pageSize" : pageSize , "pageSize" : $("#pageSize").val()
, "searchType" : searchType , "searchType" : $("#searchType").val()
, "searchKeyword" : searchKeyword , "searchKeyword" : $("#searchKeyword").val()
, "searchQuestionType" : searchQuestionType , "searchQuestionType" : $("#searchQuestionType").val()
}; };
//-------------------------------------- //--------------------------------------
// 요청 처리 // 요청 처리
//-------------------------------------- //--------------------------------------
@ -93,18 +100,18 @@
url: reqUrl, url: reqUrl,
dataType: "json", dataType: "json",
data: JSON.stringify(inputData), data: JSON.stringify(inputData),
}).done(function(response){ }).done(function(data){
<% <%
// 그리드 데이터 예시 : // 그리드 데이터 예시 :
// (1) 페이징 클라이언트에서 수행하는 경우(pageloading = false) : [{ "articleNo": 1, "articleType": "01" }, { "articleNo": 2, "articleType": "02" }] // (1) 페이징 클라이언트에서 수행하는 경우(pageloading = false) : [{ "articleNo": 1, "articleType": "01" }, { "articleNo": 2, "articleType": "02" }]
// (2) 페이징 서버에서 수행하는 경우(pageloading = true) : {data: [{...}], itemsCount: 255} // (2) 페이징 서버에서 수행하는 경우(pageloading = true) : {data: [{...}], itemsCount: 255}
%> %>
var jsonObj = JSON.parse(response);
//$("#itemsCount").val(jsonOjb.itemsCount);
console.log("itemsCount=" + jsonObj.itemsCount);
console.log("message=" + jsonObj.message);
$("#message").text(jsonObj.message);
var jsonObj = JSON.parse(data);
//$("#itemsCount").val(jsonOjb.itemsCount);
console.log(jsonObj.itemsCount);
// 건수
if(jsonObj.itemsCount == undefined) { if(jsonObj.itemsCount == undefined) {
$("#itemsCount").text("0"); $("#itemsCount").text("0");
$("#searchItemsCount").text("0"); $("#searchItemsCount").text("0");
@ -114,157 +121,171 @@
$("#searchItemsCount").text(jsonObj.itemsCount); $("#searchItemsCount").text(jsonObj.itemsCount);
} }
// 검색결과
if($("#searchKeyword").val() != "") { if($("#searchKeyword").val() != "") {
$("#searchKeywordPrt").text($("#searchKeyword").val()); $("#searchKeywordPrt").text("'" + $("#searchKeyword").val() + "'");
$("#listResult").hide();
$("#searchResult").show(); $("#searchResult").show();
$("#cntResult").hide();
} }
else { else {
$("#listResult").show();
$("#searchResult").hide(); $("#searchResult").hide();
$("#cntResult").show();
} }
data.resolve(jsonObj); // 기존 데이터 CLEAR
}); $( "ul.list-notice li").not('.t-tit-line').not('.no-result').remove();
return data.promise();
} // loadData
},
rowClick: function(args) { // 행 클릭 시, 실행되는 이벤트 함수
// 클릭된 행의 자료 객체 if(!jsonObj.data || jsonObj.data.length <= 0 ) {
var getData = args.item; $("ul.list-notice li.no-result").show();
} else {
$("ul.list-notice li.no-result").hide();
// 추출할 컬럼의 데이터 가져오기 // 출력
var articleId = getData["articleId"]; $.each(jsonObj.data,function(key,obj) {
var selectedRow = $("#jsGrid").find('table tr.jsgrid-selected-row'); var li = $(document.createElement('li'));
li.append($('<span />').attr('class', 't-num').html(obj.rno));
li.append($('<span />').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;' : '') +
(obj.attachYn == "Y" ? '<img src="/images/icon/icon-file.png" alt="파일 아이콘">' : '') +
"</a>"));
li.append($('<span />').attr('class', 't-writer').html(obj.regNm));
li.append($('<span />').attr('class', 't-date').html(obj.regDd));
li.append($('<span />').attr('class', 't-answer').html((obj.answerYn == "Y" ? '<span class="compl">답변완료</span>' : '<span class="wait">답변대기</span>')));
// 상세 내용 보기 $( "ul.list-notice").append(li);
fn_viewDetail(articleId, selectedRow);
},
//======================================
// 그리드 컬럼 정의 (각 요청에 맞게 조정)
//======================================
fields: [
{ title:"ID", name: "articleId" , type: "text", width: 200, align: "left" },
{ title:"번호", name: "rno" , type: "text", width: 200, align: "center" },
{ title:"비밀글", name: "secretYn" , type: "text", width: 200, align: "center" },
{ title:"제목", name: "title" , type: "text", width: 200, align: "left" },
{ title:"등록자", name: "regNm" , type: "text", width: 100, align: "center"},
{ title:"등록일", name: "regDd" , type: "text", width: 100, align: "center"},
{ title:"첨부", name: "attachYn" , type: "text", width: 100, align: "center"},
{ title:"내글여부", name: "myQnaYn", type: "text", width: 100, align: "center"}
]
}); });
}
// 검색 버튼 클릭 pageLoad("fn_searchArticle", jsonObj.pagingPageIndex, jsonObj.pagingTotRecordCount, jsonObj.pagingStartPage, jsonObj.pagingEndPage, jsonObj.pagingLastPage);
$("#btnSearch").on("click", function(e) {
fn_searchArticle($("#pageSize").val(), 1); }).fail(function (jqXHR, textStatus, errorThrown) {
alert("조회에 실패하였습니다. 관리자에게 문의 바랍니다.");
}); });
//초기 자료 조회
fn_searchArticle();
}); // document ready
// 선택한 글 상세 보기로 이동
function fn_viewDetail(articleId, selectedRow) {
var $selectedRow = $(selectedRow);
// 비밀글인 경우, 본인에 한하여 조회 가능
if($("#jsGrid").jsGrid("rowByItem", $selectedRow).data("JSGridItem")["secretYn"] == "Y" &&
$("#jsGrid").jsGrid("rowByItem", $selectedRow).data("JSGridItem")["myQnaYn"] == "N") {
alert("비공개 게시물은 작성자만 확인할 수 있습니다.");
return;
}
$("#articleId").val(articleId);
$("#articleForm").submit();
}
// 그리드 데이터 조회 호출
function fn_searchArticle(pageSize, pageIndex) {
$("#jsGrid").jsGrid("search"
, {'pageSize' : (pageSize ? pageSize : fn_getIntValue("pageSize", ${searchArticle.pageSize}) ),
'pageIndex' : (pageIndex ? pageIndex : fn_getIntValue("pageIndex", ${searchArticle.pageIndex}))
}
);
} }
function fn_changeQuestionType(searchQuestionType) { function fn_changeQuestionType(searchQuestionType) {
$("#searchQuestionType").val(searchQuestionType); $("#searchQuestionType").val(searchQuestionType);
fn_searchArticle($("#pageSize").val(), 1); $("#searchKeyword").val("");
fn_searchArticle(1);
} }
//게시글 작성으로 이동 //게시글 작성으로 이동
function fn_newArticle() { function fn_newArticle() {
<sec:authorize access="not isAuthenticated()">
alert("로그인 후, 이용하여 주시기 바랍니다.");
</sec:authorize>
<sec:authorize access="isAuthenticated()">
$("#articleNo").val(""); $("#articleNo").val("");
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/insertQnaForm.do"); $("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/insertQnaForm.do");
$("#articleForm").submit(); $("#articleForm").submit();
</sec:authorize>
} }
</script> </script>
</head>
<body> <!-- Q&amp;A 섹션 -->
<div class="location qna">
<h1>${pageTitle }</h1> <h2 class="blind">Q&amp;A 섹션영역</h2>
<div class="inner">
메시지 : <span name="message" id="message" style="color:red;">${message}</span> <div class="row-top">
<div class="location-box">
<div name="listResult" id="listResult"> <ul class="loc">
총 <span name="itemsCount" id="itemsCount"></span>건<br> <li>HOME</li>
<li>고객지원</li>
<li class="on">${pageTitle }</li>
</ul>
<ul class="tit">
<li><span>${pageTitle }</span></li>
</ul>
</div>
<div class="arr"><img src="/images/icon/icon-join-arr2.png" alt="화살표 아이콘"></div>
</div>
<div class="contents row-bottom">
<div class="list-box qna-box">
<div class="tab">
<ul class="tabs">
<li><a href="javascript:void(0);" onclick="fn_changeQuestionType('')">전체</a></li>
<li><a href="javascript:void(0);" onclick="fn_changeQuestionType('USER')">내 질문</a></li>
</ul>
<div class="title">
<div class="list-search-wrap list-top">
<form name="articleForm" id="articleForm" method="post" onsubmit="return false;">
<div class="left">
<div class="total-count" name="cntResult" id="cntResult"><span class="count">총 <em name="itemsCount" id="itemsCount">0</em>건</span></div>
<div class="total-count" style="display: none;" name="searchResult" id="searchResult">
<span class="count"><em name="searchKeywordPrt" id="searchKeywordPrt"></em>에 대한 겸색결과는 총 <em name="searchItemsCount" id="searchItemsCount">4</em>건 입니다.</span>
</div>
</div> </div>
<div style="display:none;" name="searchResult" id="searchResult"> <div class="right">
'<span name="searchKeywordPrt" id="searchKeywordPrt"></span>' 에 대한 검색결과는 총 <span name="searchItemsCount" id="searchItemsCount"></span>건 입니다.<br> <div class="list-select type">
</div> <label for="searchType">
&nbsp;<br/>
<!-- 질문자선택 -->
<table>
<tr>
<td><a href="javascript:void(0);" onclick="fn_changeQuestionType('')">전체</a></td>
<td><a href="javascript:void(0);" onclick="fn_changeQuestionType('USER')">내 질문</a></td>
</tr>
</table>
<br>
<form name="articleForm" id="articleForm" method="post" action="${pageContext.request.contextPath}/bbs/selectQnaArticle.do">
<button type="button" name="btnNewTop" id="btnNewTop" class="float" title="글쓰기버튼"
onclick="fn_newArticle()">글쓰기</button>
<!-- 검색조건 -->
<input type="text" name="pageSize" id="pageSize" value="${searchArticle.pageSize }" />
<input type="text" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex }" size="5" maxlength="5" />
<select name="searchType" id="searchType"> <select name="searchType" id="searchType">
<option value="T" <c:if test='${searchArticle.searchType == "T" }'>selected</c:if> >제목</option> <option value="T" <c:if test='${searchArticle.searchType == "T" }'>selected</c:if> >제목</option>
<option value="C" <c:if test='${searchArticle.searchType == "C" }'>selected</c:if> >내용</option> <option value="C" <c:if test='${searchArticle.searchType == "C" }'>selected</c:if> >내용</option>
</select> </select>
<input type="text" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchArticle.searchKeyword }" maxlength="20" /> </label>
<input type="text" name="articleId" id="articleId" title="게시글번호" value="" readonly /> </div>
<input type="button" name="btnSearch" id="btnSearch" title="검색" value="검색" /> <div class="list-input">
<br/> <input type="text" id="searchKeyword" name="searchKeyword" placeholder="검색어를 입력하세요" title="검색어" value="${searchArticle.searchKeyword }" maxlength="20" >
<label for="btnSearch">
<button name="btnSearch" id="btnSearch" type="button" title="검색">검색</button>
</label>
</div>
</div>
<div id="jsGrid" name="jsGrid" style="height: 100%"></div> <input type="hidden" name="pageSize" id="pageSize" value="${searchArticle.pageSize }" />
<input type="hidden" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex }" size="5" maxlength="5" />
<input type="hidden" name="articleId" id="articleId" title="게시글번호" value="" readonly />
<input type="text" name="searchQuestionType" id="searchQuestionType" value="" title="유형코드" readonly /> <input type="hidden" name="searchQuestionType" id="searchQuestionType" value="" title="유형코드" readonly />
<input type="text" name="articleNo" id="articleNo" value="" title="선택글번호" readonly /> <input type="hidden" name="articleNo" id="articleNo" value="" title="선택글번호" readonly />
<button type="button" name="btnNew" id="btnNew" class="float" title="글쓰기버튼"
onclick="fn_newArticle()">글쓰기</button>
</form> </form>
</div>
</div>
</body> <div class="contents tab_content">
</html> <div class="tabs_item">
<div id="contents" class="community notice">
<div class="contents-frame inner-center">
<div class="list-table-wrap">
<ul class="list-notice">
<li class="t-tit-line">
<span class="t-num">NO</span>
<span class="t-tit">제목</span>
<span class="t-writer">등록자</span>
<span class="t-date">등록일</span>
<span class="t-answer">답변</span>
</li>
<li class="no-result" style="display:none;">
<span>검색결과가 없습니다.</span>
</li>
</ul>
</div>
<div class="btn-box">
<button type="button" class="btn btn-color" onclick="fn_newArticle()">질문하기</button>
</div>
<ul id="paging" class="paging"></ul>
</div>
<!-- //contents-frame -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -31,12 +31,7 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> <%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<c:set var="pageTitle">Q&A - 상세조회</c:set> <c:set var="pageTitle">Q&amp;A</c:set>
<!DOCTYPE html>
<html lang="ko">
<head>
<title>${pageTitle}</title>
<script type="text/javaScript" language="javascript"> <script type="text/javaScript" language="javascript">
@ -47,6 +42,7 @@ $( document ).ready(function() {
} }
}); });
//목록으로 이동 //목록으로 이동
function fn_list() { function fn_list() {
$("#articleForm").submit(); $("#articleForm").submit();
@ -83,113 +79,129 @@ function fn_downloadFile(attachFileId, fileSn) {
$("#downloadFileForm").submit(); $("#downloadFileForm").submit();
} }
</script> </script>
</head> <!-- Q&amp;A 섹션 -->
<div class="location qna-data">
<h2 class="blind">Q&amp;A 섹션영역</h2>
<div class="inner">
<div class="row-top">
<div class="location-box">
<ul class="loc">
<li>HOME</li>
<li>고객지원</li>
<li class="on">${pageTitle }</li>
</ul>
<ul class="tit">
<li><span>${pageTitle }</span></li>
</ul>
</div>
<div class="arr"><img src="/images/icon/icon-join-arr2.png" alt="화살표 아이콘"></div>
</div>
<div class="contents row-bottom">
<body> <div class="community qna">
<div class="contents-frame inner-center">
<div class="view-qna">
<div class="view-tit">
<h2>
<span class="type">
<c:if test='${article.secretYn == "Y"}'></c:if>
<h1>${pageTitle }</h1> <c:if test='${article.answerYn == "Y"}'><span>답변완료</span></c:if>
메시지 : <span style="color:red;">${message }</span>
<br />
<form name="articleForm" id="articleForm"
action="${pageContext.request.contextPath}/bbs/listQnas.do"
method="post">
<!-- HIDDEN 영역 : 시작 -->
<input type="text" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex}" readonly />
<input type="text" name="pageSize" id="pageSize" title="목록에 보여줄 글개수" value="${searchArticle.pageSize}" readonly />
<input type="text" name="searchType" id="searchType" title="검색구분" value="${searchArticle.searchType}" readonly />
<input type="text" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchArticle.searchKeyword}" readonly />
<input type="text" name="articleId" id="articleId" title="선택글번호" value="${searchArticle.articleId}" readonly />
<!-- HIDDEN 영역 : 종료 -->
<table class="table_content" style="width:100% !important; margin-top: 20px;">
<tr>
<th>작성일</th>
<td>${article.regDd }</td>
<th>답변여부</th>
<td>
<c:if test='${article.answerYn == "Y"}'>답변완료</c:if>
<c:if test='${article.answerYn != "Y"}'>답변대기중</c:if>
</td>
</tr>
<tr>
<th>비밀글여부</th>
<td>
<c:if test='${article.secretYn == "Y"}'>비밀글</c:if>
<c:if test='${article.secretYn != "Y"}'>일반</c:if>
</td>
<th rowspan="1">제목</th>
<td colspan="1">${article.title}</td>
</tr>
<tr>
<th rowspan="1">질문자</th>
<td colspan="3">${article.regNm}</td>
</tr>
<tr>
<th rowspan="1">질문내용</th>
<td colspan="3"><div id="divContent">${article.unescapedContent}</div></td>
</tr>
</span>
${article.title}<span>
<c:if test='${article.secretYn == "Y"}'> <c:if test='${article.secretYn == "Y"}'>
<tr> <img src="/images/icon/icon-secret.png" alt="자물쇠 아이콘"></span>
<th rowspan="1">답변내용</th>
<td colspan="3">${article.answer}</td>
</tr>
</c:if> </c:if>
</h2>
<span class="v-info">
<em>${article.regNm }</em>
<em>${article.regDd }</em>
</span>
</div>
<c:if test="${article.attachFileCnt > 0}"> <c:if test="${article.attachFileCnt > 0}">
<tr> <div class="file-box">
<td colspan="4">
<% <%
// 파일정보 : 저장파일ID=원파일명 // 파일정보 : 저장파일ID=원파일명
%> %>
<c:forEach var="attachFile" items="${article.attachFiles }"> <c:forEach var="attachFile" items="${article.attachFiles }">
<a href="javascript:void(0);" onclick="fn_downloadFile('${attachFile.attachFileId}', ${attachFile.fileSn})">${attachFile.orignlFileNm} (${attachFile.fileSize} byte(s))</a><br/> <div class="file-list">
<span><img src="/images/icon/icon-file.png" alt="파일 아이콘"></span>
<span>${attachFile.orignlFileNm}, ${attachFile.fileSize} byte(s)</span>
<span><button type="button" onclick="fn_downloadFile('${attachFile.attachFileId}', ${attachFile.fileSn})">다운로드</button></span>
</div>
</c:forEach> </c:forEach>
</td> </div>
</tr>
</c:if>
<c:if test="${article.attachFileCnt < 1}">
<td colspan="4">첨부파일 없음
</td>
</c:if> </c:if>
</table> <div class="view-body">
<div class="view-con">
<br/> <div class="view-txt">
<p>
${article.unescapedContent}
</p>
</div>
</div>
<c:if test='${article.answerYn == "Y"}'>
<div class="answer">
<div class="answer-top">
<span class="left">답변</span>
<span class="right">${article.modDd }</span>
</div>
<div class="answer-con">
<p>
${article.answer}
</p>
</div>
</div>
</c:if>
</div>
<div class="btn-box">
<div class="left">
<!-- 관련 작업 버튼 --> <!-- 관련 작업 버튼 -->
<c:if test='${article.answerYn != "Y" and article.myQnaYn == "Y" }'> <c:if test='${article.answerYn != "Y" and article.myQnaYn == "Y" }'>
<button type="button" name="btnUpdate" id="btnUpdate" class="float" <button type="button" name="btnUpdate" id="btnUpdate" class="btn btn-gray"
onclick="fn_update()">수정</button> onclick="fn_update()">수정</button>
<button type="button" name="btnDelete" id="btnDelete" class="float" <button type="button" name="btnDelete" id="btnDelete" class="btn btn-lightgray"
onclick="fn_delete()">삭제</button> onclick="fn_delete()">삭제</button>
</c:if> </c:if>
</div>
<div class="right">
<button type="button" class="btn btn-black" onclick="fn_list()">목록보기</button>
</div>
</div>
</div>
</div><!-- //contents-frame -->
</div>
<button type="button" name="btnList" id="btnList" class="float" </div>
onclick="fn_list()">목록</button> </div>
</div>
<form name="articleForm" id="articleForm"
action="${pageContext.request.contextPath}/bbs/listQnas.do"
method="post">
<input type="hidden" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex}" readonly />
<input type="hidden" name="pageSize" id="pageSize" title="목록에 보여줄 글개수" value="${searchArticle.pageSize}" readonly />
<input type="hidden" name="searchType" id="searchType" title="검색구분" value="${searchArticle.searchType}" readonly />
<input type="hidden" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchArticle.searchKeyword}" readonly />
<input type="hidden" name="articleId" id="articleId" title="선택글번호" value="${searchArticle.articleId}" readonly />
</form> </form>
<br />
<!-- 첨부파일 다운로드용 폼 --> <!-- 첨부파일 다운로드용 폼 -->
<form name="downloadFileForm" id="downloadFileForm" <form name="downloadFileForm" id="downloadFileForm"
action="${pageContext.request.contextPath}/fileupload/downloadAttachFile.do" action="${pageContext.request.contextPath}/fileupload/downloadAttachFile.do"
method="post"> method="post">
<input type="text" name="bdType" id="bdType" value="QNA" readonly /> <input type="hidden" name="bdType" id="bdType" value="ANCMNT" readonly />
<input type="text" name="attachFileId" id="attachFileId" value="" readonly /> <input type="hidden" name="attachFileId" id="attachFileId" value="" readonly />
<input type="text" name="streFileNm" id="streFileNm" value="" readonly /> <input type="hidden" name="streFileNm" id="streFileNm" value="" readonly />
<input type="text" name="fileSn" id="fileSn" value="" readonly /> <input type="hidden" name="fileSn" id="fileSn" value="" readonly />
<input type="text" name="orignlFileNm" id="orignlFileNm" value="" readonly /> <input type="hidden" name="orignlFileNm" id="orignlFileNm" value="" readonly />
</form> </form>
</body>
</html>

View File

@ -11,14 +11,7 @@ String councilNm = (String)session.getAttribute("councilNm");
%> %>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$("#imgLogo").attr("src", "/images/logo/img-logo-${councilCd }.png");
$("#imgLogo").on("error", function() {
$("<span id='siteCouncilNm' name='siteCouncilNm'>${councilNm}</span>").insertBefore($("#siteCommonTitle"));
$("#siteCouncilNm").attr("style", "border-left:0px !important");
$(this).remove();
});
}); });
function goSearch(){ function goSearch(){
@ -32,12 +25,10 @@ function fn_getMemberCard() {
</script> </script>
<h2 class="blind">헤더영역</h2> <h2 class="blind">헤더영역</h2>
<div class="inner"> <div class="inner">
<h1><a href="javascript:void(0)" onclick="javascript:location.href='/';"><img namme="imgLogo" id="imgLogo" src=""><span name="siteCommonTitle" id="siteCommonTitle">소장자료관</span></a></h1> <h1><a href="javascript:void(0)" onclick="javascript:location.href='/';"><img src="/images/img/img-logo.svg"><span class="title-1" name="siteCommonTitle" id="siteCommonTitle">${councilNm}</span><span class="title-2">소장자료관</span></a></h1>
<div class="search-wrap"> <div class="search-wrap">
<h2 class="blind">검색</h2> <h2 class="blind">검색</h2>

View File

@ -8,7 +8,7 @@
<script type="text/javascript"> <script type="text/javascript">
window.onload = function() { window.onload = function() {
fn_myAlert('${unreadNotiCnt}''); fn_myAlert('${unreadNotiCnt}');
}; };
</script> </script>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -97,6 +97,7 @@
Dropzone = (function(_super) { Dropzone = (function(_super) {
var extend, resolveOption; var extend, resolveOption;
var inProc = false; // NLIB 멀티파일 올리는 중
__extends(Dropzone, _super); __extends(Dropzone, _super);
@ -150,7 +151,7 @@
//dictInvalidFileType: "You can't upload files of this type.", //dictInvalidFileType: "You can't upload files of this type.",
dictInvalidFileType: "허용된 파일 형식만 첨부가능합니다 (이미지,문서 파일) ", // NLIB dictInvalidFileType: "허용된 파일 형식만 첨부가능합니다 (이미지,문서 파일) ", // NLIB
dictResponseError: "Server responded with {{statusCode}} code.", dictResponseError: "Server responded with {{statusCode}} code.",
dictCancelUpload: "Cancel upload", dictCancelUpload: "",
dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
//dictRemoveFile: "Remove file", //dictRemoveFile: "Remove file",
dictRemoveFile: "취소", // NLIB dictRemoveFile: "취소", // NLIB
@ -236,6 +237,7 @@
and don't overwrite those options. and don't overwrite those options.
*/ */
drop: function(e) { drop: function(e) {
inProc = true;
return this.element.classList.remove("dz-drag-hover"); return this.element.classList.remove("dz-drag-hover");
}, },
dragstart: noop, dragstart: noop,
@ -267,7 +269,7 @@
_ref = file.previewElement.querySelectorAll("[data-dz-name]"); _ref = file.previewElement.querySelectorAll("[data-dz-name]");
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
node = _ref[_i]; node = _ref[_i];
node.textContent = file.name; node.textContent = (file.name + "_" + file.accepted + "_" + file.type); // DDDDDDDDDDDDDDDDDDDDddddd
} }
_ref1 = file.previewElement.querySelectorAll("[data-dz-size]"); _ref1 = file.previewElement.querySelectorAll("[data-dz-size]");
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
@ -275,7 +277,9 @@
node.innerHTML = this.filesize(file.size); node.innerHTML = this.filesize(file.size);
} }
if (this.options.addRemoveLinks) { if (this.options.addRemoveLinks) {
file._removeLink = Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>" + this.options.dictRemoveFile + "</a>"); //file._removeLink = Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>" + this.options.dictRemoveFile + "</a>");
// NLIB DDDDDDDDDDDDDDDDDDDDDDDDDDDD
file._removeLink = Dropzone.createElement('<button class="close" data-dz-remove><img src="/images/btn/btn-close-maplayer.png" alt="닫기 아이콘"></button>');
file.previewElement.appendChild(file._removeLink); file.previewElement.appendChild(file._removeLink);
} }
removeFileEvent = (function(_this) { removeFileEvent = (function(_this) {
@ -389,18 +393,26 @@
canceledmultiple: noop, canceledmultiple: noop,
complete: function(file) { complete: function(file) {
if (file._removeLink) { if (file._removeLink) {
file._removeLink.textContent = this.options.dictRemoveFile; //file._removeLink.textContent = this.options.dictRemoveFile;
} }
if (file.previewElement) { if (file.previewElement) {
return file.previewElement.classList.add("dz-complete"); return file.previewElement.classList.add("dz-complete");
} }
}, },
completemultiple: noop, completemultiple: //noop,
maxfilesexceeded: noop, function() {
},
maxfilesexceeded: function(file) { // NLIB
if(inProc) alert("첨부가능한 최대 파일 개수는 " + this.options.maxFiles + "개 입니다.\n초과된 개수의 파일은 첨부되지 않습니다.");
inProc = false;
this.removeFile(file);
},
maxfilesreached: noop, maxfilesreached: noop,
queuecomplete: noop, queuecomplete: noop,
addedfiles: noop, addedfiles: noop,
previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-image\"><img data-dz-thumbnail /></div>\n <div class=\"dz-details\">\n <div class=\"dz-size\"><span data-dz-size></span></div>\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n <div class=\"dz-success-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Check</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </svg>\n </div>\n <div class=\"dz-error-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Error</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <g id=\"Check-+-Oval-2\" sketch:type=\"MSLayerGroup\" stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\">\n <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>" //previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-image\"><img data-dz-thumbnail /></div>\n <div class=\"dz-details\">\n <div class=\"dz-size\"><span data-dz-size></span></div>\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n <div class=\"dz-success-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Check</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </svg>\n </div>\n <div class=\"dz-error-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Error</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <g id=\"Check-+-Oval-2\" sketch:type=\"MSLayerGroup\" stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\">\n <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>"
previewTemplate: '<div class="file dz-preview dz-file-preview"><span class="icon"><img src="/images/icon/icon-file.png" alt="파일 아이콘"></span><span class="text"><span data-dz-name></span><em>(<span data-dz-size></span>)</em></span></div>&nsp;'
}; };
extend = function() { extend = function() {
@ -985,7 +997,8 @@
_this._errorProcessing([file], error); _this._errorProcessing([file], error);
} else { } else {
file.accepted = true; file.accepted = true;
if (_this.options.autoQueue) { //if (_this.options.autoQueue) {
if (file.fileUploadType != "uploaded" && _this.options.autoQueue) { // NLIB
_this.enqueueFile(file); _this.enqueueFile(file);
} }
} }
@ -1133,6 +1146,7 @@
} }
queuedFiles = this.getQueuedFiles(); queuedFiles = this.getQueuedFiles();
if (!(queuedFiles.length > 0)) { if (!(queuedFiles.length > 0)) {
this.emit("queuecomplete"); // NLIB 추가
return; return;
} }
if (this.options.uploadMultiple) { if (this.options.uploadMultiple) {
@ -1400,6 +1414,8 @@
file.status = Dropzone.ERROR; file.status = Dropzone.ERROR;
this.emit("error", file, message, xhr); this.emit("error", file, message, xhr);
this.emit("complete", file); this.emit("complete", file);
this.removeFile(file); // NLIB
} }
if (this.options.uploadMultiple) { if (this.options.uploadMultiple) {
this.emit("errormultiple", files, message, xhr); this.emit("errormultiple", files, message, xhr);