|
|
@ -253,7 +253,7 @@
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="row justify-content-end">
|
|
|
|
<div class="row justify-content-end">
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<button type="button" id="btnInst--${pageName}" class="btn btn-primary">등록</button>
|
|
|
|
<button type="button" id="btnInst--${pageName}" class="btn btn-primary">저장</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -263,7 +263,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="card" style="width:500px;">
|
|
|
|
<div class="card" style="width:500px;">
|
|
|
|
<form id="frmFile--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
|
<form id="frmFile--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
|
<input type="file" id="uploadFileList--${pageName}" name="uploadFileList" multiple accept="image/*" hidden />
|
|
|
|
<input type="file" id="newFileList--${pageName}" name="newFileList" multiple accept="image/*" hidden />
|
|
|
|
|
|
|
|
<input type="file" id="modifyFileList--${pageName}" name="modifyFileList" multiple accept="image/*" hidden />
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-md-12 d-flex justify-content-between">
|
|
|
|
<div class="col-md-12 d-flex justify-content-between">
|
|
|
@ -273,7 +274,7 @@
|
|
|
|
<button type="button" id="btnDeleteExistPhoto--${pageName}" class="btn btn-blue">선택 사진 삭제</button>
|
|
|
|
<button type="button" id="btnDeleteExistPhoto--${pageName}" class="btn btn-blue">선택 사진 삭제</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="display0--${pageName}" style="overflow-y: scroll;min-height: 40px;max-height: 340px;border-style: solid;">
|
|
|
|
<div id="displayForExist--${pageName}" style="overflow-y: scroll;min-height: 40px;max-height: 340px;border-style: solid;">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<form id="frmUploadSet--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
|
<form id="frmUploadSet--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
@ -287,7 +288,7 @@
|
|
|
|
<button type="button" id="btnCancelAddFile--${pageName}" class="btn btn-blue">선택 사진 삭제</button>
|
|
|
|
<button type="button" id="btnCancelAddFile--${pageName}" class="btn btn-blue">선택 사진 삭제</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="display--${pageName}" style="overflow-y: scroll;min-height: 40px;max-height: 340px;border-style: solid;">
|
|
|
|
<div id="displayForNew--${pageName}" style="overflow-y: scroll;min-height: 40px;max-height: 340px;border-style: solid;">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -305,6 +306,8 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
var $P = pageObject["${pageName}"];
|
|
|
|
var $P = pageObject["${pageName}"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.existFileArr = [];
|
|
|
|
|
|
|
|
|
|
|
|
$P.captureFileArr = [];
|
|
|
|
$P.captureFileArr = [];
|
|
|
|
$P.localUploadArr = [];
|
|
|
|
$P.localUploadArr = [];
|
|
|
|
$P.numberPlateArr = [];
|
|
|
|
$P.numberPlateArr = [];
|
|
|
@ -317,7 +320,7 @@ $(document).ready(function(){
|
|
|
|
$P.uploadSet = uploadSupport("#inputUploadSet--${pageName}");
|
|
|
|
$P.uploadSet = uploadSupport("#inputUploadSet--${pageName}");
|
|
|
|
|
|
|
|
|
|
|
|
$P.crdnControl = new DatasetControl({
|
|
|
|
$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 : "",
|
|
|
|
keymapper:info => info ? info.CRDN_ID : "",
|
|
|
|
dataGetter:obj => obj.crdnInfo,
|
|
|
|
dataGetter:obj => obj.crdnInfo,
|
|
|
|
formats: {
|
|
|
|
formats: {
|
|
|
@ -337,21 +340,31 @@ $(document).ready(function(){
|
|
|
|
formData.append(key,value);
|
|
|
|
formData.append(key,value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(formData.get("uploadFileList").size == 0){
|
|
|
|
formData.delete("newFileList");
|
|
|
|
formData.delete("uploadFileList");
|
|
|
|
formData.delete("modifyFileList");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($P.localUploadArr.length > 0){
|
|
|
|
if($P.localUploadArr.length > 0){
|
|
|
|
$P.localUploadArr.forEach(item => formData.append("uploadFileList",item));
|
|
|
|
$P.localUploadArr.forEach(item => formData.append("newFileList",item));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($P.numberPlateArr.length > 0){
|
|
|
|
if($P.numberPlateArr.length > 0){
|
|
|
|
$P.numberPlateArr.forEach(item => formData.append("uploadFileList",item));
|
|
|
|
$P.numberPlateArr.forEach(item => formData.append("newFileList",item));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($P.captureFileArr.length > 0){
|
|
|
|
if($P.captureFileArr.length > 0){
|
|
|
|
$P.captureFileArr.forEach(item => formData.append("uploadFileList",item));
|
|
|
|
$P.captureFileArr.forEach(item => formData.append("newFileList",item));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//TODO : 편집된 파일, 삭제 사진 키값
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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({
|
|
|
|
ajax.post({
|
|
|
|
url:!create ? $P.crdnControl.urls.update : $P.crdnControl.urls.create,
|
|
|
|
url:!create ? $P.crdnControl.urls.update : $P.crdnControl.urls.create,
|
|
|
@ -371,14 +384,14 @@ $(document).ready(function(){
|
|
|
|
var files = $P.uploadSet.getDataset();
|
|
|
|
var files = $P.uploadSet.getDataset();
|
|
|
|
files.forEach(item => $P.localUploadArr.push(item));
|
|
|
|
files.forEach(item => $P.localUploadArr.push(item));
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay();
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$P.uploadSet.onRemove = () => { };
|
|
|
|
$P.uploadSet.onRemove = () => { };
|
|
|
|
|
|
|
|
|
|
|
|
$P.crdnControl.onSave = (resp) => {
|
|
|
|
$P.crdnControl.onSave = (resp) => {
|
|
|
|
if (resp.saved) {
|
|
|
|
if (resp.saved) {
|
|
|
|
dialog.alert("저장됐습니다.");
|
|
|
|
dialog.alert("저장됐습니다.");
|
|
|
|
dialog.close("manualdialog");
|
|
|
|
dialog.close("cvlcptInitialDataEditDialog--${openerPageName}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
/**************************************************************************
|
|
|
|
/**************************************************************************
|
|
|
@ -387,9 +400,13 @@ $(document).ready(function(){
|
|
|
|
$P.fnMakeImgForExistFile = (fileArr) => {
|
|
|
|
$P.fnMakeImgForExistFile = (fileArr) => {
|
|
|
|
var tagsText = "";
|
|
|
|
var tagsText = "";
|
|
|
|
|
|
|
|
|
|
|
|
for(var index = 0; index < fileArr.length; index++){
|
|
|
|
for(var index = 0, j = 0; index < fileArr.length; index++){
|
|
|
|
var item = fileArr[index];
|
|
|
|
var item = fileArr[index];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(item.status == "delete"){
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tagsText += "<label class='mx-2'>";
|
|
|
|
tagsText += "<label class='mx-2'>";
|
|
|
|
tagsText += "<input type='radio' name='existPhoto' class='form-check-input' value='"+item.FILE_ID +"' ";
|
|
|
|
tagsText += "<input type='radio' name='existPhoto' class='form-check-input' value='"+item.FILE_ID +"' ";
|
|
|
|
if(index == 0){
|
|
|
|
if(index == 0){
|
|
|
@ -399,9 +416,11 @@ $(document).ready(function(){
|
|
|
|
tagsText += "<img src='"+ item.URL +"' width='200' height='200' />";
|
|
|
|
tagsText += "<img src='"+ item.URL +"' width='200' height='200' />";
|
|
|
|
tagsText += "</label>";
|
|
|
|
tagsText += "</label>";
|
|
|
|
|
|
|
|
|
|
|
|
if(index % 2 == 1){
|
|
|
|
if(j % 2 == 1){
|
|
|
|
tagsText += "<br />"
|
|
|
|
tagsText += "<br />";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tagsText;
|
|
|
|
return tagsText;
|
|
|
@ -421,19 +440,31 @@ $(document).ready(function(){
|
|
|
|
tagsText += "</label>";
|
|
|
|
tagsText += "</label>";
|
|
|
|
|
|
|
|
|
|
|
|
if(index % 2 == 1){
|
|
|
|
if(index % 2 == 1){
|
|
|
|
tagsText += "<br />"
|
|
|
|
tagsText += "<br />";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tagsText;
|
|
|
|
return tagsText;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay = () => {
|
|
|
|
$P.fnDisplay = (isExist) => {
|
|
|
|
var displayArea = document.querySelector("#display--${pageName}");
|
|
|
|
if(isExist){
|
|
|
|
|
|
|
|
var displayArea = document.querySelector("#displayForExist--${pageName}");
|
|
|
|
var concatArr = $P.localUploadArr.concat($P.numberPlateArr).concat($P.captureFileArr);
|
|
|
|
var tagsText = $P.fnMakeImgForExistFile($P.existFileArr);
|
|
|
|
var tagsText = $P.fnMakeImgForNewFile(concatArr);
|
|
|
|
|
|
|
|
displayArea.innerHTML = tagsText;
|
|
|
|
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;
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnSave = () => {
|
|
|
|
$P.fnSave = () => {
|
|
|
@ -471,7 +502,7 @@ $(document).ready(function(){
|
|
|
|
file.url = (window.URL || window.webkitURL).createObjectURL(file);
|
|
|
|
file.url = (window.URL || window.webkitURL).createObjectURL(file);
|
|
|
|
$P.captureFileArr.push(file);
|
|
|
|
$P.captureFileArr.push(file);
|
|
|
|
if(index === array.length - 1){
|
|
|
|
if(index === array.length - 1){
|
|
|
|
$P.fnDisplay();
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -485,14 +516,19 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
if(isNumberPlate){
|
|
|
|
if(isNumberPlate){
|
|
|
|
$P.numberPlateArr.push(modifiedFile);
|
|
|
|
$P.numberPlateArr.push(modifiedFile);
|
|
|
|
$P.fnDisplay();
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// TODO : 편집된사진 표시
|
|
|
|
$P.existFileArr.forEach(function(item,index){
|
|
|
|
}
|
|
|
|
if(item.FILE_ID == originalFileInfo.FILE_ID){
|
|
|
|
|
|
|
|
modifiedFile.URL = modifiedFile.url;
|
|
|
|
console.log(originalFileInfo);
|
|
|
|
modifiedFile.FILE_ID = originalFileInfo.FILE_ID;
|
|
|
|
|
|
|
|
modifiedFile.status = "modified";
|
|
|
|
|
|
|
|
$P.existFileArr.splice(index, 1, modifiedFile);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**************************************************************************
|
|
|
|
/**************************************************************************
|
|
|
|
* element.on
|
|
|
|
* element.on
|
|
|
@ -511,7 +547,7 @@ $(document).ready(function(){
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$("#btnEditPhoto--${pageName}").on('click', () => {
|
|
|
|
$("#btnEditPhoto--${pageName}").on('click', () => {
|
|
|
|
var checked = $("#display0--${pageName}").find("[name='existPhoto']:checked");
|
|
|
|
var checked = $("#displayForExist--${pageName}").find("[name='existPhoto']:checked");
|
|
|
|
if(checked.length < 1){
|
|
|
|
if(checked.length < 1){
|
|
|
|
alert("선택된 사진이 없습니다.");
|
|
|
|
alert("선택된 사진이 없습니다.");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -526,11 +562,26 @@ $(document).ready(function(){
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("#btnDeleteExistPhoto--${pageName}").on('click', () => {
|
|
|
|
$("#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', () => {
|
|
|
|
$("#btnCancelAddFile--${pageName}").on('click', () => {
|
|
|
|
var checked = $("#display--${pageName}").find("[name='newPhoto']:checked");
|
|
|
|
var checked = $("#displayForNew--${pageName}").find("[name='newPhoto']:checked");
|
|
|
|
if(checked.length < 1){
|
|
|
|
if(checked.length < 1){
|
|
|
|
alert("선택된 사진이 없습니다.");
|
|
|
|
alert("선택된 사진이 없습니다.");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -545,7 +596,7 @@ $(document).ready(function(){
|
|
|
|
$P.localUploadArr = $P.localUploadArr.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.numberPlateArr = $P.numberPlateArr.filter(item => checkedArr.indexOf(item.id) == -1);
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay();
|
|
|
|
$P.fnDisplay(false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
/**************************************************************************
|
|
|
@ -585,7 +636,9 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
//보안모드
|
|
|
|
//보안모드
|
|
|
|
fn_securityModeToggle($("#securityMode--top").is(":checked"));
|
|
|
|
fn_securityModeToggle($("#securityMode--top").is(":checked"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var crdnInfo = ${crdnInfo};
|
|
|
|
var crdnInfo = ${crdnInfo};
|
|
|
|
crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
|
|
|
|
crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
|
|
|
|
$P.crdnControl.setData([crdnInfo]);
|
|
|
|
$P.crdnControl.setData([crdnInfo]);
|
|
|
@ -595,14 +648,13 @@ $(document).ready(function(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(crdnInfo.fileList){
|
|
|
|
if(crdnInfo.fileList){
|
|
|
|
var tagsText = $P.fnMakeImgForExistFile(crdnInfo.fileList);
|
|
|
|
crdnInfo.fileList.forEach(function(item){
|
|
|
|
$("#display0--${pageName}").append(tagsText);
|
|
|
|
item.status = "";
|
|
|
|
} else {
|
|
|
|
$P.existFileArr.push(item);
|
|
|
|
|
|
|
|
});
|
|
|
|
$("#display0--${pageName}").append("등록된 사진이 없습니다.");
|
|
|
|
|
|
|
|
$("#btnEditPhoto--crdn01020-info").hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|