mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
missing file
This commit is contained in:
parent
975632c81e
commit
6487f83f94
130
OpenAuth.Mvc/Views/ModuleElementManager/AssignForUser.cshtml
Normal file
130
OpenAuth.Mvc/Views/ModuleElementManager/AssignForUser.cshtml
Normal file
@ -0,0 +1,130 @@
|
||||
@{
|
||||
string _prefix = "assignForUser";
|
||||
var _treeId = _prefix + "Tree";
|
||||
var _gridId = _prefix + "Grid";
|
||||
var _treeDetail = _prefix + "Detail";
|
||||
}
|
||||
<div class="bjui-pageHeader">
|
||||
<div class="bjui-searchBar">
|
||||
<input style="display: none" id="userId" value="@ViewBag.UserId" />
|
||||
<div class="pull-right">
|
||||
<div class="alert alert-info search-inline">
|
||||
<i class="fa fa-info-circle"></i> 点击行为单选,点击复选框可多选统一授权
|
||||
</div>
|
||||
<button type="button" class="btn-green" data-num="1" data-icon="plus" onclick="assign()">
|
||||
授权选中项目
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bjui-pageContent tableContent">
|
||||
<div class="clearfix">
|
||||
<div style="float: left; width: 220px; overflow: auto;" class="table table-bordered">
|
||||
<ul id="@_treeId" class="ztree"></ul>
|
||||
</div>
|
||||
|
||||
<div id="@_treeDetail" style="margin-left: 225px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var selectedId = 0;
|
||||
$(document).ready(function () {
|
||||
initZtree();
|
||||
loadDataGrid();
|
||||
});
|
||||
//加载数据到datagrid
|
||||
function loadDataGrid() {
|
||||
//b-jui的datagrid需要重新处理HTML
|
||||
$('#@_treeDetail').empty()
|
||||
.append('<table id="@_gridId" class="table table-bordered table-hover table-striped table-top"></table>');
|
||||
|
||||
$('#@_gridId').datagrid({
|
||||
showToolbar: false,
|
||||
filterThead: false,
|
||||
columns: [
|
||||
{
|
||||
name: 'Id',
|
||||
label: '元素名称',
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
label: '元素名称',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
name: 'ModuleName',
|
||||
label: '所属模块',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
name: 'Accessed',
|
||||
label: '是否已经授权',
|
||||
type: 'select',
|
||||
align: 'center',
|
||||
items: [{ 'false': '未授权', 'true': '已授权' }],
|
||||
width: 80
|
||||
}
|
||||
],
|
||||
dataUrl: 'ModuleElementManager/LoadForUser?orgId=' + selectedId + '&userId=' + $('#userId').val(),
|
||||
fullGrid: true,
|
||||
showLinenumber: true,
|
||||
showCheckboxcol: true,
|
||||
paging: true,
|
||||
filterMult: false,
|
||||
showTfoot: true
|
||||
});
|
||||
}
|
||||
|
||||
function zTreeOnClick(event, treeId, treeNode) {
|
||||
selectedId = treeNode.Id;
|
||||
loadDataGrid();
|
||||
}
|
||||
|
||||
function initZtree() {
|
||||
var setting = {
|
||||
view: { selectedMulti: false },
|
||||
data: {
|
||||
key: {
|
||||
name: 'Name',
|
||||
title: 'Name'
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: 'Id',
|
||||
pIdKey: 'ParentId',
|
||||
rootPId: 'null'
|
||||
}
|
||||
},
|
||||
callback: { onClick: zTreeOnClick }
|
||||
};
|
||||
$.getJSON('ModuleManager/LoadForTree', function (json) {
|
||||
var zTreeObj = $.fn.zTree.init($('#@_treeId'), setting, json);
|
||||
zTreeObj.expandAll(true);
|
||||
});
|
||||
}
|
||||
|
||||
//授权选中的
|
||||
function assign() {
|
||||
var selected = getSelectedMany('#@_gridId', 2);
|
||||
if (selected == null) return;
|
||||
|
||||
$.post("ModuleElementManager/AssignForUser",
|
||||
{
|
||||
userId: $('#userId').val(),
|
||||
menuIds: selected
|
||||
},
|
||||
function (data) {
|
||||
refreshGrid();
|
||||
});
|
||||
}
|
||||
|
||||
function refreshGrid() {
|
||||
$('#@_gridId').datagrid('refresh');
|
||||
// loadDataGrid();
|
||||
}
|
||||
//@@ sourceURL=ModuleManagerIndex.js
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user