|
|
|
@ -7,6 +7,8 @@
|
|
|
|
|
<div class="col-xl-9 mx-1">
|
|
|
|
|
<!-- 입력 영역 -->
|
|
|
|
|
<form id="frmEdit--${pageName}" name="frmEdit">
|
|
|
|
|
<input type="hidden" id="crdnId--${pageName}" name="crdnId" data-map="CRDN_ID" />
|
|
|
|
|
<input type="hidden" id="atchFileCnt--${pageName}" name="atchFileCnt" data-map="ATCH_FILE_CNT" />
|
|
|
|
|
<input type="hidden" id="rtpyrId--${pageName}" name="rtpyrId" data-map="RTPYR_ID" />
|
|
|
|
|
|
|
|
|
|
<!-- 단속 정보 -->
|
|
|
|
@ -276,31 +278,32 @@
|
|
|
|
|
</div> <!-- <div class="col-xl-9 mx-1"> -->
|
|
|
|
|
|
|
|
|
|
<!-- 단속 이미지 -->
|
|
|
|
|
<div class="col-xl-3 mx-1">
|
|
|
|
|
<div class="card">
|
|
|
|
|
<form id="frmFile--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
|
|
<input type="file" id="newFileList--${pageName}" name="newFileList" multiple accept="image/*" hidden />
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<form id="frmUploadSet--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
|
|
<input type="file" id="inputUploadSet--${pageName}" name="inputUploadSet" multiple accept="image/*" hidden />
|
|
|
|
|
</form>
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<!-- 단속사진 버튼 -->
|
|
|
|
|
<div class="container-page-btn">
|
|
|
|
|
<!-- 버튼 우측 정렬 -->
|
|
|
|
|
<span class="container-window-btn-right">
|
|
|
|
|
<button type="button" id="btnAddFile--${pageName}" class="btn btn-primary">이미지 추가</button>
|
|
|
|
|
<button type="button" id="btnOpenVideoCapture--${pageName}" class="btn btn-primary">동영상 캡쳐</button>
|
|
|
|
|
<button type="button" id="btnCancelAddFile--${pageName}" class="btn btn-primary">선택 사진 삭제</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card" style="width:500px;">
|
|
|
|
|
<form id="frmFile--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-12 d-flex justify-content-between">
|
|
|
|
|
<div>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="btnEditPhoto--${pageName}" title="선택 사진 편집">편집</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="display--${pageName}" style="overflow-y: scroll;height: 600px;border-style: solid;">
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="btnSaveFile--${pageName}" title="저장" onclick="fnSaveFile${pageName}();">저장</button>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="btnAddFile--${pageName}" title="사진 추가">추가</button>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="btnDeleteFile--${pageName}" title="선택 사진 삭제">삭제</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div> <!-- <div class="card"> -->
|
|
|
|
|
</div> <!-- 단속 이미지 <div class="col-xl-3 mx-1"> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div id="displayForExist--${pageName}" style="overflow-y:scroll; min-height:80px; max-height:600px; border-style:solid;">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form id="frmUploadSet--${pageName}" method="post" enctype="multipart/form-data">
|
|
|
|
|
<input type="file" id="inputUploadSet--${pageName}" name="inputUploadSet" multiple accept="image/*" hidden />
|
|
|
|
|
</form>
|
|
|
|
|
<div id="displayForNew--${pageName}" style="overflow-y:scroll; min-height:40px; max-height:80px; border-style:solid;">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div> <!-- <div class="d-flex flex-row justify-content-evenly"> -->
|
|
|
|
|
</div> <!-- <div class="content-wrapper"> -->
|
|
|
|
|
|
|
|
|
@ -312,6 +315,16 @@
|
|
|
|
|
var ${pageName}PrefixUrl = "/sprt/sprt02";
|
|
|
|
|
// FormFields
|
|
|
|
|
var ${pageName}Fields = new FormFields("#frmEdit--${pageName}");
|
|
|
|
|
// 단속 사진
|
|
|
|
|
var uploadSet = uploadSupport("#inputUploadSet--${pageName}");
|
|
|
|
|
|
|
|
|
|
var existFileArr = [];
|
|
|
|
|
var captureFileArr = [];
|
|
|
|
|
var localUploadArr = [];
|
|
|
|
|
var numberPlateArr = [];
|
|
|
|
|
|
|
|
|
|
// 파일 리스트
|
|
|
|
|
var fileListArr = [];
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* DatasetControl
|
|
|
|
@ -340,11 +353,139 @@
|
|
|
|
|
${pageName}Fields.set(item); // Dataset 셋팅
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 저장
|
|
|
|
|
${pageName}Control.onSave = (resp) => {
|
|
|
|
|
dialog.alert(resp.retMessage);
|
|
|
|
|
|
|
|
|
|
if (resp.saved) {
|
|
|
|
|
// fnDataRefreshInfo(); // 자료 재조회
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
${pageName}Control.save = (info) => {
|
|
|
|
|
if (!info) return;
|
|
|
|
|
|
|
|
|
|
let formData = new FormData(document.getElementById("frmFile--${pageName}"));
|
|
|
|
|
|
|
|
|
|
for (let key in info) {
|
|
|
|
|
let value = info[key];
|
|
|
|
|
|
|
|
|
|
formData.append(key, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
formData.delete("newFileList");
|
|
|
|
|
formData.delete("modifyFileList");
|
|
|
|
|
|
|
|
|
|
// 추가 파일 등록
|
|
|
|
|
if (localUploadArr.length > 0) {
|
|
|
|
|
localUploadArr.forEach(item => formData.append("newFileList", item));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ajax.post({
|
|
|
|
|
url : wctx.url("/sprt/sprt02/020/update.do")
|
|
|
|
|
, data : formData
|
|
|
|
|
, contentType : false
|
|
|
|
|
, processData : false
|
|
|
|
|
, success : resp => {
|
|
|
|
|
${pageName}Control.onSave(resp);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uploadSet.onDatasetChange = () => {
|
|
|
|
|
let files = uploadSet.getDataset();
|
|
|
|
|
|
|
|
|
|
files.forEach(item => localUploadArr.push(item));
|
|
|
|
|
|
|
|
|
|
fnImageDisplay(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
uploadSet.onRemove = () => {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* function 이미지 관련
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
fnMakeImgForExistFile = (fileArr) => {
|
|
|
|
|
var tagsText = "";
|
|
|
|
|
|
|
|
|
|
for (var index = 0, j = 0; index < fileArr.length; index++) {
|
|
|
|
|
var item = fileArr[index];
|
|
|
|
|
|
|
|
|
|
if (item.status == "delete") {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tagsText += "<label class='mx-2'>";
|
|
|
|
|
tagsText += "<input type='radio' name='existPhoto' class='form-check-input' value='" + item.FILE_ID + "' ";
|
|
|
|
|
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
tagsText += " checked='checked' ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tagsText += " />";
|
|
|
|
|
tagsText += "<img src='"+ item.URL +"' width='280' height='150' />";
|
|
|
|
|
tagsText += "</label>";
|
|
|
|
|
|
|
|
|
|
if (j % 2 == 1) {
|
|
|
|
|
tagsText += "<br />";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return tagsText;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fnMakeImgForNewFile = (fileArr) => {
|
|
|
|
|
var tagsText = "";
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < fileArr.length; index++) {
|
|
|
|
|
var item = fileArr[index];
|
|
|
|
|
|
|
|
|
|
tagsText += "<label class='mx-2'>";
|
|
|
|
|
tagsText += "<input type='checkbox' name='newPhoto' class='form-check-input' value='"+item.id +"' ";
|
|
|
|
|
tagsText += " />";
|
|
|
|
|
tagsText += "<img src='"+ item.url +"' width='280' height='150' />";
|
|
|
|
|
tagsText += "</label>";
|
|
|
|
|
|
|
|
|
|
if (index % 2 == 1) {
|
|
|
|
|
tagsText += "<br />";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return tagsText;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fnImageDisplay = (isExist) => {
|
|
|
|
|
if (isExist) {
|
|
|
|
|
var displayArea = document.querySelector("#displayForExist--${pageName}");
|
|
|
|
|
var tagsText = fnMakeImgForExistFile(existFileArr);
|
|
|
|
|
|
|
|
|
|
if (tagsText == "") {
|
|
|
|
|
displayArea.innerHTML = "등록된 사진이 없습니다.";
|
|
|
|
|
$("#btnEditPhoto--${pageName}").hide();
|
|
|
|
|
} else {
|
|
|
|
|
displayArea.innerHTML = tagsText;
|
|
|
|
|
$("#btnEditPhoto--${pageName}").show();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
var displayArea = document.querySelector("#displayForNew--${pageName}");
|
|
|
|
|
var concatArr = localUploadArr.concat(numberPlateArr).concat(captureFileArr);
|
|
|
|
|
var tagsText = fnMakeImgForNewFile(concatArr);
|
|
|
|
|
|
|
|
|
|
displayArea.innerHTML = tagsText;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* function
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
// 민원 원본 보기
|
|
|
|
|
openCvlcptOrgnl${pageName} = (params) => {
|
|
|
|
|
openCvlcptOrgnl${pageName} = (params) => {
|
|
|
|
|
if (!params) return;
|
|
|
|
|
|
|
|
|
|
let dialogId = "cvlcptOrgnlDialog--${pageName}";
|
|
|
|
|
|
|
|
|
|
ajax.get({
|
|
|
|
@ -377,6 +518,40 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 자료 재조회
|
|
|
|
|
fnDataRefreshInfo = () => {
|
|
|
|
|
let crdnId = $("#crdnId--${pageNameMain}").val();
|
|
|
|
|
|
|
|
|
|
// 단속 ID 가 없다면.. return
|
|
|
|
|
if (crdnId == null || crdnId == "") {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let params = {
|
|
|
|
|
callPurpose : "view"
|
|
|
|
|
, crdnId : crdnId
|
|
|
|
|
, delYn : "N"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ajax.get({
|
|
|
|
|
url : wctx.url("/sprt/sprt02/020/info.do")
|
|
|
|
|
, headers: { Accept: "application/json; charset=utf-8" } // json
|
|
|
|
|
, data : params || {}
|
|
|
|
|
, success : resp => {
|
|
|
|
|
if (resp.crdnPayer) {
|
|
|
|
|
${pageName}Control.setData([resp.crdnPayer]);
|
|
|
|
|
} else {
|
|
|
|
|
$("#frmEdit--${pageName}")[0].reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 최상단 단속 Data 셋팅
|
|
|
|
|
if (resp.crdnPayer) {
|
|
|
|
|
${pageNameMain}Control.setData([resp.crdnPayer]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* 초기 셋팅
|
|
|
|
|
**************************************************************************/
|
|
|
|
@ -424,17 +599,77 @@
|
|
|
|
|
|
|
|
|
|
// 이벤트 설정
|
|
|
|
|
setEvent${pageName} = () => {
|
|
|
|
|
//
|
|
|
|
|
// 선택 사진 편집
|
|
|
|
|
$("#btnEditPhoto--${pageName}").on('click', () => {
|
|
|
|
|
let checked = $("#displayForExist--${pageName}").find("[name='existPhoto']:checked");
|
|
|
|
|
if (checked.length < 1) {
|
|
|
|
|
dialog.alert("선택된 사진이 없습니다.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let fileId = checked.val();
|
|
|
|
|
|
|
|
|
|
window.open(wctx.url("/sprt/sprt03/020/main.do?openerPageName=${pageName}&fileId=" + fileId)
|
|
|
|
|
,"editPhoto"
|
|
|
|
|
,"width=1400,height=750"
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 선택 사진 삭제
|
|
|
|
|
$("#btnDeleteExistPhoto--${pageName}").on('click', () => {
|
|
|
|
|
let checked = $("#displayForExist--${pageName}").find("[name='existPhoto']:checked");
|
|
|
|
|
if (checked.length < 1) {
|
|
|
|
|
dialog.alert("선택된 사진이 없습니다.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let target = checked[0].value;
|
|
|
|
|
|
|
|
|
|
existFileArr.forEach(function(item) {
|
|
|
|
|
if (item.FILE_ID == target) {
|
|
|
|
|
item.status = "delete";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
fnImageDisplay(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 사진 추가
|
|
|
|
|
$("#btnAddFile--${pageName}").on("click", () => {
|
|
|
|
|
$("#inputUploadSet--${pageName}").trigger("click");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 사진 삭제
|
|
|
|
|
$("#btnCancelAddFile--${pageName}").on('click', () => {
|
|
|
|
|
let checked = $("#displayForNew--${pageName}").find("[name='newPhoto']:checked");
|
|
|
|
|
|
|
|
|
|
if (checked.length < 1) {
|
|
|
|
|
dialog.alert("선택된 사진이 없습니다.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let checkedArr = [];
|
|
|
|
|
|
|
|
|
|
for (let iLoop = 0; iLoop < checked.length; iLoop++) {
|
|
|
|
|
checkedArr.push(checked[iLoop].value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
captureFileArr = captureFileArr.filter(item => checkedArr.indexOf(item.id) == -1);
|
|
|
|
|
localUploadArr = localUploadArr.filter(item => checkedArr.indexOf(item.id) == -1);
|
|
|
|
|
numberPlateArr = numberPlateArr.filter(item => checkedArr.indexOf(item.id) == -1);
|
|
|
|
|
|
|
|
|
|
fnImageDisplay(false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* function
|
|
|
|
|
* 버튼 clickEvent
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
// 민원 원본 보기
|
|
|
|
|
fnOpenCvlcptOrgnl${pageName} = () => {
|
|
|
|
|
let crdnId = ${pageName}Control.dataset.getValue("CRDN_ID");
|
|
|
|
|
let sggCd = $("#sggCd--${pageNameMain}").val();
|
|
|
|
|
let taskSeCd = $("#taskSeCd--${pageNameMain}").val();
|
|
|
|
|
let sggCd = ${pageName}Control.dataset.getValue("SGG_CD");
|
|
|
|
|
let taskSeCd = ${pageName}Control.dataset.getValue("TASK_SE_CD");
|
|
|
|
|
|
|
|
|
|
// 단속 ID 가 없다면.. return
|
|
|
|
|
if (crdnId == null || crdnId == "") {
|
|
|
|
@ -503,6 +738,16 @@
|
|
|
|
|
console.log("단속 상태 변경");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 사진 변경 저장
|
|
|
|
|
fnSaveFile${pageName} = () => {
|
|
|
|
|
dialog.alert({
|
|
|
|
|
content : "현재 사진 정보를 저장하시겠습니까?"
|
|
|
|
|
, onOK : () => {
|
|
|
|
|
${pageName}Control.save(${pageName}Fields.get());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* script 진입
|
|
|
|
|
**************************************************************************/
|
|
|
|
@ -513,8 +758,20 @@
|
|
|
|
|
// 화면 초기 설정
|
|
|
|
|
initForm${pageName}();
|
|
|
|
|
|
|
|
|
|
let crdnPayerInfo = ${crdnPayer};
|
|
|
|
|
|
|
|
|
|
// Dataset 셋팅
|
|
|
|
|
${pageName}Control.setData([${crdnPayer}]);
|
|
|
|
|
${pageName}Control.setData([crdnPayerInfo]);
|
|
|
|
|
|
|
|
|
|
// 이미지 셋팅
|
|
|
|
|
if (crdnPayerInfo.fileList) {
|
|
|
|
|
crdnPayerInfo.fileList.forEach(function(item) {
|
|
|
|
|
item.status = "";
|
|
|
|
|
existFileArr.push(item);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fnImageDisplay(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// #sourceURL=sprt02020-info.jsp
|
|
|
|
|