using MasaBlazorApp3.Pages; using Mysqlx.Crud; namespace MasaBlazorApp3.Pojo { [Serializable] public class Premission { public Premission Parent { get; set; } = null; public void AddChild(Premission item) { item.Parent = this; this.Items = this.Items.Concat(new Premission[] { item }); } public int Id { get; set; } public string PremissionName { get; set; } /// /// 菜单路径 /// public string PremissionPath { get; set; } public IEnumerable Items { get; set; } = Enumerable.Empty(); public List getAdminPremission() { var list = new List(); Premission q = new Premission { Id = 1, PremissionName =Home.myText.Outbound,// "出库", PremissionPath = "take" }; q.AddChild(new Premission() { Id = 11, PremissionName = Home.myText.OrderTake,// "处方取药", PremissionPath = "/take/order" }); q.AddChild(new Premission() { Id = 12, PremissionName = Home.myText.InvoiceTake,// "调拨取药", PremissionPath = "/take/invoice" }); q.AddChild(new Premission() { Id = 13, PremissionName = Home.myText.DrawerTake,// "抽屉取药", PremissionPath = "/take/drawer" }); q.AddChild(new Premission() { Id = 14, PremissionName =Home.myText.SelfTake,// "自选取药", PremissionPath = "/take/self" }); q.AddChild(new Premission() { Id = 15, PremissionName = Home.myText.TakeRecord,// "取药记录", PremissionPath = "/take/record/2" }); Premission j = new Premission { Id = 2, PremissionName = Home.myText.FillStorage,// "入库", PremissionPath = "add" }; j.AddChild(new Premission() { Id = 21, PremissionName = Home.myText.InvoiceAdd,//"调拨入库", PremissionPath = "/add/invoice" }); //j.AddChild(new Premission() //{ // Id = 22, // PremissionName = "请领入库", // PremissionPath = "/add/apply" //}); j.AddChild(new Premission() { Id = 23, PremissionName = Home.myText.DrawerAdd,//"抽屉入库", PremissionPath = "/add/drawer" }); j.AddChild(new Premission() { Id = 24, PremissionName = Home.myText.AddRecord,//"入库记录", PremissionPath = "/add/record/1" }); Premission h = new Premission { Id = 3, PremissionName = "归还", PremissionPath = "return" }; h.AddChild(new Premission() { Id = 31, PremissionName = Home.myText.ReturnDrugByOrder,//"归还药品(处方)", PremissionPath = "/return/order" }); h.AddChild(new Premission() { Id = 32, PremissionName = Home.myText.ReturnRecord,//"归还药品(记录)", PremissionPath = "/return/byRecord" }); h.AddChild(new Premission() { Id = 33, PremissionName = Home.myText.ReturnEmpty,//"归还空瓶", PremissionPath = "/return/empty" }); h.AddChild(new Premission() { Id = 34, PremissionName = Home.myText.ReturnRecordDrug,//"归还记录(药品)", PremissionPath = "/return/record1/31" }); h.AddChild(new Premission() { Id = 35, PremissionName = Home.myText.ReturnRecordEmpty,// "归还记录(空瓶)", PremissionPath = "/return/record2/32" }); Premission k = new Premission { Id = 4, PremissionName = Home.myText.StockManage,//"库存管理", PremissionPath = "stock" }; k.AddChild(new Premission() { Id = 41, PremissionName = Home.myText.StockList,//"库存列表", PremissionPath = "/stock/list" }); k.AddChild(new Premission() { Id = 42, PremissionName = Home.myText.StockBind,//"库位绑定", PremissionPath = "/stock/binding" }); k.AddChild(new Premission() { Id = 43, PremissionName = Home.myText.StorageCheck,//"库存盘点", //PremissionName = "盘点交接", PremissionPath = "/stock/check" }); k.AddChild(new Premission() { Id = 44, PremissionName =Home.myText.CheckRecord,// "盘点记录", //PremissionPath = "/stock/checkRecord" PremissionPath = "/stock/record/4" }); k.AddChild(new Premission() { Id = 45, PremissionName = Home.myText.DrugInfo,//"药品信息", PremissionPath = "/stock/drug" }); k.AddChild(new Premission() { Id = 46, PremissionName = Home.myText.DrugSetting,//"药品标定", PremissionPath = "/stock/biaoDing" }); k.AddChild(new Premission() { Id = 47, PremissionName = Home.myText.HandoverList,//"交接班列表", PremissionPath = "/stock/Change" }); Premission x = new Premission { Id = 5, PremissionName = Home.myText.SystemManage,//"系统管理", PremissionPath = "manage" }; x.AddChild(new Premission() { Id = 51, PremissionName = Home.myText.UserManage,//"用户管理", PremissionPath = "/manage/user" }); x.AddChild(new Premission() { Id = 52, PremissionName = Home.myText.RoleManage,//"权限管理", PremissionPath = "/manage/role" }); Premission set = new Premission() { Id = 53, PremissionName = Home.myText.SystemSet,//"系统设置", PremissionPath = "/manage/setting" //PremissionPath = "/Box/Plan" }; set.AddChild(new Premission() { Id = 531, PremissionName = Home.myText.LoginSet,//"登录设置", PremissionPath = "/manage/setting/login" }); set.AddChild(new Premission() { Id = 532, PremissionName = Home.myText.FridgeSet,//"冰箱设置", PremissionPath = "/manage/setting/Fridge" }); //x.AddChild(new Premission() //{ // Id = 54, // PremissionName = "套餐管理", // PremissionPath = "/Box/Plan" //}); //x.AddChild(new Premission() //{ // Id = 55, // PremissionName = "绑定药箱", // PremissionPath = "/Box/BoxBindings" //}); //x.AddChild(new Premission() //{ // Id = 56, // PremissionName = "药箱核对", // PremissionPath = "/Box/Check" //}); //x.AddChild(new Premission() //{ // Id = 57, // PremissionName = "药箱加药", // PremissionPath = "/Box/BoxAdd" //}); //x.AddChild(new Premission() //{ // Id = 58, // PremissionName = "药箱入库", // PremissionPath = "/Box/BoxAddBox" //}); //x.AddChild(new Premission() //{ // Id = 59, // PremissionName = "药箱库存", // PremissionPath = "/Box/BoxStock" //}); Premission b = new Premission { Id = 6, PremissionName = Home.myText.BoxManage,//"药箱管理", PremissionPath = "Box" }; b.AddChild(new Premission() { Id = 61, PremissionName = Home.myText.MenuManage,//"套餐管理", PremissionPath = "/Box/Plan" }); b.AddChild(new Premission() { Id = 62, PremissionName = Home.myText.BindBox,//"绑定药箱", PremissionPath = "/Box/BoxBindings" }); b.AddChild(new Premission() { Id = 63, PremissionName = Home.myText.BoxCheck,//"药箱核对", //PremissionName = "盘点交接", PremissionPath = "/Box/Check" }); b.AddChild(new Premission() { Id = 64, PremissionName = Home.myText.BoxAdd,//"药箱加药", //PremissionPath = "/stock/checkRecord" PremissionPath = "/Box/BoxAdd" }); b.AddChild(new Premission() { Id = 65, PremissionName =Home.myText.BoxAddBox,// "药箱入库", PremissionPath = "/Box/BoxAddBox" }); b.AddChild(new Premission() { Id = 66, PremissionName =Home.myText.BoxStock,// "药箱库存", PremissionPath = "/Box/BoxStock" }); list.Add(q); list.Add(j); list.Add(h); list.Add(k); list.Add(b); x.AddChild(set); list.Add(x); return list; } public bool HasChild() { return this.Items.Count() > 0; } } }