mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-04-24 13:11:46 +08:00
调整数据库菜单表结构,可以动态加载按钮,注意更新数据库结构并重新初始化数据库
This commit is contained in:
@@ -1,15 +1,37 @@
|
||||
@{
|
||||
@using System.Text
|
||||
@{
|
||||
string _prefix = "user";
|
||||
var _treeId = _prefix + "Tree";
|
||||
var _gridId = _prefix + "Grid";
|
||||
var _treeDetail = _prefix + "Detail";
|
||||
}
|
||||
|
||||
<div class="bjui-pageContent">
|
||||
<div class="clearfix">
|
||||
<div style="float: left; width: 220px; overflow: auto;" class="table table-bordered">
|
||||
<ul id="@_treeId" class="ztree"></ul>
|
||||
</div>
|
||||
|
||||
<div class="bjui-pageHeader" style="margin-left: 225px">
|
||||
<div class="bjui-searchBar">
|
||||
<div class="bjui-searchBar">
|
||||
@{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var element in ViewBag.Module.Elements)
|
||||
{
|
||||
sb.Append("<" + element.Type
|
||||
+" data-icon='" + element.Icon+"' "
|
||||
+" class='" + element.Class+"' "
|
||||
+" onclick='" + element.Script+"' " + element.Attr
|
||||
+ ">"+element.Name +"</" + element.Type +">");
|
||||
}
|
||||
@Html.Raw(sb.ToString())
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="@_treeDetail" style="margin-left: 225px;">
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,25 +51,15 @@
|
||||
$('#@_treeDetail').empty()
|
||||
.append('<table id="@_gridId" class="table table-bordered"></table>');
|
||||
|
||||
@{
|
||||
string strBtns = string.Empty;
|
||||
foreach (var element in ViewBag.Module.Elements)
|
||||
{
|
||||
strBtns +="<button type=\"button\" class =\"btn btn-green\">"+element.Name +"</button>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
grid = $(gridid).datagrid({
|
||||
gridTitle: '用户列表',
|
||||
showToolbar: true,
|
||||
showToolbar: false,
|
||||
filterThead: false,
|
||||
toolbarItem: 'refresh, |, del',
|
||||
toolbarCustom: '<a href="/UserManager/Add" class="btn btn-green" data-icon ="plus" ' +
|
||||
'data-toggle="dialog" data-id="dialog-mask" data-mask="true" data-on-close="refreshGrid">添加</a>' +
|
||||
'<button class=" btn-green" onclick="editOrg()" data-icon="pencil" type="button">编辑</button>' +
|
||||
'<button type="button" class="btn btn-green" onclick="openModuleAccess(this)">为用户分配模块</button>' +
|
||||
'<button type="button" class ="btn btn-green" onclick="openRoleAccess(this)">为用户分配角色</button>' + '@strBtns',
|
||||
'<button type="button" class ="btn btn-green" onclick="openRoleAccess(this)">为用户分配角色</button>',
|
||||
columns: [
|
||||
{
|
||||
name: 'Id',
|
||||
|
||||
Reference in New Issue
Block a user