From dce292e403cdbccb94b36a7b30703049db77481c Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Mon, 31 Jul 2023 17:50:54 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=ED=8E=B8?= =?UTF-8?q?=EC=A7=91=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/crdn/crdn01020-info.jsp | 90 ++++++++++++------- .../WEB-INF/jsp/fims/crdn/crdn05030-info.jsp | 50 +++++++---- .../WEB-INF/jsp/fims/sprt/sprt03020-main.jsp | 22 +---- .../lib/fims/biz/paintweb/paintweb.js | 4 +- 4 files changed, 95 insertions(+), 71 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp index cc6b47be..8d757f06 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01020-info.jsp @@ -262,6 +262,9 @@
+
+ +
등록된 사진
@@ -270,32 +273,20 @@
-
-
- -
-
추가한 사진(번호판)
- -
-
+
- -
- -
+ +
+ +
추가한 사진
+
- -
-
캡쳐 이미지
- -
-
-
+
@@ -312,13 +303,15 @@ $(document).ready(function(){ var $P = pageObject["${pageName}"]; $P.captureFileArr = []; + $P.localUploadArr = []; + $P.numberPlateArr = []; /************************************************************************** * DatasetControl, Dataset, FormFields **************************************************************************/ $P.formFields = new FimsFormFields("#frmEdit--${pageName}"); - $P.uploadSet = uploadSupport("#uploadFileList--${pageName}"); + $P.uploadSet = uploadSupport("#inputUploadSet--${pageName}"); $P.crdnControl = new DatasetControl({ urls : { load : "", create : wctx.url("/${taskSeCd}/crdn/crdn01/020/save.do") }, @@ -344,6 +337,13 @@ $(document).ready(function(){ if(formData.get("uploadFileList").size == 0){ formData.delete("uploadFileList"); } + + if($P.localUploadArr.length > 0){ + $P.localUploadArr.forEach(item => formData.append("uploadFileList",item)); + } + if($P.numberPlateArr.length > 0){ + $P.numberPlateArr.forEach(item => formData.append("uploadFileList",item)); + } if($P.captureFileArr.length > 0){ $P.captureFileArr.forEach(item => formData.append("uploadFileList",item)); } @@ -362,8 +362,13 @@ $(document).ready(function(){ $P.formFields.set(item); } - $P.uploadSet.onDatasetChange = () => { $P.fnDisplay(); }; - $P.uploadSet.onRemove = () => { $P.fnDisplay(); }; + $P.uploadSet.onDatasetChange = () => { + var files = $P.uploadSet.getDataset(); + files.forEach(item => $P.localUploadArr.push(item)); + + $P.fnDisplay(); + }; + $P.uploadSet.onRemove = () => { }; $P.crdnControl.onSave = (resp) => { if (resp.saved) { @@ -377,17 +382,26 @@ $(document).ready(function(){ $P.fnDisplay = () => { var displayArea = document.querySelector("#display--${pageName}"); - var imgTags = $P.uploadSet.inStrings("").join("\n"); - displayArea.innerHTML = imgTags; - var display2Area = document.querySelector("#display2--${pageName}"); - var imgTags2 = ""; + var imgTagsFromUploadSet = $P.localUploadArr.map(function(item){ + return ""; + }).join("\n"); + + var imgTagsFromNumberPlate = ""; + if($P.numberPlateArr.length > 0){ + $P.numberPlateArr.forEach(function(item, index){ + imgTagsFromNumberPlate += ""; + }); + } + + var imgTagsFromVideo = ""; if($P.captureFileArr.length > 0){ $P.captureFileArr.forEach(function(item, index){ - imgTags2 += ""; + imgTagsFromVideo += ""; }); } - display2Area.innerHTML = imgTags2; + + displayArea.innerHTML = imgTagsFromUploadSet + imgTagsFromNumberPlate + imgTagsFromVideo; }; $P.fnSave = () => { @@ -430,13 +444,22 @@ $(document).ready(function(){ }); }); + } + + $P.editPhotoCallback = (modifiedFile, originalFileInfo, isNumberPlate) => { + console.log(modifiedFile); + console.log(originalFileInfo); + console.log(isNumberPlate); + } /************************************************************************** * element.on **************************************************************************/ $("#btnInst--${pageName}").on('click', () => $P.fnSave()); - $("#btnAddFile--${pageName}").on('click', () => { $("#uploadFileList--${pageName}").trigger("click"); }); + + $("#btnAddFile--${pageName}").on('click', () => { $("#inputUploadSet--${pageName}").trigger("click"); }); + $("#btnOpenVideoCapture--${pageName}").on('click', () => { var crdnId = $("#crdnId--${pageName}").val(); @@ -446,7 +469,7 @@ $(document).ready(function(){ ); }); $("#btnEditPhoto--${pageName}").on('click', () => { - var fileId = $("#display3--${pageName}").find("[name='editTarget']:checked").val(); + var fileId = $("#display0--${pageName}").find("[name='editTarget']:checked").val(); window.open(wctx.url("/sprt/sprt03/020/main.do?openerPageName=${pageName}&fileId="+fileId) ,"editPhoto" @@ -498,8 +521,7 @@ $(document).ready(function(){ $P.crdnControl.setData([crdnInfo]); if(crdnInfo.videoExist == "N"){ - $("#cpatureTitleArea--${pageName}").hide(); - $("#display2--${pageName}").hide(); + $("#btnOpenVideoCapture--${pageName}").hide(); } if(crdnInfo.fileList){ @@ -520,10 +542,10 @@ $(document).ready(function(){ } }); - $("#display3--${pageName}").append(editPhotoArea); + $("#display0--${pageName}").append(editPhotoArea); } else { - $("#display3--${pageName}").append("등록된 사진이 없습니다."); + $("#display0--${pageName}").append("등록된 사진이 없습니다."); $("#btnEditPhoto--crdn01020-info").hide(); } diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp index bfa2cb12..13362d0e 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp @@ -236,19 +236,18 @@
-
+
+ +
+ +
-
-
- -
-
-
+
@@ -267,13 +266,14 @@ $(document).ready(function(){ var $P = pageObject["${pageName}"]; $P.captureFileArr = []; + $P.localUploadArr = []; /************************************************************************** * DatasetControl, Dataset, FormFields **************************************************************************/ $P.formFields = new FimsFormFields("#frmEdit--${pageName}"); - $P.uploadSet = uploadSupport("#uploadFileList--${pageName}"); + $P.uploadSet = uploadSupport("#inputUploadSet--${pageName}"); $P.crdnControl = new DatasetControl({ urls : { load : "", create : wctx.url("/${taskSeCd}/crdn/crdn05/030/create.do") }, @@ -299,6 +299,11 @@ $(document).ready(function(){ if(formData.get("uploadFileList").size == 0){ formData.delete("uploadFileList"); } + + if($P.localUploadArr.length > 0){ + $P.localUploadArr.forEach(item => formData.append("uploadFileList",item)); + } + if($P.captureFileArr.length > 0){ $P.captureFileArr.forEach(item => formData.append("uploadFileList",item)); } @@ -313,8 +318,13 @@ $(document).ready(function(){ /************************************************************************** * DatasetControl.on, Dataset.on **************************************************************************/ - $P.uploadSet.onDatasetChange = () => { $P.fnDisplay(); }; - $P.uploadSet.onRemove = () => { $P.fnDisplay(); }; + $P.uploadSet.onDatasetChange = () => { + var files = $P.uploadSet.getDataset(); + files.forEach(item => $P.localUploadArr.push(item)); + + $P.fnDisplay(); + }; + $P.uploadSet.onRemove = () => { }; $P.crdnControl.onSave = (resp) => { if (resp.saved) { @@ -328,17 +338,21 @@ $(document).ready(function(){ $P.fnDisplay = () => { var displayArea = document.querySelector("#display--${pageName}"); - var imgTags = $P.uploadSet.inStrings("").join("\n"); - displayArea.innerHTML = imgTags; - var display2Area = document.querySelector("#display2--${pageName}"); - var imgTags2 = ""; + var imgTagsFromUploadSet = $P.localUploadArr.map(function(item){ + return ""; + }).join("\n"); + + + var imgTagsFromVideo = ""; if($P.captureFileArr.length > 0){ $P.captureFileArr.forEach(function(item, index){ - imgTags2 += ""; + imgTagsFromVideo += ""; }); } - display2Area.innerHTML = imgTags2; + + displayArea.innerHTML = imgTagsFromUploadSet + imgTagsFromVideo; + }; $P.fnSave = () => { @@ -387,7 +401,9 @@ $(document).ready(function(){ **************************************************************************/ $("#btnInst--${pageName}").on('click', () => $P.fnSave()); - $("#btnAddFile--${pageName}").on('click', () => { $("#uploadFileList--${pageName}").trigger("click"); }); + + $("#btnAddFile--${pageName}").on('click', () => { $("#inputUploadSet--${pageName}").trigger("click"); }); + $("#btnOpenVideoCapture--${pageName}").on('click', () => { window.open(wctx.url("/sprt/sprt03/010/main.do?openerPageName=${pageName}") ,"newVideoCapture" diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp index 8cfe6537..4eaef27e 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp @@ -76,6 +76,7 @@