+
-
+
+
-
-
-
-
-
캡쳐 이미지
-
+
+
+
+
+
-
@@ -300,17 +306,21 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
+ $P.existFileArr = [];
+
$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") },
+ urls : { load : "", update : wctx.url("/${taskSeCd}/crdn/crdn01/020/save.do") },
keymapper:info => info ? info.CRDN_ID : "",
dataGetter:obj => obj.crdnInfo,
formats: {
@@ -330,11 +340,30 @@ $(document).ready(function(){
formData.append(key,value);
}
- if(formData.get("uploadFileList").size == 0){
- formData.delete("uploadFileList");
+ formData.delete("newFileList");
+ formData.delete("modifyFileList");
+
+ if($P.localUploadArr.length > 0){
+ $P.localUploadArr.forEach(item => formData.append("newFileList",item));
+ }
+ if($P.numberPlateArr.length > 0){
+ $P.numberPlateArr.forEach(item => formData.append("newFileList",item));
}
if($P.captureFileArr.length > 0){
- $P.captureFileArr.forEach(item => formData.append("uploadFileList",item));
+ $P.captureFileArr.forEach(item => formData.append("newFileList",item));
+ }
+
+
+
+ if($P.existFileArr.length > 0){
+ for(var i=0; i < $P.existFileArr.length; i++){
+ if($P.existFileArr[i].status == "delete"){
+ formData.append("deleteFileKeyList", $P.existFileArr[i].FILE_ID);
+ } else if($P.existFileArr[i].status == "modified"){
+ formData.append("modifyFileKeyList", $P.existFileArr[i].FILE_ID);
+ formData.append("modifyFileList", $P.existFileArr[i]);
+ }
+ }
}
ajax.post({
@@ -351,32 +380,91 @@ $(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(false);
+ };
+ $P.uploadSet.onRemove = () => { };
$P.crdnControl.onSave = (resp) => {
if (resp.saved) {
dialog.alert("저장됐습니다.");
- dialog.close("manualdialog");
+ dialog.close("cvlcptInitialDataEditDialog--${openerPageName}");
}
};
/**************************************************************************
* pageObject.function
**************************************************************************/
+ $P.fnMakeImgForExistFile = (fileArr) => {
+ var tagsText = "";
+
+ for(var index = 0, j = 0; index < fileArr.length; index++){
+ var item = fileArr[index];
+
+ if(item.status == "delete"){
+ continue;
+ }
+
+ tagsText += "
";
+
+ if(j % 2 == 1){
+ tagsText += "
";
+ }
+
+ j++;
+ }
- $P.fnDisplay = () => {
- var displayArea = document.querySelector("#display--${pageName}");
- var imgTags = $P.uploadSet.inStrings("
").join("\n");
- displayArea.innerHTML = imgTags;
+ return tagsText;
+ }
+
+
+ $P.fnMakeImgForNewFile = (fileArr) => {
+ var tagsText = "";
- var display2Area = document.querySelector("#display2--${pageName}");
- var imgTags2 = "";
- if($P.captureFileArr.length > 0){
- $P.captureFileArr.forEach(function(item, index){
- imgTags2 += "
";
- });
+ for(var index = 0; index < fileArr.length; index++){
+ var item = fileArr[index];
+
+ tagsText += "
";
+
+ if(index % 2 == 1){
+ tagsText += "
";
+ }
+ }
+
+ return tagsText;
+ }
+
+ $P.fnDisplay = (isExist) => {
+ if(isExist){
+ var displayArea = document.querySelector("#displayForExist--${pageName}");
+ var tagsText = $P.fnMakeImgForExistFile($P.existFileArr);
+
+ if(tagsText == ""){
+ displayArea.innerHTML = "등록된 사진이 없습니다.";
+ $("#btnEditPhoto--crdn01020-info").hide();
+ } else {
+ displayArea.innerHTML = tagsText;
+ $("#btnEditPhoto--crdn01020-info").show();
+ }
+ } else {
+ var displayArea = document.querySelector("#displayForNew--${pageName}");
+ var concatArr = $P.localUploadArr.concat($P.numberPlateArr).concat($P.captureFileArr);
+ var tagsText = $P.fnMakeImgForNewFile(concatArr);
+ displayArea.innerHTML = tagsText;
}
- display2Area.innerHTML = imgTags2;
};
$P.fnSave = () => {
@@ -414,18 +502,42 @@ $(document).ready(function(){
file.url = (window.URL || window.webkitURL).createObjectURL(file);
$P.captureFileArr.push(file);
if(index === array.length - 1){
- $P.fnDisplay();
+ $P.fnDisplay(false);
}
});
});
}
+
+ $P.editPhotoCallback = (modifiedFile, originalFileInfo, isNumberPlate) => {
+
+ modifiedFile.id = "file-" + new Date().getTime() + "-" + "0";
+ modifiedFile.url = (window.URL || window.webkitURL).createObjectURL(modifiedFile);
+
+ if(isNumberPlate){
+ $P.numberPlateArr.push(modifiedFile);
+ $P.fnDisplay(false);
+ } else {
+ $P.existFileArr.forEach(function(item,index){
+ if(item.FILE_ID == originalFileInfo.FILE_ID){
+ modifiedFile.URL = modifiedFile.url;
+ modifiedFile.FILE_ID = originalFileInfo.FILE_ID;
+ modifiedFile.status = "modified";
+ $P.existFileArr.splice(index, 1, modifiedFile);
+ };
+ });
+
+ $P.fnDisplay(true);
+ }
+ }
/**************************************************************************
* 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();
@@ -435,14 +547,57 @@ $(document).ready(function(){
);
});
$("#btnEditPhoto--${pageName}").on('click', () => {
- var fileId = $("#display3--${pageName}").find("[name='editTarget']:checked").val();
+ var checked = $("#displayForExist--${pageName}").find("[name='existPhoto']:checked");
+ if(checked.length < 1){
+ alert("선택된 사진이 없습니다.");
+ return;
+ }
+
+ var fileId = checked.val();
window.open(wctx.url("/sprt/sprt03/020/main.do?openerPageName=${pageName}&fileId="+fileId)
,"editPhoto"
- ,"width=1800,height=950"
+ ,"width=1400,height=750"
);
});
+
+ $("#btnDeleteExistPhoto--${pageName}").on('click', () => {
+
+ var checked = $("#displayForExist--${pageName}").find("[name='existPhoto']:checked");
+ if(checked.length < 1){
+ alert("선택된 사진이 없습니다.");
+ return;
+ }
+
+ var target = checked[0].value;
+
+ $P.existFileArr.forEach(function(item){
+ if(item.FILE_ID == target){
+ item.status = "delete";
+ }
+ });
+
+ $P.fnDisplay(true);
+ });
+ $("#btnCancelAddFile--${pageName}").on('click', () => {
+ var checked = $("#displayForNew--${pageName}").find("[name='newPhoto']:checked");
+ if(checked.length < 1){
+ alert("선택된 사진이 없습니다.");
+ return;
+ }
+
+ var checkedArr = [];
+ for(var i=0; i < checked.length; i++){
+ checkedArr.push(checked[i].value);
+ }
+
+ $P.captureFileArr = $P.captureFileArr.filter(item => checkedArr.indexOf(item.id) == -1);
+ $P.localUploadArr = $P.localUploadArr.filter(item => checkedArr.indexOf(item.id) == -1);
+ $P.numberPlateArr = $P.numberPlateArr.filter(item => checkedArr.indexOf(item.id) == -1);
+
+ $P.fnDisplay(false);
+ });
/**************************************************************************
* 초기화
@@ -481,38 +636,25 @@ $(document).ready(function(){
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
-
+
+
+
var crdnInfo = ${crdnInfo};
crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.crdnControl.setData([crdnInfo]);
if(crdnInfo.videoExist == "N"){
- $("#cpatureTitleArea--${pageName}").hide();
- $("#display2--${pageName}").hide();
+ $("#btnOpenVideoCapture--${pageName}").hide();
}
if(crdnInfo.fileList){
- var editPhotoArea = "";
-
- crdnInfo.fileList.forEach(function(item, index){
- editPhotoArea += "
";
- editPhotoArea += "
";
- });
-
- $("#display3--${pageName}").append(editPhotoArea);
- } else {
-
- $("#display3--${pageName}").append("등록된 사진이 없습니다.");
- $("#btnEditPhoto--crdn01020-info").hide();
-
+ crdnInfo.fileList.forEach(function(item){
+ item.status = "";
+ $P.existFileArr.push(item);
+ });
}
+
+ $P.fnDisplay(true);
});
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp
index 2c48c413..9d4eec97 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp
@@ -1,3 +1,3 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
-
민원(새올) 개별 등록
\ No newline at end of file
+
민원 개별 등록
\ No newline at end of file
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..4cdee8dc 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,19 @@
-
+
+
-
-
-
-
-
+
-
@@ -267,13 +267,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") },
@@ -296,11 +297,14 @@ $(document).ready(function(){
formData.append(key,value);
}
- if(formData.get("uploadFileList").size == 0){
- formData.delete("uploadFileList");
+ formData.delete("newFileList");
+
+ if($P.localUploadArr.length > 0){
+ $P.localUploadArr.forEach(item => formData.append("newFileList",item));
}
+
if($P.captureFileArr.length > 0){
- $P.captureFileArr.forEach(item => formData.append("uploadFileList",item));
+ $P.captureFileArr.forEach(item => formData.append("newFileList",item));
}
ajax.post({
@@ -313,8 +317,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) {
@@ -325,20 +334,32 @@ $(document).ready(function(){
/**************************************************************************
* pageObject.function
**************************************************************************/
+ $P.fnMakeImgForNewFile = (fileArr) => {
+ var tagsText = "";
+
+ for(var index = 0; index < fileArr.length; index++){
+ var item = fileArr[index];
+
+ tagsText += "
";
+
+ if(index % 2 == 1){
+ tagsText += "
";
+ }
+ }
+ return tagsText;
+ }
+
$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 = "";
- if($P.captureFileArr.length > 0){
- $P.captureFileArr.forEach(function(item, index){
- imgTags2 += "
";
- });
- }
- display2Area.innerHTML = imgTags2;
+
+ var concatArr = $P.localUploadArr.concat($P.captureFileArr);
+ var tagsText = $P.fnMakeImgForNewFile(concatArr);
+ displayArea.innerHTML = tagsText;
};
$P.fnSave = () => {
@@ -387,7 +408,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"
@@ -395,6 +418,23 @@ $(document).ready(function(){
);
});
+ $("#btnCancelAddFile--${pageName}").on('click', () => {
+ var checked = $("#display--${pageName}").find("[name='newPhoto']:checked");
+ if(checked.length < 1){
+ alert("선택된 사진이 없습니다.");
+ return;
+ }
+
+ var checkedArr = [];
+ for(var i=0; i < checked.length; i++){
+ checkedArr.push(checked[i].value);
+ }
+
+ $P.captureFileArr = $P.captureFileArr.filter(item => checkedArr.indexOf(item.id) == -1);
+ $P.localUploadArr = $P.localUploadArr.filter(item => checkedArr.indexOf(item.id) == -1);
+
+ $P.fnDisplay();
+ });
/**************************************************************************
* 초기화
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp
index 4d094f2f..87a834a9 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp
@@ -392,7 +392,8 @@ $(document).ready(function(){
* 초기화
**************************************************************************/
initDatepicker("frmSearch--${pageName}"); //달력 초기화
-
+ initDetailSearchButton("frmSearch--${pageName}");
+
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
$("#frmSearch--${pageName} input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);
$P.fnResetAndChangeBiz(defaultBizValue);
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp
index 8a3e3be6..996611ca 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp
@@ -103,6 +103,8 @@
+
+
@@ -165,20 +167,30 @@