添加DataService为数据服务类,负责数据的加载工作,通过消息来通知DataService更新数据

This commit is contained in:
2025-06-28 19:32:51 +08:00
parent a04bfc2010
commit dba56f07d2
17 changed files with 181 additions and 34 deletions

View File

@@ -1,4 +1,6 @@
using PMSWPF.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
namespace PMSWPF.Data.Entities;
@@ -10,6 +12,8 @@ public class DbMenu
public string Icon { get; set; }
public string Name { get; set; }
public int ParentId { get; set; }
[SugarColumn(ColumnDataType = "varchar(20)", SqlParameterDbType = typeof(EnumToStringConvert))]
public MenuType Type { get; set; }
[SugarColumn(IsIgnore = true)]
public List<DbMenu> Items { get; set; }

View File

@@ -63,12 +63,14 @@ public class MenuRepository
{
Name = "默认变量表",
Icon = SegoeFluentIcons.Tablet.Glyph,
Type = MenuType.VariableTableMenu,
ParentId = addDM.Id,
};
var addVarTable=new MenuBean()
{
Name = "添加变量表",
Icon = SegoeFluentIcons.Add.Glyph,
Type = MenuType.AddVariableTableMenu,
ParentId = addDM.Id,
};
var defTableRes = await _db.Insertable<DbMenu>(defVarTable).ExecuteCommandAsync();