이지우 - 착수보고 동시기안 첨부파일 수정전 백업 파일 생성
This commit is contained in:
parent
d39a6e2307
commit
5f81d30eda
@ -0,0 +1,348 @@
|
|||||||
|
<%--
|
||||||
|
Class Name : EgovNoticeRegist.jsp
|
||||||
|
Description : 게시물 생성 화면
|
||||||
|
Modification Information
|
||||||
|
|
||||||
|
수정일 수정자 수정내용
|
||||||
|
------- -------- ---------------------------
|
||||||
|
2009.03.24 이삼섭 최초 생성
|
||||||
|
2011.08.31 JJY 경량환경 버전 생성
|
||||||
|
|
||||||
|
author : 공통서비스 개발팀 이삼섭
|
||||||
|
since : 2009.03.24
|
||||||
|
--%>
|
||||||
|
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||||
|
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||||
|
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||||
|
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta http-equiv="content-language" content="ko">
|
||||||
|
|
||||||
|
<!-- 분쟁조정 -->
|
||||||
|
<!-- script -->
|
||||||
|
<script src="/kofair_case_seed/script/lib/jquery-3.5.0.js"></script>
|
||||||
|
<script src="/kofair_case_seed/adm/scripts/common.js"></script>
|
||||||
|
<script src="/kofair_case_seed/adm/scripts/layout.js"></script>
|
||||||
|
<!-- 분쟁조정 끝 -->
|
||||||
|
|
||||||
|
<!-- css -->
|
||||||
|
<link rel="stylesheet" href="/kccadrPb/adm/css/content.css">
|
||||||
|
<link rel="stylesheet" href="/kccadrPb/adm/css/content_media.css">
|
||||||
|
|
||||||
|
<!-- script -->
|
||||||
|
<script src="/kofair_case_seed/script/lib/jquery-migrate-3.3.2.min.js"></script>
|
||||||
|
<script src="/kccadrPb/adm/script/content.js"></script>
|
||||||
|
<script src="/js/ncms_common.js"></script>
|
||||||
|
<script src="/js/kccadr/kccadrCom.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- css -->
|
||||||
|
<link rel="stylesheet" href="/css/seed.reset.css">
|
||||||
|
<link rel="stylesheet" href="/css/seed.layout.css">
|
||||||
|
<link rel="stylesheet" href="/css/layout.css">
|
||||||
|
<link rel="stylesheet" href="/css/button.css">
|
||||||
|
<link rel="stylesheet" href="/css/seed.contents.css">
|
||||||
|
<link rel="stylesheet" href="/css/seed.mediaquery.css">
|
||||||
|
<link rel="stylesheet" href="/css/lib/jquery.mCustomScrollbar.min.css">
|
||||||
|
<link rel="stylesheet" href="/css/jquery-ui.css"/>
|
||||||
|
<link rel="stylesheet" href="/css/jquery-ui.min.css"/>
|
||||||
|
<link rel="stylesheet" href="/css/smartPop.css"/>
|
||||||
|
<link rel="stylesheet" href="/css/space.css"/>
|
||||||
|
<link rel="stylesheet" href="/css/picker.default.css">
|
||||||
|
<link rel="stylesheet" href="/css/picker.default.date.css">
|
||||||
|
<link rel="stylesheet" href="/css/case/common.css">
|
||||||
|
|
||||||
|
<!-- 캘린더css -->
|
||||||
|
|
||||||
|
<!-- js -->
|
||||||
|
<!-- 라이브러리, 플러그인 -->
|
||||||
|
<script src="/js/lib/jquery-ui.min.js"></script>
|
||||||
|
<script src="/js/lib/jquery.blockUI.js"></script>
|
||||||
|
<script src="/js/lib/jquery.pjax.js"></script>
|
||||||
|
<script src="/js/lib/modernizr-custom.js"></script>
|
||||||
|
<script src="/js/lib/jquery.mCustomScrollbar.concat.min.js"></script>
|
||||||
|
<script src="/js/lib/jquery.bxslider.min.js"></script>
|
||||||
|
<script src="/js/lib/picker.js"></script>
|
||||||
|
<script src="/js/lib/picker.date.js"></script>
|
||||||
|
<script src="/js/lib/legacy.js"></script>
|
||||||
|
<script src="/js/lib/base64.js"></script>
|
||||||
|
|
||||||
|
<!-- 라이브러리, 플러그인 끝 -->
|
||||||
|
<script src="/js/jquery.seed.js"></script>
|
||||||
|
<script src="/js/smartPop.js"></script>
|
||||||
|
<script src="/js/seed.common.js"></script>
|
||||||
|
<script src="/js/seed.tab.js"></script>
|
||||||
|
<script src="/js/seed.app.js"></script>
|
||||||
|
|
||||||
|
<script src="/js/jquery.form.js"></script>
|
||||||
|
<script src="/js/common_XHR.js?3"></script>
|
||||||
|
<script src="/js/common.js"></script>
|
||||||
|
<script src="/js/DateTimePicker.js"></script>
|
||||||
|
<script src="/js/jquery.selectboxes.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$( document ).ready(function() {
|
||||||
|
});
|
||||||
|
|
||||||
|
var totFileSize = 0;
|
||||||
|
|
||||||
|
|
||||||
|
function fileTempUp(){
|
||||||
|
|
||||||
|
if($("#upFile").val() == ""){
|
||||||
|
alert("파일을 선택해 주세요");
|
||||||
|
$("#upFile").focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var limitCount = $("#limitCount").val();
|
||||||
|
var nowCount = $("#uploadFileCntId").val();
|
||||||
|
|
||||||
|
if(nowCount >= limitCount){
|
||||||
|
alert("파일은 " + limitCount + "개 첨부 가능합니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var val = $("#upFile").val().split("\\");
|
||||||
|
var fileName = val[val.length-1]; //마지막 화일명
|
||||||
|
var fileType = fileName.substring(fileName.lastIndexOf("."));//확장자빼오기
|
||||||
|
|
||||||
|
extArray = new Array("txt","jpeg","jpg","png","gif","bmp","mp3","mp4","hwp","doc","docx","xls","xlsx","ppt","pptx","pdf","zip","alz","hwpx");
|
||||||
|
|
||||||
|
|
||||||
|
var extChk = false;
|
||||||
|
|
||||||
|
for(var f=0; f<extArray.length; f++){
|
||||||
|
if("."+extArray[f] == fileType.toLowerCase()){
|
||||||
|
extChk = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!extChk){
|
||||||
|
alert("업로드 할 수 없는 파일 형식 입니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#fileForm").submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
|
||||||
|
$('#fileForm').ajaxForm({
|
||||||
|
//보내기전 validation check가 필요할경우
|
||||||
|
beforeSubmit: function (data, form, option) {
|
||||||
|
//alert("전송전!!");
|
||||||
|
//return false;
|
||||||
|
},
|
||||||
|
//submit이후의 처리
|
||||||
|
success: function(response, status){
|
||||||
|
jf_upload_set(response.fileName, response.reFileName, response.fileSize, response.fileType);
|
||||||
|
if(response.funcType == "trublchargermng"){
|
||||||
|
$("#trubleImg").attr("src","/site/case/upload/tempFiles/trublchargermng/"+response.reFileName);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//ajax error
|
||||||
|
error: function(){
|
||||||
|
alert("작업이 실패 했습니다.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var fileCountFix = 0;
|
||||||
|
function jf_upload_set(fileName, reFileName, fileSize, fileType){
|
||||||
|
|
||||||
|
var sizeData = parseInt(fileSize);
|
||||||
|
sizeData = sizeData/1024/1024;
|
||||||
|
var totFileSize = sizeData;
|
||||||
|
sizeData = sizeData.toFixed(2);
|
||||||
|
|
||||||
|
if(totFileSize > 500){
|
||||||
|
alert("첨부파일 크기가 500Mbyte를 넘었습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var upFileLiLength = parseInt($("#uploadFileCntId").val());
|
||||||
|
upFileLiLength = upFileLiLength+1;
|
||||||
|
$("#uploadFileCntId").val(upFileLiLength);
|
||||||
|
|
||||||
|
if(fileCountFix==0){
|
||||||
|
fileCountFix = upFileLiLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
fileCountFix = fileCountFix+1;
|
||||||
|
|
||||||
|
var fileHtml = "<li id=\"fileUploadP"+fileCountFix+"\">";
|
||||||
|
fileHtml = fileHtml+"<img src=\"/img/user/bbs/icon_file.gif\" alt=\"gif\"> ";
|
||||||
|
fileHtml = fileHtml+fileName+" ("+sizeData+")";
|
||||||
|
fileHtml = fileHtml+" ";
|
||||||
|
fileHtml = fileHtml+"<a href=\"javascript:;\" onclick=\"javascript:jf_delete_file('"+fileCountFix+"', '"+sizeData+"');\"><img src=\"/img/user/bbs/btn_file_del.png\" alt=\"삭제\"></a>";
|
||||||
|
fileHtml = fileHtml+"<input type=\"hidden\" name=\"fileIdx\" value=\"\" class=\"fileIdxClass\"/>";
|
||||||
|
fileHtml = fileHtml+"<input type=\"hidden\" name=\"uploadFileName\" value=\""+fileName+"\" />";
|
||||||
|
fileHtml = fileHtml+"<input type=\"hidden\" name=\"uploadFileReName\" value=\""+reFileName+"\" />";
|
||||||
|
fileHtml = fileHtml+"</li>";
|
||||||
|
$("#upFileHtml").append(fileHtml);
|
||||||
|
}
|
||||||
|
|
||||||
|
function jf_delete_file(deleteNum, sizeData){
|
||||||
|
|
||||||
|
var fileIdx = $("#upFileHtml > #fileUploadP"+deleteNum).children(".fileIdxClass").val();
|
||||||
|
|
||||||
|
if(fileIdx != ""){
|
||||||
|
var deleteFileData = $("#deleteFileDataId").val();
|
||||||
|
if(deleteFileData != ""){
|
||||||
|
deleteFileData = deleteFileData+","+fileIdx;
|
||||||
|
}else{
|
||||||
|
deleteFileData = fileIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#deleteFileDataId").val(deleteFileData);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#upFileHtml > #fileUploadP"+deleteNum).remove();
|
||||||
|
|
||||||
|
totFileSize = totFileSize-sizeData;
|
||||||
|
|
||||||
|
if(totFileSize < 0){
|
||||||
|
totFileSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#uploadFileCntId").val($("#uploadFileCntId").val() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_gwFileUpload(){ //method_parm :관리자로그 메소드에서 사용.(파일업로드 부분 공통으로 사용하여, 페이지 구분을 위해)
|
||||||
|
if (confirm('기안등록을 진행합니까?')) {
|
||||||
|
var fileCnt = $("#uploadFileCntId").val();
|
||||||
|
if(fileCnt != '0'){
|
||||||
|
var formData = new FormData(document.getElementById('fileForm'));
|
||||||
|
url = "https://gw.kofair.or.kr/gw/outProcessUpload.do";
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
enctype: 'multipart/form-data',
|
||||||
|
url: url,
|
||||||
|
data : formData,
|
||||||
|
dataType : 'json',
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function (returnData, status) {
|
||||||
|
//그룹웨어 파일키 설정
|
||||||
|
$("#fileKey").val(returnData.fileKey);
|
||||||
|
//fairnet 파일 업로드 및 DB 저장
|
||||||
|
$("#type").val("SAMETIME_FILE");
|
||||||
|
var param = jQuery('#fileForm').serialize();
|
||||||
|
url = "/gtm/case/trublreqstmng/ajax/CaseFileInsert.do"; //파일등록
|
||||||
|
XHR2(url, param, function(r){
|
||||||
|
fn_gwGo(returnData.fileKey);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (e) { alert("그룹웨어 파일 저장에 실패했습니다."); console.log("ERROR : ", e); }
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
fn_gwGo('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_gwGo(fileKey){
|
||||||
|
window.close();
|
||||||
|
window.opener.nanumApiByPopup(fileKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<title>기안 파일 첨부하기</title>
|
||||||
|
<style>
|
||||||
|
.uploaded_obj{width: 100%;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="window_popup">
|
||||||
|
<h2 class="title depth02 mb15" style="float:none;">■ 기안파일첨부하기</h2>
|
||||||
|
<form id="fileForm" name="fileForm" action="/seed/extra/temp/file.do" method="post" enctype="multipart/form-data">
|
||||||
|
<!-- cont -->
|
||||||
|
<div class="cont_wrap">
|
||||||
|
<div class="box">
|
||||||
|
|
||||||
|
<div class="cont">
|
||||||
|
<!-- list_상세 -->
|
||||||
|
<div class="tbType02 col-table data-table left">
|
||||||
|
<table>
|
||||||
|
<colgroup>
|
||||||
|
<col style="width: 20%">
|
||||||
|
<col style="width: 80%">
|
||||||
|
</colgroup>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th class="req_text">
|
||||||
|
<p>첨부파일</p>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<div class="item-box">
|
||||||
|
<div class="temp-file-area">
|
||||||
|
<label for="upFile" class="btn-default violet responsive">첨부파일</label>
|
||||||
|
</div>
|
||||||
|
<ul class="upFileHtml" id="upFileHtml">
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" />
|
||||||
|
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- //list_상세 -->
|
||||||
|
|
||||||
|
<!-- btn_wrap -->
|
||||||
|
<div class="btn_wrap btn_layout01">
|
||||||
|
<div class="area_left">
|
||||||
|
</div>
|
||||||
|
<div class="area_right">
|
||||||
|
<button class="btn btn_text btn_46 blue_fill btnType06" onclick="fn_gwFileUpload(); return false;">기 안 등 록</button>
|
||||||
|
<button class="btn btn_text btn_46 gray_fill btnType04" onclick="window.close();">닫 기</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- //btn_wrap -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="fileFuncType" id="fileFuncType" value="${param.fileFuncType}" />
|
||||||
|
<input type="hidden" name="fileTarget" id="fileTarget" value="${param.fileTarget}" /> <!-- 접수번호 - CASEFILE 테이블 내 FILE_NO로 저장 -->
|
||||||
|
<input type="hidden" name="fileMemo" id="fileMemo" value="${param.approKey}" /> <!-- 문서ID(DOCID) - CASEFILE 테이블 내 저장 -->
|
||||||
|
<input type="hidden" name="fileGubun" id="fileGubun" value="${param.fileGubun}" />
|
||||||
|
|
||||||
|
<input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" />
|
||||||
|
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
|
||||||
|
<input type="hidden" name="limitCount" id="limitCount" value="1"/>
|
||||||
|
<input type="hidden" name="deleteYN" value="N" />
|
||||||
|
<input type="hidden" name="compSeq" value="1000" />
|
||||||
|
<input type="hidden" name="loginId" value="${param.loginId}" />
|
||||||
|
<input type="hidden" name="type" id="type" value="" />
|
||||||
|
|
||||||
|
<div class="temp-file-area">
|
||||||
|
<input type="file" name="upFile" id="upFile" class="essential temp-file-hideen" onchange="fileTempUp();" required title="첨부파일" value="" style="ime-mode: disabled;" >
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- //cont -->
|
||||||
|
</form>
|
||||||
|
<!-- //content 끝 -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user