216 lines
6.4 KiB
Plaintext
216 lines
6.4 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ page import="java.util.*" %>
|
|
<%@include file= "/init.jsp" %>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
</head>
|
|
<script>
|
|
var callbackFnc = "${param.callbackFnc}";
|
|
$(document).ready(function(){
|
|
|
|
|
|
$("#btn_close").click(function(){
|
|
//opener.fn_search();
|
|
self.close(0);
|
|
});
|
|
//첨부 파일 기능
|
|
fnc_setFileDropZone("srDropZone", "${param.targetObjId}", "${param.docType}", "${param.docTypeName}", "srAreaDraw",false,null,null,null, "${param.parentTargetObjId}");
|
|
|
|
srAreaDraw();
|
|
|
|
$("#btnUpload").click(function(){
|
|
var files = $("#file1")[0].files;
|
|
if(files.length > 0){
|
|
fnc_fileMultiUpload(files, null, "${param.targetObjId}", "${param.docType}", "${param.docTypeName}", null, "srAreaDraw",null, "${param.parentTargetObjId}");
|
|
//file객체 초기화
|
|
$("#file1").val("");
|
|
}else{
|
|
Swal.fire("선택된 File이 없습니다.");
|
|
}
|
|
});
|
|
|
|
$("#srDropZone").hide();
|
|
|
|
});
|
|
|
|
function refeshAttachFileArea(){
|
|
srAreaDraw();
|
|
}
|
|
|
|
//형상 영역을 display 한다.
|
|
function srAreaDraw(){
|
|
fn_fileCallback("sr","${docType}");
|
|
if(fnc_checkNull(callbackFnc) != ""){
|
|
opener.eval(callbackFnc+"();");
|
|
}
|
|
|
|
//opener.location.reload();
|
|
|
|
}
|
|
|
|
//첨부파일 목록을 가져온다.
|
|
function fn_fileCallback(areaId,fileType){
|
|
//Swal.fire("areaId : "+areaId+", fileType : "+fileType+", targetObjId : ${param.targetObjId}");
|
|
|
|
var param = {"targetObjId":"${param.targetObjId}", "docType":fileType};
|
|
|
|
var searchAllInParent = fnc_checkNull(${param.searchAllInParent});
|
|
if(searchAllInParent && "${param.parentTargetObjId}"){
|
|
param["parentTargetObjId"] = "${param.parentTargetObjId}";
|
|
param["targetObjId"] = "";
|
|
}
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:param,
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
if(0 < data.length){
|
|
|
|
//첨부파일 목록 영역 show
|
|
$("#"+areaId+"FileArea").empty();
|
|
|
|
if(0 < $("#"+areaId+"DefaultRow").length){
|
|
$("#"+areaId+"DefaultRow").hide();
|
|
}
|
|
|
|
$.each(data, function(i){
|
|
|
|
var appendText = "";
|
|
if("sr" == areaId){
|
|
var path = data[i].FILE_PATH;
|
|
var fileName = data[i].SAVED_FILE_NAME;
|
|
var fileExt = data[i].UPPER_FILE_EXT;
|
|
/*
|
|
appendText += "<colgroup>";
|
|
appendText +=" <col width='10%'>";
|
|
appendText +=" <col width='70%'>";
|
|
appendText +=" <col width='20%'>";
|
|
appendText +=" </colgroup>";
|
|
*/
|
|
appendText+= "<tr>";
|
|
appendText+= " <td>"+[i+1]+"</td>";
|
|
appendText+= " <td class='align_l'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> "+data[i].REAL_FILE_NAME+"</a>";
|
|
/* if(data[i].WRITER=="${connectUserId}" || 'plm_admin'== "${connectUserId}"){
|
|
|
|
appendText+= "<a href='javascript:fileDelete(\""+data[i].OBJID+"\",\""+areaId+"\")'><div class='delete_btn'></div></a>";
|
|
|
|
}
|
|
*/
|
|
appendText+= "</td>";
|
|
appendText+= " <td>"+data[i].REGDATE+"</td>"
|
|
appendText+= " <td>"+data[i].FILE_SIZE+"</td>"
|
|
appendText+= "</tr>";
|
|
}
|
|
//Swal.fire(appendText);
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
});
|
|
}else{
|
|
$("#"+areaId+"DropZone").show();
|
|
$("#"+areaId+"AttachFileList").hide();
|
|
$("#"+areaId+"FileArea").empty();
|
|
var appendText = "";
|
|
appendText += "<tr>";
|
|
appendText += "<td colspan='4'>첨부 파일이 없습니다.</td>";
|
|
appendText +="</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}//파일 첨부 END
|
|
|
|
|
|
/*첨부 파일 삭제 */
|
|
function fileDelete(fileObjId){
|
|
if(confirm("파일을 삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/common/deleteFileInfo.do",
|
|
type:"POST",
|
|
data:{"objId":fileObjId},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
fn_fileCallback("sr","${docType}");
|
|
if(fnc_checkNull(callbackFnc) != ""){
|
|
opener.eval(callbackFnc+"();");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
</script>
|
|
<body class="backcolor">
|
|
<form name="form1" action="" method="post">
|
|
<section class="business_staff_popup_min_width">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>파일상세</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap">
|
|
<!--
|
|
<div class="form_popup_title"> 자료상세</div>
|
|
-->
|
|
<table class="pmsPopupForm">
|
|
<tr>
|
|
<!--
|
|
-->
|
|
<td rowspan="2" class="input_title align_c">파일첨부</td>
|
|
<td colspan="8">
|
|
<div id="srDropZone" class="dropzone">Drag & Drop Files Here</div>
|
|
<!-- <input type="file" name="file1" id="file1" multiple>
|
|
<input type="button" id="btnUpload" value="Upload" class="upload_btns"> -->
|
|
<div id="srFileAreaTable" class="spec_data_in_table">
|
|
<div style="overflow-y:scroll;width:100%">
|
|
<table id="" class="fileListscrollThead" style="width:100% !important;">
|
|
<colgroup>
|
|
<col width="35px">
|
|
<col width="*">
|
|
<col width="80px">
|
|
<col width="15%">
|
|
</colgroup>
|
|
<tr>
|
|
<td>No</td>
|
|
<td>파일명</td>
|
|
<td>등록일</td>
|
|
<td>Size</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div style="height: 200px; overflow-y: scroll; border-bottom: 1px solid #cacaca;">
|
|
<table class="fileListscrollTbody">
|
|
<colgroup>
|
|
<col width="35px">
|
|
<col width="*">
|
|
<col width="80px">
|
|
<col width="15%">
|
|
</colgroup>
|
|
<tbody id="srFileArea" >
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="닫기" id="btn_close" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |