diff --git a/src/main/java/kr/xit/framework/biz/cmm/model/CmmFileDTO.java b/src/main/java/kr/xit/framework/biz/cmm/model/CmmFileDTO.java
index 7f55982a..b5444261 100644
--- a/src/main/java/kr/xit/framework/biz/cmm/model/CmmFileDTO.java
+++ b/src/main/java/kr/xit/framework/biz/cmm/model/CmmFileDTO.java
@@ -106,6 +106,8 @@ public class CmmFileDTO {
private String register;
private String registDt;
+
+ private String downloadUrl;
}
@Getter
diff --git a/src/main/java/kr/xit/framework/biz/cmm/web/CmmFileMgtController.java b/src/main/java/kr/xit/framework/biz/cmm/web/CmmFileMgtController.java
index 62bdb65d..be6a7949 100644
--- a/src/main/java/kr/xit/framework/biz/cmm/web/CmmFileMgtController.java
+++ b/src/main/java/kr/xit/framework/biz/cmm/web/CmmFileMgtController.java
@@ -17,7 +17,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -45,6 +44,22 @@ public class CmmFileMgtController {
private String uploadRoot;
private final ICmmFileService cmmFileService;
+ @RequestMapping("/cmmImageViewPopup")
+ public ModelAndView cmmImageViewPopup(final CmmFileDTO.FileDtl dto) {
+ ModelAndView mav = new ModelAndView(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "cmm/file/cmmImageViewPopup.popup");
+ mav.addObject("fileDtlDTO", dto);
+ // mav.addObject("downloadUrl", downloadUrl);
+ return mav;
+ }
+
+ @RequestMapping("/cmmPaintwebImageEditorPopup")
+ public ModelAndView cmmPaintwebImageEditorPopup(final String imageTagId) {
+ ModelAndView mav = new ModelAndView(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "cmm/file/cmmPaintwebImageEditorPopup.popup");
+ mav.addObject("imageTagId", imageTagId);
+ // mav.addObject("downloadUrl", downloadUrl);
+ return mav;
+ }
+
@GetMapping("/{fileMstId}")
public ModelAndView findFiles(@PathVariable("fileMstId") final String fileMstId) {
if(Checks.isEmpty(fileMstId)) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "대상 파일[fileMstId]을 선택해 주세요.");
@@ -130,17 +145,22 @@ public class CmmFileMgtController {
//throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
- response.setContentType(contentType);
response.setHeader(HttpHeaders.CONTENT_TYPE, contentType);
response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");
+ response.setHeader("Pragma", "no-cache");
+ response.setHeader(HttpHeaders.CACHE_CONTROL, "no-cache, must-revalidate");
+ response.setDateHeader(HttpHeaders.EXPIRES, 0);
try {
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(fileName,
String.valueOf(StandardCharsets.UTF_8)) + "\";");
} catch (UnsupportedEncodingException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
- //response.setHeader(HttpHeaders.CONTENT_ENCODING, "binary");
response.setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(fileSize));
+ response.setContentType(contentType);
+
+ //response.setHeader(HttpHeaders.CONTENT_ENCODING, "binary");
+
try {
response.getOutputStream().write(fileByte);
response.getOutputStream().flush();
diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtForm.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtForm.jsp
index a45033f4..8d226b2a 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtForm.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtForm.jsp
@@ -57,6 +57,7 @@
/**************************************************************************
* Global Variable
**************************************************************************/
+ var popup;
let GRID = null;
var callbackSearch = () => fnBiz.search();
@@ -87,7 +88,7 @@
default:
break;
}
- CmmPopup.open(url, params, popOption, popTitle);
+ popup = CmmPopup.open(url, params, popOption, popTitle);
//var w = window.open("/imageEditor.do", "", "width=800,height=650,top=0px,left=200px,status=,resizable=false,scrollbars=no");
}
,onClickGrid: function(props){
diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp
index 75ab85f7..d80e117b 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ecCtznSttemntMgtPopup.jsp
@@ -241,6 +241,7 @@
* Global Variable
**************************************************************************/
// let orgData;
+ var imageEditorPopup = (flag, params) => fnBiz.pagePopup(flag, params);
/* *******************************
@@ -256,8 +257,8 @@
,url: '
+ * 첨부파일 정보 목록으로 부터 이미지 download + * 이미지 url 사용 + * @param {object} cmmFileDtls + * @param {string} appendElementId - '#ctznImg' + * @param {string} dtlSeq - 시민신고상세순번 + *+ */ +function imgDownload(cmmFileDtls, appendElementId, dtlSeq, isEditor) { + const downloadUrl = '/framework/biz/cmm/file/download.do'; + cmmFileDtls.forEach((dtl, idx) => { + + const params = "?" + $.param(dtl); + const title = dtlSeq ? dtl.orginlFileNm+'['+dtlSeq+']' : dtl.orginlFileNm; + const x = document.createElement("img"); + x.setAttribute("src", downloadUrl+params); + x.setAttribute("id", dtl.fileId); + //x.style = 'width:150px; display: block;'; + x.style = 'height:300px;'; + //x.setAttribute("width", "304"); + //x.setAttribute("height", "228"); + x.setAttribute("title", title); + x.setAttribute("alt", dtl.orginlFileNm); + //x.setAttribute("id", dtl.fileMastrId); + x.setAttribute("name", dtl.orginlFileNm); + x.setAttribute("ctznSttemntDetailSn", dtlSeq); + x.addEventListener('click', (e)=>{ + if(isEditor) { + fnBiz.pagePopup('imageEditor', {imageTagId: dtl.fileId}); + }else{ + dtl.downloadUrl = downloadUrl+params; + fnBiz.pagePopup('imageView', dtl); + } + }) + document.querySelector(appendElementId).appendChild(x); + }) +} + /** *
* 첨부파일 정보 목록으로 부터 이미지 download + * binary 사용시 * @param {object} cmmFileDtls * @param {string} appendElementId - '#ctznImg' * @param {string} dtlSeq - 시민신고상세순번 **/ -function imgDownload(cmmFileDtls, appendElementId, dtlSeq) { +function imgDownload2(cmmFileDtls, appendElementId, dtlSeq) { const downloadUrl = '/framework/biz/cmm/file/download.do'; cmmFileDtls.forEach((dtl, idx) => { @@ -35,14 +76,11 @@ function imgDownload(cmmFileDtls, appendElementId, dtlSeq) { x.setAttribute("name", dtl.orginlFileNm); x.setAttribute("ctznSttemntDetailSn", dtlSeq); x.addEventListener('click', (e)=>{ -console.log('~~~~~~~',e); -console.log('~~~~~~~',e.target); $('#uploadImage').attr("src", url); $('#imageEditor').css('display', 'inline-block'); fnBiz.pagePopup('imageEditor'); }) document.querySelector(appendElementId).appendChild(x); - document.querySelector(appendElementId).appendChild(x); // Revoke Blob URL after DOM updates.. //window.URL.revokeObjectURL(objectURL); @@ -51,7 +89,6 @@ console.log('~~~~~~~',e.target); } - function fn_uploadImage() { $("#uploadImageFile").click(); }