init
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript" >
|
||||
var url ='<c:url value="/onl/apim/portalpartnership/portalPartnershipMan.json" />';
|
||||
var url_view ='<c:url value="/onl/apim/portalpartnership/portalPartnershipMan.view" />';
|
||||
|
||||
function formatFile(cellvalue, options, rowObject) {
|
||||
var iconPath = '${pageContext.request.contextPath}/images/icon_file.png';
|
||||
var icon = rowObject.hasAttachment ?
|
||||
'<img src="' + iconPath + '" alt="File Attached" style="vertical-align: middle; margin-left: 5px; width: 16px; height: 16px;">' :
|
||||
'';
|
||||
return cellvalue + icon;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#grid').jqGrid({
|
||||
datatype:"json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData : { cmd : 'LIST',
|
||||
searchBizSubject: $('input[name=searchBizSubject]').val() ,
|
||||
searchBizDetail: $('input[name=searchBizDetail]').val()
|
||||
},
|
||||
colNames:['No.', 'ID', '제목', '작성자', '작성일시'],
|
||||
colModel:[
|
||||
{ name : 'rowNum' , align:'center', width: 40, sortable: false },
|
||||
{ name : 'id' , align:'center', key: true, hidden: true},
|
||||
{ name : 'bizSubject' , align:'center', width: 150, formatter: formatFile },
|
||||
{ name : 'createdByName' , align:'center' ,width: 80},
|
||||
{ name : 'createdDate' , align:'center', width: 100, formatter: timeStampFormat }
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems:false
|
||||
},
|
||||
pager : $('#pager'),
|
||||
page : '${param.page}',
|
||||
rowNum : '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: $("#container").height(),
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
rowList : eval('[${rmsDefaultRowList}]'),
|
||||
ondblClickRow: function(rowId) {
|
||||
var rowData = $(this).getRowData(rowId);
|
||||
var id = rowData['id'];
|
||||
var url2 = url_view;
|
||||
url2 += '?cmd=DETAIL';
|
||||
url2 += '&page='+$(this).getGridParam("page");
|
||||
url2 += '&returnUrl='+getReturnUrl();
|
||||
url2 += '&menuId='+'${param.menuId}';
|
||||
url2 += '&id='+id;
|
||||
goNav(url2);
|
||||
|
||||
},
|
||||
gridComplete:function (d){
|
||||
var records = $(this).getGridParam('records');
|
||||
var page = $(this).getGridParam('page');
|
||||
var rowNum = $(this).getGridParam('rowNum');
|
||||
var rows = $(this).getDataIDs();
|
||||
var colModel = $(this).getGridParam("colModel");
|
||||
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var number = ((page - 1) * rowNum + i) + 1;
|
||||
// var reverseNumber = records - ((page - 1) * rowNum + i);
|
||||
$(this).setCell(rows[i], 'rowNum', number);
|
||||
}
|
||||
|
||||
for(var i = 0 ; i< colModel.length; i++){
|
||||
$(this).setColProp(colModel[i].name, {sortable : false});
|
||||
}
|
||||
|
||||
},loadError: function (jqXHR, textStatus, errorThrown) {
|
||||
|
||||
var location ='<%=request.getContextPath()%>/';
|
||||
comloadError(jqXHR, textStatus, errorThrown ,location);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
resizeJqGridWidth('grid','content_middle','1000');
|
||||
|
||||
$("#btn_search").click(function(){
|
||||
var postData = getSearchForJqgrid("cmd","LIST"); //jqgrid에서는 object 로
|
||||
$("#grid").setGridParam({ url:url,postData: postData ,page:1 }).trigger("reloadGrid");
|
||||
});
|
||||
|
||||
$("input[name^=search]").keydown(function(key){
|
||||
if (key.keyCode == 13){
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle" id="content_middle">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R" ><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %></button>
|
||||
</div>
|
||||
<div class="title">사업제휴 신청 목록</div>
|
||||
<form id="ajaxForm" onsubmit="return false;">
|
||||
<table class="search_condition" cellspacing=0;>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:180px;">제목</th>
|
||||
<td><input type="text" name="searchBizSubject" value="${param.searchBizSubject}"></td>
|
||||
<th style="width:180px;">내용</th>
|
||||
<td><input type="text" name="searchBizDetail" value="${param.searchBizDetail}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<table id="grid" ></table>
|
||||
<div id="pager"></div>
|
||||
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/portal.jsp"/>
|
||||
<script language="javascript" >
|
||||
var url ='<c:url value="/onl/apim/portalpartnership/portalPartnershipMan.json" />';
|
||||
var url_view ='<c:url value="/onl/apim/portalpartnership/portalPartnershipMan.view" />';
|
||||
var file_download = '<c:url value="/file/download.do" />';
|
||||
var isDetail = false;
|
||||
|
||||
function formatFileSize(bytes) {
|
||||
if(bytes == 0) return '0 Bytes';
|
||||
var k = 1024,
|
||||
sizes = ['Bytes', 'KB', 'MB', 'GB'],
|
||||
i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
function detail(key){
|
||||
if (!isDetail)return;
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
dataType:"json",
|
||||
data:{cmd: 'DETAIL', id : key},
|
||||
success:function(data){
|
||||
$("#bizSubject").text(data.bizSubject);
|
||||
$("#bizDetail").html(data.bizDetail);
|
||||
$("#createdByName").text(data.createdByName);
|
||||
$("#createdById").text(data.createdById);
|
||||
$("#createdDate").text(timeStampFormat(data.createdDate));
|
||||
|
||||
// 첨부파일 처리
|
||||
if(data.hasAttachment && data.fileInfo) {
|
||||
$("#fileRow").show();
|
||||
var iconPath = '${pageContext.request.contextPath}/images/icon_file.png';
|
||||
var fileLink = $('<span class="file-item" style="cursor:pointer">').click(function() {
|
||||
downloadFile(data.fileInfo.fileId);
|
||||
});
|
||||
|
||||
$('<img>').attr('src', iconPath)
|
||||
.css({ 'marginRight': '5px', 'height': '1.2em', 'verticalAlign': 'middle'})
|
||||
.appendTo(fileLink);
|
||||
|
||||
$('<span>').text(data.fileInfo.fileDetails[0].originalFileName + '.' +
|
||||
data.fileInfo.fileDetails[0].fileExtension + ' (' +
|
||||
formatFileSize(data.fileInfo.fileDetails[0].fileSize) + ')')
|
||||
.appendTo(fileLink);
|
||||
|
||||
$("#fileArea").empty().append(fileLink);
|
||||
} else {
|
||||
$("#fileRow").hide();
|
||||
}
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function downloadFile(fileId) {
|
||||
if (fileId) {
|
||||
var fileSn = 1;
|
||||
window.location.href = file_download + '?fileId=' + fileId + '&fileSn=' + fileSn;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var key = "${param.id}";
|
||||
|
||||
if (key && key !=="null"){
|
||||
isDetail = true;
|
||||
detail(key);
|
||||
}
|
||||
|
||||
$("#btn_previous").click(function(){
|
||||
var returnUrl = getReturnUrlForReturn();
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
});
|
||||
|
||||
$("#btn_unmask").click(function () {
|
||||
const reason = prompt("마스킹 해제 사유를 입력하세요:");
|
||||
|
||||
if (reason && reason.trim() !== "") {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {
|
||||
cmd: "UNMASK",
|
||||
id: key,
|
||||
reason: reason
|
||||
},
|
||||
success: function (data) {
|
||||
$("#createdByName").text(data.createdByName);
|
||||
$("#createdById").text(data.createdById);
|
||||
$("#btn_unmask").hide();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
alert("서버 요청 중 오류가 발생했습니다. 다시 시도해 주세요.");
|
||||
}
|
||||
});
|
||||
} else if (unmaskReason !== null) {
|
||||
alert("마스킹 해제 사유를 입력해야 합니다.");
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_unmask" level="W" status="DETAIL"><i class="material-icons">lock_open</i> 마스킹해제</button>
|
||||
<button type="button" class="cssbtn" id="btn_previous" level="R" status="DETAIL,NEW"><i class="material-icons">arrow_back</i> <%= localeMessage.getString("button.previous") %></button>
|
||||
</div>
|
||||
<div class="title">사업제휴 신청 상세</div>
|
||||
|
||||
<table id="grid" ></table>
|
||||
<div id="pager"></div>
|
||||
|
||||
<form id="ajaxForm">
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:10%;">작성자</th>
|
||||
<td id="createdByName" style="width:40%;"></td>
|
||||
<th style="width:10%;">작성일</th>
|
||||
<td id="createdDate" style="width:40%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width:10%;">작성자 아이디</th>
|
||||
<td id="createdById" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width:10%;">사업 제목</th>
|
||||
<td colspan="5" id="bizSubject"></td>
|
||||
</tr>
|
||||
<tr id="fileRow">
|
||||
<th>첨부파일</th>
|
||||
<td colspan="5" id="fileArea"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>사업 내용</th>
|
||||
<td colspan="5">
|
||||
<div id="bizDetail" style="min-height: 200px; padding-top: 10px;"></div>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user