You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

340 lines
8.4 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<%
String menu_code = request.getParameter("menucode");
WDK.writeButton(out, su, menu_code);
%>
<title>权限中心-角色管理</title>
</head>
<body class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow:hidden">
<div class="page-toolbar" style="padding-bottom: 5px;">
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="addRole()">新增</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-info-circle'" onclick="roleFunc()">角色授权</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="roleAcc()">关联用户</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false" >
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="row-1" style="padding:0 10px;overflow:hidden;" >
<form id="search_form" >
<div class="h_layout">
<div>
<div class="inputgroup">
<label>关键字</label>
<div>
<input class="easyui-validatebox" id="ss_name" name="ss_name" placeholder="可输入角色名称、编码、描述"/>
</div>
</div>
<div class="inputgroup">
<label>应用系统</label>
<div>
<input id="app_uuid" name="app_uuid" />
</div>
</div>
</div>
<div style="width:125px;">
<a class="eapbutton" style="float:right;" onclick="opt_query()"><i class="fa fa-search" aria-hidden="true"></i><span><span>查询</span></span></a>
</div>
</div>
</form>
</div>
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="padding:0px 10px;" >
</div>
</div>
</div>
</body>
<script>
var _getSessionUser = $.getSessionUser();
var _accid = _getSessionUser.account_id;
var _companyid = _getSessionUser.companyuuid;
var _appuuid = _getSessionUser.appuuid;
var _appname = _getSessionUser.appname;
var _gridcode = "platform.uum.uum_rolegrid";
var _gridid = $.getUUID();
var _searchval = '';
var gridid;
$(function(){
debugger;
//查询条件自动过滤空格键
$(document).on("keypress", ".searchbox-text", removeBlank);
//应用系统
$.radio({
id: 'app_uuid'
,data:[{
id:_appuuid
,text:_appname
}]
,defaultFirst:true
});
gridid = $.grid({
id: _gridid,
containerid: 'layout_grid',
gridcode: "platform.uum.uum_rolegrid",
checkbox: false,
checkOnSelect: false,
selectOnCheck: false,
fitColumns: true,
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
queryParams: {
_SRVNAME: 'service.usr.role',
_SRVMETHOD: 'pageQueryNormalRoleList',
_DATA: $.json2str({
op_account_uuid: _accid,
app_uuid: _appuuid,
search_content: _searchval,
result_fields: '',
company_uuid:_companyid,
order_fields: 'display_order asc'
}),
_RSTYPE : 'grid',
_RSFIELD : 'role_info',
_DATAFILTER:'1',//取值范围 1-启用数据权限 0或空-不启用
_RSPARAM : $.json2str({
pagequery : '1'
})
},
idField: 'role_uuid',
pagination: true,
formatter: {
role_name:'formatter_role_name',
command:'formatter_command'
},
onLoadSuccess:function(data){
}
});
});
//刷新grid
function doSearch(value){
_searchval = value;
opt_query();
}
/*
* 查询
*/
function opt_query() {
//组织参数
var dataParam = {
_SRVNAME: 'service.usr.role',
_SRVMETHOD: 'pageQueryNormalRoleList',
_DATA: $.json2str({
op_account_uuid: _accid,
app_uuid: _appuuid,
search_content: $('#ss_name').val(),
result_fields: '',
company_uuid:_companyid,
order_expr: 'display_order asc'
}),
_RSTYPE : 'grid',
_RSFIELD : 'role_info',
_RSPARAM : $.json2str({
pagequery : '1'
})
};
$.grid_reload({
id:_gridid,
queryParams:dataParam
});
}
function formatter_role_name(value, row, index) {
return '<a href=\'javascript:void(0);\' onclick=\'viewRole("'+ row.role_uuid +'")\'>'+ value +'</a>';
}
function formatter_command(value,row,index) {
return '<i title="修改" class="fa fa-pencil-square-o oper-obj" style="font-size:14px;margin:0 5px;" aria-hidden="true" onclick=\'updateRole("'+ row.role_uuid +'")\'></i>'
+ '<i tilte="删除" class="fa fa-trash-o grid-oper-icon" style="font-size:14px;margin:0 5px;" aria-hidden="true" onclick="deleteRole(\''+ row.role_uuid +'\')"></i>'
}
/**
* 过滤空格键
*/
function removeBlank(e) {
if(e.keyCode == 32){
e.preventDefault();
}
}
/**
* [updateRole 查看角色]
* @return {[type]} [无]
*/
function viewRole(role_uuid) {
var wid = $.getUUID();
$.openWin({
id: wid,
title: '查看角色',
height: 400,
width: 700,
url: 'platform/uum/uum_role_add.jsp',
queryParams:{
actionflag: 'view',
selected_id: role_uuid,
app_uuid: _appuuid
},
onClose: function() {
opt_query();
}
});
}
/**
* [addRole 新增角色]
* @return {[type]} [无]
*/
function addRole(){
var wid = $.getUUID();
$.openWin({
id: wid,
title: '新增角色',
height:400,
width:700,
url: 'platform/uum/uum_role_add.jsp',
queryParams: {
actionflag:'add',
app_uuid: _appuuid
},
onClose: function() {
opt_query();
}
});
}
/**
* [updateRole 修改角色]
* @return {[type]} [无]
*/
function updateRole(role_uuid){
var wid = $.getUUID();
$.openWin({
id: wid,
title: '修改角色',
height:400,
width:700,
url: 'platform/uum/uum_role_add.jsp',
queryParams:{
actionflag: 'update',
selected_id: role_uuid,
app_uuid : _appuuid
},
onClose: function() {
opt_query();
}
});
}
/**
* [roleFunc 角色授权]
* @return {[type]} [无]
*/
function roleFunc() {
var row = $.grid_getSelected({
id : _gridid
});
if (!row.role_uuid) {
alert('请选择角色的记录!');
return;
}
var wid = $.getUUID();
$.openWin({
id: wid,
title: '角色授权',
height: 550,
width: 800,
url: 'platform/uum/uum_role_func.jsp',
queryParams:{
actionflag: 'rolefunc',
selected_id: row.role_uuid,
app_uuid:_appuuid
},
onClose: function() {
//alert("closed");
}
});
}
/**
* [roleAcc 关联用户]
* @return {[type]} [无]
*/
function roleAcc(roleid) {
var row = $.grid_getSelected({
id : _gridid
});
if (!row.role_uuid) {
alert('请选择角色的记录!');
return;
}
var wid = $.getUUID();
$.openWin({
id: wid,
title: '角色关联用户',
height: 550,
width: 800,
url: 'platform/uum/uum_role_roleacc.jsp',
queryParams:{
actionflag: 'roleacc',
selected_id: row.role_uuid ,
app_uuid:_appuuid
},
onClose: function() {
//alert("closed");
}
});
}
/**
* [deleteRole 删除角色]
* @return {[type]} [无]
*/
function deleteRole(roleid){
// var ifdelete = confirm("确定要删除该角色吗?");
confirmDialog("确定要删除该角色吗?",function(){
$.wait_open("删除中,请稍候。。。");
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:{
_SRVNAME:'service.usr.role'
,_SRVMETHOD:'delete'
,_DATA:$.json2str({
op_account_uuid:_accid
,role_uuid:roleid
})
},
success:function(result) {
$.wait_close();
//返回值字符串转json
var jres = $.str2json(result);
if(jres.code=="1"){ //操作成功
opt_query();
}else{
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
},function(){});
}
</script>
</html>