2025-04-18 11:01:56 +08:00
|
|
|
|
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; }
|
|
|
|
|
/// <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,
|
|
|
|
|
PremissionName = "出库",
|
|
|
|
|
PremissionPath = "take"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
q.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 11,
|
|
|
|
|
PremissionName = "处方取药",
|
|
|
|
|
PremissionPath = "/take/order"
|
|
|
|
|
});
|
|
|
|
|
q.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 12,
|
|
|
|
|
PremissionName = "调拨取药",
|
|
|
|
|
PremissionPath = "/take/invoice"
|
|
|
|
|
});
|
|
|
|
|
q.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 13,
|
|
|
|
|
PremissionName = "抽屉取药",
|
|
|
|
|
PremissionPath = "/take/drawer"
|
|
|
|
|
});
|
|
|
|
|
q.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 14,
|
|
|
|
|
PremissionName = "自选取药",
|
|
|
|
|
PremissionPath = "/take/self"
|
|
|
|
|
});
|
|
|
|
|
q.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 15,
|
|
|
|
|
PremissionName = "取药记录",
|
|
|
|
|
PremissionPath = "/take/record/2"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Premission j = new Premission
|
|
|
|
|
{
|
|
|
|
|
Id = 2,
|
|
|
|
|
PremissionName = "入库",
|
|
|
|
|
PremissionPath = "add"
|
|
|
|
|
};
|
|
|
|
|
j.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 21,
|
|
|
|
|
PremissionName = "调拨入库",
|
|
|
|
|
PremissionPath = "/add/invoice"
|
|
|
|
|
});
|
|
|
|
|
//j.AddChild(new Premission()
|
|
|
|
|
//{
|
|
|
|
|
// Id = 22,
|
|
|
|
|
// PremissionName = "请领入库",
|
|
|
|
|
// PremissionPath = "/add/apply"
|
|
|
|
|
//});
|
|
|
|
|
j.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 23,
|
|
|
|
|
PremissionName = "抽屉入库",
|
|
|
|
|
PremissionPath = "/add/drawer"
|
|
|
|
|
});
|
|
|
|
|
j.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 24,
|
|
|
|
|
PremissionName = "入库记录",
|
|
|
|
|
PremissionPath = "/add/record/1"
|
|
|
|
|
});
|
|
|
|
|
Premission h = new Premission
|
|
|
|
|
{
|
|
|
|
|
Id = 3,
|
|
|
|
|
PremissionName = "归还",
|
|
|
|
|
PremissionPath = "return"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
h.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 31,
|
|
|
|
|
PremissionName = "归还药品(处方)",
|
|
|
|
|
PremissionPath = "/return/order"
|
|
|
|
|
});
|
|
|
|
|
h.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 32,
|
|
|
|
|
PremissionName = "归还药品(记录)",
|
|
|
|
|
PremissionPath = "/return/byRecord"
|
|
|
|
|
});
|
|
|
|
|
h.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 33,
|
|
|
|
|
PremissionName = "归还空瓶",
|
|
|
|
|
PremissionPath = "/return/empty"
|
|
|
|
|
});
|
|
|
|
|
h.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 34,
|
|
|
|
|
PremissionName = "归还记录(药品)",
|
|
|
|
|
PremissionPath = "/return/record1/31"
|
|
|
|
|
});
|
|
|
|
|
h.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 35,
|
|
|
|
|
PremissionName = "归还记录(空瓶)",
|
|
|
|
|
PremissionPath = "/return/record2/32"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Premission k = new Premission
|
|
|
|
|
{
|
|
|
|
|
Id = 4,
|
|
|
|
|
PremissionName = "库存管理",
|
|
|
|
|
PremissionPath = "stock"
|
|
|
|
|
};
|
|
|
|
|
k.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 41,
|
|
|
|
|
PremissionName = "库存列表",
|
|
|
|
|
PremissionPath = "/stock/list"
|
|
|
|
|
});
|
|
|
|
|
k.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 42,
|
|
|
|
|
PremissionName = "库位绑定",
|
|
|
|
|
PremissionPath = "/stock/binding"
|
|
|
|
|
});
|
|
|
|
|
k.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 43,
|
|
|
|
|
PremissionName = "库存盘点",
|
|
|
|
|
//PremissionName = "盘点交接",
|
|
|
|
|
PremissionPath = "/stock/check"
|
|
|
|
|
});
|
|
|
|
|
k.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 44,
|
|
|
|
|
PremissionName = "盘点记录",
|
|
|
|
|
//PremissionPath = "/stock/checkRecord"
|
|
|
|
|
PremissionPath = "/stock/record/4"
|
|
|
|
|
});
|
|
|
|
|
k.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 45,
|
|
|
|
|
PremissionName = "药品信息",
|
|
|
|
|
PremissionPath = "/stock/drug"
|
|
|
|
|
});
|
|
|
|
|
k.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 46,
|
|
|
|
|
PremissionName = "药品标定",
|
|
|
|
|
PremissionPath = "/stock/biaoDing"
|
|
|
|
|
});
|
2025-07-05 10:07:33 +08:00
|
|
|
|
k.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 47,
|
|
|
|
|
PremissionName = "交接班列表",
|
|
|
|
|
PremissionPath = "/stock/Change"
|
|
|
|
|
});
|
2025-04-18 11:01:56 +08:00
|
|
|
|
Premission x = new Premission
|
|
|
|
|
{
|
|
|
|
|
Id = 5,
|
|
|
|
|
PremissionName = "系统管理",
|
|
|
|
|
PremissionPath = "manage"
|
|
|
|
|
};
|
|
|
|
|
x.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 51,
|
|
|
|
|
PremissionName = "用户管理",
|
|
|
|
|
PremissionPath = "/manage/user"
|
|
|
|
|
});
|
|
|
|
|
x.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 52,
|
|
|
|
|
PremissionName = "权限管理",
|
|
|
|
|
PremissionPath = "/manage/role"
|
|
|
|
|
});
|
2025-06-24 08:55:34 +08:00
|
|
|
|
Premission set = new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 53,
|
|
|
|
|
PremissionName = "系统设置",
|
|
|
|
|
PremissionPath = "/manage/setting"
|
|
|
|
|
//PremissionPath = "/Box/Plan"
|
|
|
|
|
};
|
|
|
|
|
set.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 531,
|
|
|
|
|
PremissionName = "登录设置",
|
|
|
|
|
PremissionPath = "/manage/setting/login"
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
set.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 532,
|
|
|
|
|
PremissionName = "冰箱设置",
|
|
|
|
|
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,
|
|
|
|
|
PremissionName = "药箱管理",
|
|
|
|
|
PremissionPath = "Box"
|
|
|
|
|
};
|
|
|
|
|
b.AddChild(new Premission()
|
|
|
|
|
{
|
|
|
|
|
Id = 61,
|
2025-06-24 08:55:34 +08:00
|
|
|
|
PremissionName = "套餐管理",
|
|
|
|
|
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-06-24 08:55:34 +08:00
|
|
|
|
PremissionName = "绑定药箱",
|
|
|
|
|
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-06-24 08:55:34 +08:00
|
|
|
|
PremissionName = "药箱核对",
|
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-07-05 10:07:33 +08:00
|
|
|
|
Id = 66,
|
2025-06-24 08:55:34 +08:00
|
|
|
|
PremissionName = "药箱加药",
|
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-06-24 08:55:34 +08:00
|
|
|
|
PremissionName = "药箱入库",
|
|
|
|
|
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-06-27 09:54:42 +08:00
|
|
|
|
PremissionName = "药箱库存",
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|