v7.3.2018.0614   重构高性能资源池,减少GC压力,增加线程池,让异步任务得到平等竞争CPU的机会
大石头 authored at 2018-06-14 17:56:44
1.78 KiB
X
@using System.Reflection
@using XCode
@using XCode.Configuration
@{
    Layout = null;

    var role = Model.Role as Role;
    var menus = Menu.Root.AllChilds;
    //var pfs = EnumHelper.GetDescriptions<PermissionFlags>().Where(e => e.Key > PermissionFlags.None);
}
<div class="form-group col-md-12">
    <label class="control-label col-md-2">授权</label>
    <div class="input-group col-md-10">
        <table class="table table-bordered table-hover table-striped table-condensed">
            <thead>
                <tr>
                    <th>名称</th>
                    <th>显示名</th>
                    <th>授权</th>
                    <th>操作权限</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var entity in menus)
                {
                    <tr>
                        <td>@entity.TreeNodeName</td>
                        <td>@entity.DisplayName</td>
                        <td>@Html.CheckBox("p" + entity.ID, role.Has(entity.ID))</td>
                        <td>
                            @if (entity.Childs.Count == 0)
                            {
                                foreach (var item in entity.Permissions.OrderBy(e => e.Key))
                                {
                                    var id = "pf" + entity.ID + "_" + ((Int32)item.Key);
                                    @Html.CheckBox(id, role.Has(entity.ID, (PermissionFlags)item.Key))
                                    @Html.Label(id, item.Value)
                                    <text>&nbsp;</text>
                                }
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>