|
|
|
@ -499,11 +499,14 @@ function serialize (formData) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <pre>
|
|
|
|
|
* 첨부파일 정보 목록으로 부터 이미지 download
|
|
|
|
|
* @param {object} cmmFileDtls
|
|
|
|
|
* @param {string} appendElementId - '#ctznImg'
|
|
|
|
|
* @param {string} dtlSeq - 시민신고상세순번
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
function imgDownload(cmmFileDtls, appendElementId) {
|
|
|
|
|
function imgDownload(cmmFileDtls, appendElementId, dtlSeq) {
|
|
|
|
|
const downloadUrl = '/framework/biz/cmm/file/download.do';
|
|
|
|
|
cmmFileDtls.forEach((dtl, idx) => {
|
|
|
|
|
|
|
|
|
@ -514,24 +517,24 @@ function imgDownload(cmmFileDtls, appendElementId) {
|
|
|
|
|
,body: JSON.stringify(dtl)
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.then((response) => response.blob())
|
|
|
|
|
.then((blob) => {
|
|
|
|
|
const url = URL.createObjectURL(blob);
|
|
|
|
|
|
|
|
|
|
const x = document.createElement("img");
|
|
|
|
|
x.setAttribute("src", url);
|
|
|
|
|
//x.style = 'width:150px; display: block;';
|
|
|
|
|
x.style = 'height:150px;';
|
|
|
|
|
//x.setAttribute("width", "304");
|
|
|
|
|
//x.setAttribute("height", "228");
|
|
|
|
|
x.setAttribute("title", dtl.orginlFileNm);
|
|
|
|
|
x.setAttribute("alt", dtl.orginlFileNm);
|
|
|
|
|
document.querySelector(appendElementId).appendChild(x);
|
|
|
|
|
|
|
|
|
|
// Revoke Blob URL after DOM updates..
|
|
|
|
|
//window.URL.revokeObjectURL(objectURL);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
.then(response => response.blob())
|
|
|
|
|
.then(blob => {
|
|
|
|
|
const title = dtlSeq ? dtl.orginlFileNm+'['+dtlSeq+']' : dtl.orginlFileNm;
|
|
|
|
|
const url = URL.createObjectURL(blob);
|
|
|
|
|
|
|
|
|
|
const x = document.createElement("img");
|
|
|
|
|
x.setAttribute("src", url);
|
|
|
|
|
//x.style = 'width:150px; display: block;';
|
|
|
|
|
x.style = 'height:150px;';
|
|
|
|
|
//x.setAttribute("width", "304");
|
|
|
|
|
//x.setAttribute("height", "228");
|
|
|
|
|
x.setAttribute("title", title);
|
|
|
|
|
x.setAttribute("alt", dtl.orginlFileNm);
|
|
|
|
|
document.querySelector(appendElementId).appendChild(x);
|
|
|
|
|
|
|
|
|
|
// Revoke Blob URL after DOM updates..
|
|
|
|
|
//window.URL.revokeObjectURL(objectURL);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|