|
|
@ -76,65 +76,88 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
var openerPageName = "${openerPageName}";
|
|
|
|
var openerPageName = "${openerPageName}";
|
|
|
|
|
|
|
|
|
|
|
|
//FIXME: pw instance 변수명 변경시 paintweb.js의 imageSaveTo() 내의 2564 line if(pw.image.modified) 변경 필요
|
|
|
|
|
|
|
|
var pw;
|
|
|
|
|
|
|
|
var originalInfomation = {};
|
|
|
|
|
|
|
|
var editableImage = null;
|
|
|
|
|
|
|
|
var isNumberPlate = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initEditor = () => {
|
|
|
|
var pw;
|
|
|
|
|
|
|
|
var originalInfomation = {};
|
|
|
|
|
|
|
|
var editableImage = null;
|
|
|
|
|
|
|
|
var isNumberPlate = false;
|
|
|
|
|
|
|
|
|
|
|
|
pw = new PaintWeb();
|
|
|
|
const initEditor = () => {
|
|
|
|
pw.config.imageLoad = editableImage;
|
|
|
|
|
|
|
|
pw.config.guiPlaceholder = document.getElementById('paintWebTarget');
|
|
|
|
|
|
|
|
pw.config.imageSave = fnImageSaveTo;
|
|
|
|
|
|
|
|
pw.config.afterImageSave = fnAfterImageSave;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pw.init();
|
|
|
|
pw = new PaintWeb();
|
|
|
|
};
|
|
|
|
pw.config.imageLoad = editableImage;
|
|
|
|
|
|
|
|
pw.config.guiPlaceholder = document.getElementById('paintWebTarget');
|
|
|
|
|
|
|
|
pw.config.imageSave = fnImageSaveTo;
|
|
|
|
|
|
|
|
pw.config.afterImageSave = fnAfterImageSave;
|
|
|
|
|
|
|
|
|
|
|
|
function fnImageSaveTo(file, imgWidth, imgHeight, doc, _self){
|
|
|
|
pw.init();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
console.log(doc);
|
|
|
|
function fnImageSaveTo(file, imgWidth, imgHeight, doc, _self){
|
|
|
|
console.log(_self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(isNumberPlate){
|
|
|
|
console.log(doc);
|
|
|
|
if(!confirm('번호판 이미지를 추가하시겠습니까?')) return;
|
|
|
|
console.log(_self);
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if(!confirm('편집한 단속이미지를 저장하시겠습니까?')) return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.opener.pageObject[openerPageName].editPhotoCallback(file, originalInfomation, isNumberPlate);
|
|
|
|
if(isNumberPlate){
|
|
|
|
return true;
|
|
|
|
if(!confirm('번호판 이미지를 추가하시겠습니까?')) return;
|
|
|
|
};
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if(!confirm('편집한 단속이미지를 저장하시겠습니까?')) return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function fnAfterImageSave(){
|
|
|
|
window.opener.pageObject[openerPageName].editPhotoCallback(file, originalInfomation, isNumberPlate);
|
|
|
|
window.close();
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
function fnAfterImageSave(){
|
|
|
|
|
|
|
|
window.close();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var fileInfo = [${fileInfo}];
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
if(fileInfo.length > 0){
|
|
|
|
var fileInfo = [${fileInfo}];
|
|
|
|
originalInfomation = fileInfo[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fileUrl = fileInfo[0].URL;
|
|
|
|
if(fileInfo.length > 0){
|
|
|
|
var fullSrc = "${pageContext.request.contextPath}" + "/" + fileUrl;
|
|
|
|
originalInfomation = fileInfo[0];
|
|
|
|
|
|
|
|
|
|
|
|
editableImage = document.getElementById('editableImage');
|
|
|
|
var fileUrl = fileInfo[0].URL;
|
|
|
|
editableImage.src = fullSrc;
|
|
|
|
var fullSrc = "${pageContext.request.contextPath}" + "/" + fileUrl;
|
|
|
|
editableImage.onload = function () {
|
|
|
|
|
|
|
|
initEditor();
|
|
|
|
|
|
|
|
editableImage.style.display = 'none';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
editableImage = document.getElementById('editableImage');
|
|
|
|
|
|
|
|
editableImage.src = fullSrc;
|
|
|
|
|
|
|
|
editableImage.onload = function () {
|
|
|
|
|
|
|
|
initEditor();
|
|
|
|
|
|
|
|
editableImage.style.display = 'none';
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
var vhclInfo = window.opener.pageObject[openerPageName].carInfoFunc();
|
|
|
|
alert("사진 파일이 없습니다.");
|
|
|
|
$("input[name='vhrno']").val(vhclInfo.vhrno);
|
|
|
|
}
|
|
|
|
$("input[name='vhclNm']").val(vhclInfo.vhclNm);
|
|
|
|
|
|
|
|
$("input[name='vhclColor']").val(vhclInfo.vhclColor);
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
$("input[name='vhrno']").on("keyup",function(e){
|
|
|
|
|
|
|
|
if(e.key == "Enter"){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.opener.pageObject[openerPageName].carLinkFunc(this.value).then(function(result){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(result.vhrno == null || result.vhrno == ""){
|
|
|
|
|
|
|
|
$("input[name='vhclNm']").val("");
|
|
|
|
|
|
|
|
$("input[name='vhclColor']").val("");
|
|
|
|
|
|
|
|
alert("차량조회 결과가 없습니다.");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$("input[name='vhrno']").val(result.vhrno);
|
|
|
|
|
|
|
|
$("input[name='vhclNm']").val(result.vhclNm);
|
|
|
|
|
|
|
|
$("input[name='vhclColor']").val(result.vhclColor);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
alert("사진 파일이 없습니다.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</body>
|
|
|
|