[fix]Config创建默认配置文件的开关Runtime.CreateConfigOnMissing,仅需对自动创建生效,而不应该阻止用户主动Save
智能大石头 authored at 2024-08-09 00:30:41 石头 committed at 2024-08-10 14:22:24
1.56 KiB
X
using System;
using System.ComponentModel;
using System.Linq;
using System.Web.Mvc;
using XCode.Membership;

namespace NewLife.Cube.Admin.Controllers
{
    /// <summary>菜单控制器</summary>
    [DisplayName("菜单")]
    [Description("系统操作菜单以及功能目录树。支持排序,不可见菜单仅用于功能权限限制。每个菜单的权限子项由系统自动生成,请不要人为修改")]
    public class MenuController : EntityTreeController<Menu>
    {
        static MenuController()
        {
            //// 过滤要显示的字段
            //var names = "ID,TreeNodeName,DisplayName,Url,Sort,Visible,Necessary".Split(",");
            //var fs = Menu.Meta.AllFields;
            //var list = names.Select(e => fs.FirstOrDefault(f => f.Name.EqualIgnoreCase(e))).Where(e => e != null);
            ////list.RemoveAll(e => !names.Contains(e.Name));
            //ListFields.Clear();
            //ListFields.AddRange(list);

            ListFields.RemoveField("Remark");
            FormFields.RemoveField("Remark");
        }

        ///// <summary>动作执行前</summary>
        ///// <param name="filterContext"></param>
        //protected override void OnActionExecuting(ActionExecutingContext filterContext)
        //{
        //    ViewBag.HeaderContent = "系统操作菜单以及功能目录树。支持排序,不可见菜单仅用于功能权限限制。每个菜单的权限子项由系统自动生成,请不要人为修改";

        //    base.OnActionExecuting(filterContext);
        //}
    }
}