이미지 편집기 차적조회 기능 추가

main
이범준 10 months ago
parent e64416f379
commit 55b84d732e

@ -49,7 +49,7 @@ public class Sprt03Controller extends ApplicationController {
mav.setViewName("fims/sprt/sprt03020-main"); mav.setViewName("fims/sprt/sprt03020-main");
mav.addObject("openerPageName", openerPageName); mav.addObject("openerPageName", openerPageName);
if(fileId != null && !fileId.equals("")) { if(!ifEmpty(fileId, ()->"").equals("")) {
mav.addObject("fileId", fileId); mav.addObject("fileId", fileId);
FileQuery fileQuery = new FileQuery(); FileQuery fileQuery = new FileQuery();

@ -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 pw;
var originalInfomation = {}; var originalInfomation = {};
var editableImage = null; var editableImage = null;
var isNumberPlate = false; var isNumberPlate = false;
const initEditor = () => { const initEditor = () => {
pw = new PaintWeb(); pw = new PaintWeb();
pw.config.imageLoad = editableImage; pw.config.imageLoad = editableImage;
pw.config.guiPlaceholder = document.getElementById('paintWebTarget'); pw.config.guiPlaceholder = document.getElementById('paintWebTarget');
pw.config.imageSave = fnImageSaveTo; pw.config.imageSave = fnImageSaveTo;
pw.config.afterImageSave = fnAfterImageSave; pw.config.afterImageSave = fnAfterImageSave;
pw.init(); pw.init();
}; };
function fnImageSaveTo(file, imgWidth, imgHeight, doc, _self){ function fnImageSaveTo(file, imgWidth, imgHeight, doc, _self){
console.log(doc); console.log(doc);
console.log(_self); console.log(_self);
if(isNumberPlate){ if(isNumberPlate){
if(!confirm('번호판 이미지를 추가하시겠습니까?')) return; if(!confirm('번호판 이미지를 추가하시겠습니까?')) return;
}else{ }else{
if(!confirm('편집한 단속이미지를 저장하시겠습니까?')) return; if(!confirm('편집한 단속이미지를 저장하시겠습니까?')) return;
} }
window.opener.pageObject[openerPageName].editPhotoCallback(file, originalInfomation, isNumberPlate); window.opener.pageObject[openerPageName].editPhotoCallback(file, originalInfomation, isNumberPlate);
return true; return true;
}; };
function fnAfterImageSave(){ function fnAfterImageSave(){
window.close(); window.close();
}; };
$(document).ready(function(){ $(document).ready(function(){
var fileInfo = [${fileInfo}]; var fileInfo = [${fileInfo}];
if(fileInfo.length > 0){ if(fileInfo.length > 0){
originalInfomation = fileInfo[0]; originalInfomation = fileInfo[0];
var fileUrl = fileInfo[0].URL; var fileUrl = fileInfo[0].URL;
var fullSrc = "${pageContext.request.contextPath}" + "/" + fileUrl; var fullSrc = "${pageContext.request.contextPath}" + "/" + fileUrl;
editableImage = document.getElementById('editableImage'); editableImage = document.getElementById('editableImage');
editableImage.src = fullSrc; editableImage.src = fullSrc;
editableImage.onload = function () { editableImage.onload = function () {
initEditor(); initEditor();
editableImage.style.display = 'none'; editableImage.style.display = 'none';
}
var vhclInfo = window.opener.pageObject[openerPageName].carInfoFunc();
$("input[name='vhrno']").val(vhclInfo.vhrno);
} else { $("input[name='vhclNm']").val(vhclInfo.vhclNm);
alert("사진 파일이 없습니다."); $("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>

@ -94,7 +94,23 @@
var MY_INFO = {}; var MY_INFO = {};
var PARAM_TASK = "${param.taskSeCd}"; var PARAM_TASK = "${param.taskSeCd}";
async function getVhclInfo(sggCd, vhrno, levy_stdde){
return new Promise((resolve, reject) => {
json.post({
url: wctx.url("/payer/vehicle.do"),
data: {
sggCd : sggCd,
vhrno : vhrno,
levy_stdde : levy_stdde
},
success: function(resp, textStatus, jqXHR) {
resolve(resp);
},
error: function(jqXHR, textStatus, error) {
}
});
});
};
async function fnGetAllTask(){ async function fnGetAllTask(){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

@ -1,10 +1,13 @@
function settingPhotoMain(pageName, crdnIdElementId){ function settingPhotoMain(pageName, crdnIdElementId, carInfoFunc, carLinkFunc){
var $P = pageObject[pageName]; var $P = pageObject[pageName];
$P.existFileArr = []; $P.existFileArr = [];
$P.localUploadArr = []; $P.localUploadArr = [];
$P.carInfoFunc = carInfoFunc;
$P.carLinkFunc = carLinkFunc;
//드래그앤드롭 //드래그앤드롭
Sortable.create(document.getElementById("dragAndDrop--"+pageName), { Sortable.create(document.getElementById("dragAndDrop--"+pageName), {
onEnd : function(evt){ onEnd : function(evt){

@ -79,9 +79,9 @@ let xhtml = `<div xmlns="http://www.w3.org/1999/xhtml">
<!--<li data-pwTool="eraser">Eraser</li>--> <!--<li data-pwTool="eraser">Eraser</li>-->
<!-- <li data-pwCommand="imageClear">Clear image</li> --> <!-- <li data-pwCommand="imageClear">Clear image</li> -->
<li> <li>
<label class="w-px-60 pe-2 text-sm-end">차량번호</label><input type='text' class='form-control-sm my-1' /><br /> <label class="w-px-60 pe-2 text-sm-end">차량번호</label><input type='text' name='vhrno' class='form-control-sm my-1' /><br />
<label class="w-px-60 pe-2 text-sm-end">차량명</label><input type='text' class='form-control-sm my-1' /><br /> <label class="w-px-60 pe-2 text-sm-end">차량명</label><input type='text' name='vhclNm' class='form-control-sm my-1' disabled /><br />
<label class="w-px-60 pe-2 text-sm-end">색상</label><input type='text' class='form-control-sm my-1' /> <label class="w-px-60 pe-2 text-sm-end">색상</label><input type='text' name='vhclColor' class='form-control-sm my-1' disabled />
</li> </li>
<li class="paintweb_toolSeparator">&#160;</li> <li class="paintweb_toolSeparator">&#160;</li>

Loading…
Cancel
Save