HKC_Blazor/MasaBlazorApp3/Pojo/Premission.cs

324 lines
11 KiB
C#
Raw Permalink Normal View History

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