사진 편집 jsp화면 호출 추가

main
이범준 1 year ago
parent 8064663853
commit 49ea6bb237

@ -16,6 +16,7 @@ import cokr.xit.base.file.service.FileService;
import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile; import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
import cokr.xit.fims.cmmn.hwp.InsertingImageCell; import cokr.xit.fims.cmmn.hwp.InsertingImageCell;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.Crdn01Mapper; import cokr.xit.fims.crdn.dao.Crdn01Mapper;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
@ -179,6 +180,15 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
} else { } else {
dataObject.set("videoExist", "N"); dataObject.set("videoExist", "N");
} }
fileQuery.setInfoType(Crdn.INF_TYPE);
fileList = fileService.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
dataObject.set("fileList", fileList);
}
return dataObject; return dataObject;
} }

@ -52,4 +52,28 @@ public class Sprt03Controller extends ApplicationController {
return mav; return mav;
} }
/** .
* @return fims/sprt/sprt03020-main
*/
public ModelAndView editPhotoMain(String openerPageName, String fileId) {
ModelAndView mav = new ModelAndView();
mav.setViewName("fims/sprt/sprt03020-main");
mav.addObject("openerPageName", openerPageName);
if(fileId != null && !fileId.equals("")) {
mav.addObject("fileId", fileId);
FileQuery fileQuery = new FileQuery();
fileQuery.setFileIDs(fileId);
List<DataObject> fileList = fileService.getFileList(fileQuery);
if(fileList != null && !fileList.isEmpty()) {
DataObject file = fileList.get(0);
mav.addObject("fileInfo", toJson(file));
}
}
return mav;
}
} }

@ -130,6 +130,15 @@ public class CmnController {
public ModelAndView videoMain(String openerPageName, String crdnId) { public ModelAndView videoMain(String openerPageName, String crdnId) {
return super.videoMain(openerPageName, crdnId); return super.videoMain(openerPageName, crdnId);
} }
/** .
* @return fims/sprt/sprt03020-main
*/
@Override
@RequestMapping(name="사진 편집 메인", value="/020/main.do")
public ModelAndView editPhotoMain(String openerPageName, String fileId) {
return super.editPhotoMain(openerPageName, fileId);
}
} }
@Controller @Controller

@ -265,19 +265,27 @@
<form id="frmFile--${pageName}" class="dpv eca" method="post" enctype="multipart/form-data"> <form id="frmFile--${pageName}" class="dpv eca" method="post" enctype="multipart/form-data">
<input type="file" id="uploadFileList--${pageName}" name="uploadFileList" multiple accept="image/*" hidden /> <input type="file" id="uploadFileList--${pageName}" name="uploadFileList" multiple accept="image/*" hidden />
</form> </form>
<div class="col-md-12"> <div class="col-md-12 d-flex justify-content-between">
<button type="button" id="btnAddFile--${pageName}" class="btn btn-blue">이미지 추가</button> <div class="fs-4 fw-bold">등록된 사진</div>
<button type="button" id="btnEditPhoto--${pageName}" class="btn btn-blue">선택 사진 편집</button>
</div> </div>
<div id="display--${pageName}" style="overflow-y: scroll;height: 340px;border-style: solid;"> <div id="display3--${pageName}" style="overflow-y: scroll;min-height: 40px;max-height: 340px;border-style: solid;">
</div> </div>
<div class="col-md-12"> <div class="col-md-12 d-flex justify-content-between">
<div class="fs-4 fw-bold">추가한 사진</div>
<button type="button" id="btnAddFile--${pageName}" class="btn btn-blue">사진 추가</button>
</div>
<div id="display--${pageName}" style="overflow-y: scroll;min-height: 40px;max-height: 340px;border-style: solid;">
</div>
<div class="col-md-12 d-flex justify-content-between" id="cpatureTitleArea--${pageName}">
<div class="fs-4 fw-bold">캡쳐 이미지</div>
<button type="button" id="btnOpenVideoCapture--${pageName}" class="btn btn-blue">동영상 캡쳐</button> <button type="button" id="btnOpenVideoCapture--${pageName}" class="btn btn-blue">동영상 캡쳐</button>
</div> </div>
<div id="display2--${pageName}" style="overflow-y: scroll;height: 340px;border-style: solid;"> <div id="display2--${pageName}" style="overflow-y: scroll;min-height: 40px;max-height: 340px;border-style: solid;">
</div> </div>
</div> </div>
</div> </div>
@ -426,6 +434,14 @@ $(document).ready(function(){
,"width=1800,height=950" ,"width=1800,height=950"
); );
}); });
$("#btnEditPhoto--${pageName}").on('click', () => {
var fileId = $("#display3--${pageName}").find("[name='editTarget']:checked").val();
window.open(wctx.url("/sprt/sprt03/020/main.do?openerPageName=${pageName}&fileId="+fileId)
,"editPhoto"
,"width=1800,height=950"
);
});
/************************************************************************** /**************************************************************************
@ -471,9 +487,32 @@ $(document).ready(function(){
$P.crdnControl.setData([crdnInfo]); $P.crdnControl.setData([crdnInfo]);
if(crdnInfo.videoExist == "N"){ if(crdnInfo.videoExist == "N"){
$("#btnOpenVideoCapture--${pageName}").hide(); $("#cpatureTitleArea--${pageName}").hide();
$("#display2--${pageName}").hide(); $("#display2--${pageName}").hide();
} }
if(crdnInfo.fileList){
var editPhotoArea = "";
crdnInfo.fileList.forEach(function(item, index){
editPhotoArea += "<label>"
editPhotoArea += "<input type='radio' name='editTarget' class='form-check-input' value='"+item.FILE_ID +"' ";
if(index == 0){
editPhotoArea += " checked='checked' ";
}
editPhotoArea += " />";
editPhotoArea += "<img src='"+ item.URL +"' width='200' height='200' />";
editPhotoArea += "</label>";
editPhotoArea += "<br />";
});
$("#display3--${pageName}").append(editPhotoArea);
} else {
$("#display3--${pageName}").append("등록된 사진이 없습니다.");
$("#btnEditPhoto--crdn01020-info").hide();
}
}); });

@ -42,7 +42,7 @@
</head> </head>
<body> <body>
<c:set var="prefixName" scope="request">동영상 재생</c:set> <c:set var="pageKorName" scope="request">동영상 재생</c:set>
<input type="file" id="file" name="file" hidden accept="video/*" /> <input type="file" id="file" name="file" hidden accept="video/*" />
<div class="container-page-btn px-5 bg-program-title green cleanparking" style="width:100%;height:75px;"> <div class="container-page-btn px-5 bg-program-title green cleanparking" style="width:100%;height:75px;">

@ -0,0 +1,82 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!DOCTYPE html>
<html
lang="kr"
class="light-style layout-navbar-fixed layout-menu-fixed"
dir="ltr"
data-theme="theme-default"
data-assets-path="<c:url value="/resources/"/>"
data-template="vertical-menu-template-starter">
<head>
<meta charset="UTF-8">
<title>과태료통합관리시스템</title>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="<c:url value="/resources/image/favicon.ico"/>" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" >
<!-- Icons. Uncomment required icon fonts -->
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/sneat/fonts/boxicons.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/sneat/fonts/fontawesome.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/sneat/fonts/flag-icons.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/css/fims/framework/common/xit-icon.css"/>" />
<!-- Core CSS -->
<link rel="stylesheet" href="<c:url value="/resources/css/fims/framework/common/xit-core.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/sneat/css/theme-default.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/sneat/css/docs.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/css/fims/framework/common/xit-core-extend.css"/>" />
<!-- Vendors CSS -->
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/css/styles.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/css/fims/framework/common/common.css"/>"/>
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/jquery-ui/1.13.2/themes/redmond/jquery-ui.css"/>" />
<link rel="stylesheet" href="<c:url value="/resources/lib/fims/framework/datepicker/datepicker.css"/>" />
</head>
<body>
<c:set var="pageKorName" scope="request">사진 편집</c:set>
<div>
<img id="photo" src="" />
</div>
<script src="<c:url value="/resources/3rd-party/sneat/js/helpers.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/jquery/jquery.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/jquery-ui/1.13.2/jquery-ui.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/popper/popper.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/js/bootstrap.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/hammer/hammer.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/i18n/i18n.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/js/menu.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/jstree/jstree.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/jstree/jstree-support.js"/>"></script>
<script src="<c:url value='/resources/3rd-party/sneat/js/config.js'/>"></script>
<script src="<c:url value='/resources/3rd-party/sneat/libs/chartjs/chartjs.js'/>"></script>
<script>
$(document).ready(function(){
var fileInfo = [${fileInfo}];
if(fileInfo.length > 0){
var fileUrl = fileInfo[0].URL;
$("#photo").attr("src", "${pageContext.request.contextPath}" + "/" + fileUrl);
} else {
alert("사진 파일이 없습니다.");
}
});
</script>
</body>
</html>
Loading…
Cancel
Save