init
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
<%@ 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" >
|
||||
|
||||
$(document).ready(function() {
|
||||
var gridPostData = getSearchForJqgrid("cmd","LIST"); //jqgrid에서는 object 로
|
||||
$('#grid').jqGrid({
|
||||
datatype:"json",
|
||||
mtype: 'POST',
|
||||
url: '<c:url value="/common/acl/role/roleMan.json" />',
|
||||
postData : gridPostData,
|
||||
colNames:['<%= localeMessage.getString("role.id") %>',
|
||||
'<%= localeMessage.getString("role.name") %>',
|
||||
'<%= localeMessage.getString("role.description") %>',
|
||||
'<%= localeMessage.getString("combo.useYn") %>'
|
||||
],
|
||||
colModel:[
|
||||
{ name : 'ROLEID' , align:'left' , width:140 ,sortable:false },
|
||||
{ name : 'ROLENAME' , align:'left' , width:140},
|
||||
{ name : 'ROLEDESC' , align:'left' , width:500},
|
||||
{ name : 'USEYN' , align:'center', width:50}
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems:false
|
||||
},
|
||||
pager : $('#pager'),
|
||||
page : '${param.page}',
|
||||
rowNum : '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: $("#container").height(),
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
rowList : eval('[${rmsDefaultRowList}]'),
|
||||
gridComplete:function (d){
|
||||
var colModel = $(this).getGridParam("colModel");
|
||||
for(var i = 0 ; i< colModel.length; i++){
|
||||
$(this).setColProp(colModel[i].name, {sortable : false}); //그리드 헤더 화살표 삭제(정렬X)
|
||||
}
|
||||
|
||||
},
|
||||
ondblClickRow: function(rowId) {
|
||||
var rowData = $(this).getRowData(rowId);
|
||||
var roleId = rowData['ROLEID'];
|
||||
var url = '<c:url value="/common/acl/role/roleMan.view" />';
|
||||
url = url + '?cmd=DETAIL';
|
||||
url = url + '&page='+$(this).getGridParam("page");
|
||||
url = url + '&returnUrl='+getReturnUrl();
|
||||
url = url + '&menuId='+'${param.menuId}';
|
||||
//검색값
|
||||
url = url + '&'+getSearchUrl();
|
||||
//key값
|
||||
url = url + '&roleId='+roleId;
|
||||
goNav(url);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
resizeJqGridWidth('grid','content_middle','1000');
|
||||
|
||||
$("#btn_search").click(function(){
|
||||
var postData = getSearchForJqgrid("cmd","LIST"); //jqgrid에서는 object 로
|
||||
$("#grid").setGridParam({ postData: postData ,page : "1" }).trigger("reloadGrid");
|
||||
|
||||
});
|
||||
|
||||
$("#btn_new").click(function(){
|
||||
var url = '<c:url value="/common/acl/role/roleMan.view"/>';
|
||||
url = url + '?cmd=DETAIL';
|
||||
url = url + '&page='+$("#grid").getGridParam("page");
|
||||
url = url + '&returnUrl='+getReturnUrl();
|
||||
url = url + '&menuId='+'${param.menuId}';
|
||||
//검색값
|
||||
url = url + '&'+getSearchUrl();
|
||||
|
||||
|
||||
goNav(url);
|
||||
});
|
||||
|
||||
$("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_new" level="W"><i class="material-icons">add</i> <%= localeMessage.getString("button.new") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %></button>
|
||||
<%-- <img src="<c:url value="/img/btn_new.png"/>" alt="" id="btn_new" level="W" /> --%>
|
||||
<%-- <img src="<c:url value="/img/btn_search.png"/>" alt="" id="btn_search" level="R" /> --%>
|
||||
</div>
|
||||
<div class="title"><%= localeMessage.getString("role.title") %></div>
|
||||
|
||||
<table class="search_condition" cellspacing=0;>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:10%; min-width:80px;"><%= localeMessage.getString("role.id") %></th>
|
||||
<td><input type="text" name="searchRoleId" value="${param.searchRoleId}"></td>
|
||||
<th style="width:10%; min-width:80px;"><%= localeMessage.getString("combo.useYn") %></th>
|
||||
<td>
|
||||
<div class="select-style">
|
||||
<select name="searchUseYn">
|
||||
<option value=""><%= localeMessage.getString("combo.all") %></option>
|
||||
<option value="Y"><%= localeMessage.getString("combo.usey") %></option>
|
||||
<option value="N"><%= localeMessage.getString("combo.usen") %></option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<th style="width:10%; min-width:80px;"><%= localeMessage.getString("role.name") %></th>
|
||||
<td><input type="text" name="searchRoleName" value="${param.searchRoleName}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="grid" ></table>
|
||||
<div id="pager"></div>
|
||||
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ page import="com.eactive.eai.common.util.SystemUtil"%>
|
||||
<%@ 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 isDetail = false;
|
||||
|
||||
var devSvr = <%=SystemUtil.isDevServer()%>;
|
||||
|
||||
function isValid(){
|
||||
if($('input[name=roleId]').val() == ""){
|
||||
alert("<%= localeMessage.getString("role.checkRequired1") %>");
|
||||
return false;
|
||||
}else if($('input[name=roleName]').val() == ""){
|
||||
alert("<%= localeMessage.getString("role.checkRequired2") %>");
|
||||
return false;
|
||||
}else if($('select[name=useYn]').val() == ""){
|
||||
alert("<%= localeMessage.getString("combo.checkRequiredUsed") %>");
|
||||
return false;
|
||||
}else if($('input[name=roleScreen]').val() == ""){
|
||||
alert("<%= localeMessage.getString("menu.checkRequierd3") %>"); // 상위메뉴 ID를 입력하여 주십시요.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function init(url,key,callback){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
dataType:"json",
|
||||
data:{cmd: 'LIST_INIT_COMBO'},
|
||||
success:function(json){
|
||||
new makeOptions("CODE","NAME").setObj($("select[name=useYn]")).setData(json.useYnTypeRows).setFormat(codeName3OptionFormat).rendering();
|
||||
|
||||
|
||||
if(typeof callback === 'function') {
|
||||
callback(url,key);
|
||||
}
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
function detail(url,key){
|
||||
if (!isDetail)return;
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
dataType:"json",
|
||||
data:{cmd: 'DETAIL', roleId : key},
|
||||
success:function(json){
|
||||
var data = json;
|
||||
$("input[name=roleId]").attr('readonly',true);
|
||||
//if (devSvr){
|
||||
// $("#btn_clone").show();
|
||||
//}
|
||||
|
||||
|
||||
if (data['ROLESCREEN']=="DASHBOARD"){
|
||||
$("input[name=dashCheck]").attr("checked", true);
|
||||
}
|
||||
$("#ajaxForm input[type!=radio],#ajaxForm select,#ajaxForm textarea").each(function(){
|
||||
var name = $(this).attr("name");
|
||||
var tag = $(this).prop("tagName").toLowerCase();
|
||||
$(tag+"[name="+name+"]").val(data[name.toUpperCase()]);
|
||||
});
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
var returnUrl = getReturnUrlForReturn();
|
||||
|
||||
var url ='<c:url value="/common/acl/role/roleMan.json" />';
|
||||
var key ="${param.roleId}";
|
||||
if (key != "" && key !="null"){
|
||||
isDetail = true;
|
||||
}
|
||||
init(url,key,detail);
|
||||
|
||||
function checkPopup2Data() {
|
||||
var selectedRowId = localStorage.getItem('selectedRowId');
|
||||
if(selectedRowId) {
|
||||
$("input[name='roleScreen']").val(selectedRowId);
|
||||
localStorage.removeItem('selectedRowId');
|
||||
}
|
||||
}
|
||||
|
||||
$("#btn_modify").click(function(){
|
||||
if (confirm("<%= localeMessage.getString("common.checkModify")%>") != true)
|
||||
return;
|
||||
|
||||
if (!isValid()){
|
||||
return;
|
||||
}
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
if (isDetail){
|
||||
postData.push({ name: "cmd" , value:"UPDATE"});
|
||||
}else{
|
||||
postData.push({ name: "cmd" , value:"INSERT"});
|
||||
}
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
success:function(args){
|
||||
alert("<%= localeMessage.getString("common.saveMsg") %>");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#btn_delete").click(function(){
|
||||
|
||||
if(confirm("<%= localeMessage.getString("common.confirmMsg")%>")){
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
postData.push({ name: "cmd" , value:"DELETE"});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
success:function(args){
|
||||
alert("<%= localeMessage.getString("common.deleteMsg") %>");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$("input[name=dashCheck]").click(function(){
|
||||
var chk = $(this).is(":checked");
|
||||
if (chk){
|
||||
$("input[name=roleScreen]").val("DASHBOARD");
|
||||
}else{
|
||||
$("input[name=roleScreen]").val("");
|
||||
}
|
||||
});
|
||||
$("#btn_previous").click(function(){
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
});
|
||||
$("#roleSearch").click(function(){
|
||||
});
|
||||
$("#btn_change").click(function(){
|
||||
var args = new Object();
|
||||
args['roleId'] = $("input[name=roleId]").val();
|
||||
|
||||
var url = '<c:url value="/common/acl/role/roleMan.view"/>';
|
||||
url = url + "?cmd=POPUP";
|
||||
showModal(url,args,1250,800);
|
||||
|
||||
});
|
||||
$("#btn_popup").click(function(){
|
||||
var args = new Object();
|
||||
args['roleId'] = $("input[name=roleId]").val();
|
||||
checkPopup2Data();
|
||||
var url = '<c:url value="/common/acl/role/roleMan.view"/>';
|
||||
url = url + "?cmd=POPUP2";
|
||||
|
||||
showModal(url, args, 460, 645);
|
||||
var checkInterval = setInterval(function() {
|
||||
var selectedRowId = localStorage.getItem('selectedRowId');
|
||||
if (selectedRowId) {
|
||||
clearInterval(checkInterval);
|
||||
$("input[name='roleScreen']").val(selectedRowId);
|
||||
localStorage.removeItem('selectedRowId');
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
//스테이징 복사
|
||||
$("#btn_clone").click(function(){
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
postData.push({ name: "cmd" , value:"CLONETOSTG"});
|
||||
|
||||
if(confirm("스테이징으로 복사 하시겠습니까?")){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : url,
|
||||
dataType : "json",
|
||||
data : postData,
|
||||
success : function(json) {
|
||||
alert(json.message);
|
||||
},
|
||||
error : function(e) {
|
||||
alert(JSON.parse(e.responseText).errorMsg);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
buttonControl(isDetail);
|
||||
titleControl(isDetail);
|
||||
});
|
||||
|
||||
</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_clone" level="W"><i class="material-icons">file_copy</i> <%= localeMessage.getString("button.clone") %></button> --%>
|
||||
<button type="button" class="cssbtn" id="btn_change" level="W" status="DETAIL"><i class="material-icons">change_circle</i> <%= localeMessage.getString("button.roleChange") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_delete" level="W" status="DETAIL"><i class="material-icons">delete</i> <%= localeMessage.getString("button.delete") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_modify" level="W" status="DETAIL,NEW"><i class="material-icons">save</i> <%= localeMessage.getString("button.modify") %></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>
|
||||
<%-- <img src="<c:url value="/img/btn_clone.png"/>" alt="" id="btn_clone" level="W" style="display: none;height:32px;"/> --%>
|
||||
<%-- <img src="<c:url value="/img/btn_change.png"/>" alt="" id="btn_change" level="W" status="DETAIL"/> --%>
|
||||
<%-- <img src="<c:url value="/img/btn_delete.png"/>" alt="" id="btn_delete" level="W" status="DETAIL"/> --%>
|
||||
<%-- <img src="<c:url value="/img/btn_modify.png"/>" alt="" id="btn_modify" level="W" status="DETAIL,NEW" /> --%>
|
||||
<%-- <img src="<c:url value="/img/btn_previous.png"/>" alt="" id="btn_previous" level="R" status="DETAIL,NEW"/> --%>
|
||||
</div>
|
||||
<div class="title"><%= localeMessage.getString("role.title") %></div>
|
||||
|
||||
<form id="ajaxForm">
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:180px;"><%= localeMessage.getString("role.id") %></th><td><input type="text" name="roleId"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= localeMessage.getString("role.name") %> </th><td><input type="text" name="roleName"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= localeMessage.getString("combo.useYn") %> </td>
|
||||
<td><div class="select-style"><select name="useYn" /></td>
|
||||
</tr>
|
||||
<tr height="100px">
|
||||
<th><%= localeMessage.getString("role.description") %></th><td><textarea name="roleDesc" style="width:100%;height:100px"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= localeMessage.getString("role.screen") %></th>
|
||||
<td>
|
||||
<input type="text" name="roleScreen" readonly="readonly" style="width:calc(100% - 160px);"/>
|
||||
<%-- <img id="btn_popup" src="<c:url value="/img/btn_pop_search.png" />" class="btn_img"> --%>
|
||||
<button type="button" class="cssbtn smallBtn2" id="btn_popup" style="vertical-align:middle; font-weight:bold;"><i class="material-icons">search</i><%= localeMessage.getString("button.search") %></button>
|
||||
<!-- <input type="checkbox" name="dashCheck" id="sub4_6_2_detail_1"><label for="sub4_6_2_detail_1">대시보드화면</label> -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
<%@ 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="/common/acl/role/roleMan.json" />';
|
||||
|
||||
var roleId = window.dialogArguments["roleId"];
|
||||
var treeColNames = [];
|
||||
var treeColModel = [];
|
||||
|
||||
function isValid() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function unformatterFunction(cellvalue, options, rowObject) {
|
||||
return $('input:checkbox', rowObject).is(':checked') ? "true" : "false";
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
return $.ajax({
|
||||
url : url,
|
||||
type : "POST",
|
||||
data : {
|
||||
cmd : "LIST_INIT_POPUP"
|
||||
},
|
||||
dataType : "json",
|
||||
success : function(response) {
|
||||
|
||||
treeColNames = [
|
||||
'id',
|
||||
'MENUID',
|
||||
'PRIORMENUID',
|
||||
'SORTORDER',
|
||||
'APPCODE',
|
||||
'renderTarget',
|
||||
'MENUNAME'
|
||||
];
|
||||
|
||||
treeColModel = [
|
||||
{ name : 'id' , hidden:true, key:true },
|
||||
{ name : 'MENUID' , hidden:true },
|
||||
{ name : 'PRIORMENUID' , hidden:true },
|
||||
{ name : 'SORTORDER' , hidden:true },
|
||||
{ name : 'APPCODE' , hidden:true },
|
||||
{ name : 'renderTarget' , hidden:true },
|
||||
{ name : 'MENUNAME' , align:'left', width:300 }
|
||||
];
|
||||
|
||||
response.columnList.forEach(function(item) {
|
||||
treeColNames.push(item);
|
||||
treeColModel.push({name : item, align:'center', width:80, unformat: unformatterFunction, formatter: authFormatter});
|
||||
});
|
||||
|
||||
},
|
||||
error : function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function authFormatter(cellvalue, options, rowObject) {
|
||||
|
||||
var rowId = options["rowId"];
|
||||
var appCode = rowObject["APPCODE"];
|
||||
var rowServiceType = options.colModel.name;
|
||||
var renderTarget = rowObject["renderTarget"];
|
||||
|
||||
for(let i = 0; i < renderTarget.length; i++) {
|
||||
|
||||
if(renderTarget[i] == rowServiceType) {
|
||||
|
||||
var $radio = $(document.createElement('input')).attr('type', 'radio').attr('name', 'radio_'+rowId+'_'+rowServiceType).attr('style', 'margin-left:2px; margin-right:2px;');
|
||||
|
||||
var $radio_N = $radio.clone().attr('value', 'N');
|
||||
var $radio_R = $radio.clone().attr('value', 'R');
|
||||
var $radio_W = $radio.clone().attr('value', 'W');
|
||||
|
||||
var authInfo = rowObject.serviceType.find(function(item) { return item.serviceType == rowServiceType });
|
||||
|
||||
if(authInfo == undefined) {
|
||||
|
||||
$radio_N.attr('checked', 'checked');
|
||||
|
||||
} else {
|
||||
|
||||
if(authInfo.auth == 'R') {
|
||||
$radio_R.attr('checked', 'checked');
|
||||
} else if(authInfo.auth == 'W') {
|
||||
$radio_W.attr('checked', 'checked');
|
||||
}
|
||||
}
|
||||
|
||||
return $radio_N[0].outerHTML + "없음" +
|
||||
$radio_R[0].outerHTML + "R" +
|
||||
$radio_W[0].outerHTML + "W";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function treeGridRender() {
|
||||
|
||||
$('#tree').jqGrid({
|
||||
datatype:"json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData : {
|
||||
cmd : 'LIST_TREE', roleId : roleId
|
||||
},
|
||||
colNames : treeColNames,
|
||||
colModel : treeColModel,
|
||||
treeGrid: true,
|
||||
treeIcons : {
|
||||
plus: "ui-icon-circlesmall-plus",
|
||||
minus: "ui-icon-circlesmall-minus",
|
||||
leaf : "ui-icon-document"
|
||||
},
|
||||
cmTemplate: {
|
||||
sortable: false,
|
||||
},
|
||||
treeGridModel: "adjacency",
|
||||
ExpandColumn: "MENUNAME",
|
||||
height:"650",
|
||||
width:"1200",
|
||||
rowNum: 10000,
|
||||
treeIcons: { leaf:'ui-icon-document-b' },
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
loadComplete:function(d) {
|
||||
},
|
||||
loadError: function(jqXHR, textStatus, errorThrown) {
|
||||
|
||||
var location ='<%=request.getContextPath()%>/';
|
||||
comloadError(jqXHR, textStatus, errorThrown ,location);
|
||||
|
||||
},
|
||||
ondblClickRow: function(rowId) {
|
||||
},
|
||||
onSelectRow: function(rowId) {
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$.when(init()).done(function(a1, a2, a3, a4) {
|
||||
treeGridRender();
|
||||
});
|
||||
|
||||
$("#btn_modify").click(function() {
|
||||
|
||||
if(!isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var formArr = $("#ajaxForm").serializeArray();
|
||||
|
||||
var postData = new Array();
|
||||
|
||||
postData.push({ name: "cmd" , value:"TRANSACTION_ROLE_MENU" });
|
||||
postData.push({ name: "roleId" , value:roleId });
|
||||
postData.push({ name: "gridData", value:JSON.stringify(formArr) });
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
success:function(args){
|
||||
alert("<%= localeMessage.getString("common.saveMsg") %>");
|
||||
$("#btn_close").trigger("click");
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#btn_close").click(function(){
|
||||
window.close();
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="popup_box">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_modify" level="W"><i class="material-icons">save</i> <%= localeMessage.getString("button.modify") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_close" level="R"><i class="material-icons">close</i> <%= localeMessage.getString("button.close") %></button>
|
||||
</div>
|
||||
<div class="title"><%= localeMessage.getString("rolePop.title") %></div>
|
||||
<form id="ajaxForm">
|
||||
<table id="tree"></table>
|
||||
</form>
|
||||
</div><!-- end.popup_box -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
<%@ 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 roleId = window.dialogArguments["roleId"];
|
||||
|
||||
function isValid(){
|
||||
return true;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#tree').jqGrid({
|
||||
datatype:"json",
|
||||
mtype: 'POST',
|
||||
url: '<c:url value="/common/acl/role/roleMan.json" />',
|
||||
postData : { cmd : 'LIST_TREE',roleId : roleId},
|
||||
colNames:['id',
|
||||
'MENUID',
|
||||
'parent',
|
||||
'SORTORDER',
|
||||
'MENUNAME',
|
||||
],
|
||||
colModel:[
|
||||
{ name : 'id' , hidden:true, key :true },
|
||||
{ name : 'MENUID' , hidden:true },
|
||||
{ name : 'parent' , hidden:true },
|
||||
{ name : 'SORTORDER' , hidden:true },
|
||||
{ name : 'MENUNAME' , align:'left' ,width:300}
|
||||
],
|
||||
treeGrid: true,
|
||||
treeIcons : {
|
||||
plus: "ui-icon-circlesmall-plus",
|
||||
minus: "ui-icon-circlesmall-minus",
|
||||
leaf : "ui-icon-document"
|
||||
},
|
||||
cmTemplate: {
|
||||
sortable: false,
|
||||
},
|
||||
treeGridModel: "adjacency",
|
||||
ExpandColumn: "MENUNAME",
|
||||
height:"500",
|
||||
width:"445",
|
||||
rowNum: 10000,
|
||||
treeIcons: {leaf:'ui-icon-document-b'},
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
loadComplete:function (d){
|
||||
},
|
||||
loadError: function (jqXHR, textStatus, errorThrown) {
|
||||
|
||||
var location ='<%=request.getContextPath()%>/';
|
||||
comloadError(jqXHR, textStatus, errorThrown ,location);
|
||||
|
||||
},
|
||||
ondblClickRow: function(rowId) {
|
||||
var rowData = $(this).getRowData(rowId);
|
||||
localStorage.setItem('selectedRowId', rowData['id']);
|
||||
window.close();
|
||||
},
|
||||
onSelectRow: function(rowId) {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#btn_modify").click(function(){
|
||||
var rowId = $("#tree").jqGrid('getGridParam', 'selrow');
|
||||
if(rowId) {
|
||||
var rowData = $("#tree").getRowData(rowId);
|
||||
localStorage.setItem('selectedRowId', rowData['id']);
|
||||
window.close();
|
||||
} else {
|
||||
alert("<%= localeMessage.getString("menu.checkRequierd3") %>");
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_close").click(function(){
|
||||
window.close();
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="popup_box">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_modify" level="W"><i class="material-icons">save</i> <%= localeMessage.getString("button.modify") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_close" level="R"><i class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %></button>
|
||||
<%-- <img id="btn_modify" src="<c:url value="/img/btn_modify.png"/>" level="W"/> --%>
|
||||
<%-- <img id="btn_close" src="<c:url value="/img/btn_close.png"/>" level="R"/> --%>
|
||||
</div>
|
||||
<div class="title"><%= localeMessage.getString("rolePop2.title") %></div>
|
||||
<!-- tree -->
|
||||
<table id="tree" ></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user