diff --git a/Yi.Abp.Net8/framework/Yi.Framework.Ddd.Application/YiCrudAppService.cs b/Yi.Abp.Net8/framework/Yi.Framework.Ddd.Application/YiCrudAppService.cs index 3ead8bcc..dae1a753 100644 --- a/Yi.Abp.Net8/framework/Yi.Framework.Ddd.Application/YiCrudAppService.cs +++ b/Yi.Abp.Net8/framework/Yi.Framework.Ddd.Application/YiCrudAppService.cs @@ -11,12 +11,12 @@ namespace Yi.Framework.Ddd.Application /// /// CRUD应用服务基类 - 基础版本 /// - public abstract class YiCrudAppService + public abstract class YiCrudAppService : YiCrudAppService where TEntity : class, IEntity where TEntityDto : IEntityDto { - protected YiCrudAppService(IRepository repository) + protected YiCrudAppService(IRepository repository) : base(repository) { } @@ -30,7 +30,7 @@ namespace Yi.Framework.Ddd.Application where TEntity : class, IEntity where TEntityDto : IEntityDto { - protected YiCrudAppService(IRepository repository) + protected YiCrudAppService(IRepository repository) : base(repository) { } @@ -44,7 +44,7 @@ namespace Yi.Framework.Ddd.Application where TEntity : class, IEntity where TEntityDto : IEntityDto { - protected YiCrudAppService(IRepository repository) + protected YiCrudAppService(IRepository repository) : base(repository) { } @@ -58,7 +58,7 @@ namespace Yi.Framework.Ddd.Application where TEntity : class, IEntity where TEntityDto : IEntityDto { - protected YiCrudAppService(IRepository repository) + protected YiCrudAppService(IRepository repository) : base(repository) { } @@ -78,7 +78,7 @@ namespace Yi.Framework.Ddd.Application /// private const string TempFilePath = "/wwwroot/temp"; - protected YiCrudAppService(IRepository repository) + protected YiCrudAppService(IRepository repository) : base(repository) { } @@ -96,7 +96,7 @@ namespace Yi.Framework.Ddd.Application // 获取并验证实体 var entity = await GetEntityByIdAsync(id); - + // 检查更新输入 await CheckUpdateInputDtoAsync(entity, input); @@ -124,10 +124,10 @@ namespace Yi.Framework.Ddd.Application { // 检查创建权限 await CheckCreatePolicyAsync(); - + // 检查创建输入 await CheckCreateInputDtoAsync(input); - + // 映射到实体 var entity = await MapToEntityAsync(input); @@ -156,13 +156,13 @@ namespace Yi.Framework.Ddd.Application public override async Task> GetListAsync(TGetListInput input) { List entities; - + // 根据输入类型决定查询方式 if (input is IPagedResultRequest pagedInput) { // 分页查询 entities = await Repository.GetPagedListAsync( - pagedInput.SkipCount, + pagedInput.SkipCount, pagedInput.MaxResultCount, string.Empty ); @@ -176,7 +176,23 @@ namespace Yi.Framework.Ddd.Application // 获取总数并映射结果 var totalCount = await Repository.GetCountAsync(); var dtos = await MapToGetListOutputDtosAsync(entities); - + + return new PagedResultDto(totalCount, dtos); + } + + /// + /// 获取实体动态下拉框列表,子类重写该方法,通过 keywords 进行筛选 + /// + /// 查询关键字 + /// + public virtual async Task> GetSelectDataListAsync(string? keywords = null) + { + List entities = await Repository.GetListAsync(); + + // 获取总数并映射结果 + var totalCount = entities.Count; + var dtos = await MapToGetListOutputDtosAsync(entities); + return new PagedResultDto(totalCount, dtos); } diff --git a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarCoreExtensions.cs b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarCoreExtensions.cs index 535cd3ff..1f1fc627 100644 --- a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarCoreExtensions.cs +++ b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarCoreExtensions.cs @@ -26,7 +26,7 @@ public static class SqlSugarCoreExtensions ServiceLifetime serviceLifetime = ServiceLifetime.Transient) where TDbContext : class, ISqlSugarDbContextDependencies { - services.TryAdd(new ServiceDescriptor( + services.Add(new ServiceDescriptor( typeof(ISqlSugarDbContextDependencies), typeof(TDbContext), serviceLifetime)); diff --git a/Yi.RuoYi.Vue3/src/api/system/menu.js b/Yi.RuoYi.Vue3/src/api/system/menu.js index 03ff3ab7..b14253ab 100644 --- a/Yi.RuoYi.Vue3/src/api/system/menu.js +++ b/Yi.RuoYi.Vue3/src/api/system/menu.js @@ -59,6 +59,6 @@ export function delMenu(menuId) { return request({ url: `/menu`, method: 'delete', - params:{id:menuId} + params:{ids:menuId} }) } \ No newline at end of file diff --git a/Yi.RuoYi.Vue3/src/components/SelectDataTag/index.vue b/Yi.RuoYi.Vue3/src/components/SelectDataTag/index.vue new file mode 100644 index 00000000..49ed7803 --- /dev/null +++ b/Yi.RuoYi.Vue3/src/components/SelectDataTag/index.vue @@ -0,0 +1,83 @@ + + + diff --git a/Yi.RuoYi.Vue3/src/main.js b/Yi.RuoYi.Vue3/src/main.js index 4e2f787e..cf792a22 100644 --- a/Yi.RuoYi.Vue3/src/main.js +++ b/Yi.RuoYi.Vue3/src/main.js @@ -43,6 +43,8 @@ import ImagePreview from "@/components/ImagePreview" import TreeSelect from '@/components/TreeSelect' // 字典标签组件 import DictTag from '@/components/DictTag' +// 动态数据下拉选择框组件 +import SelectDataTag from '@/components/SelectDataTag' const app = createApp(App) @@ -57,6 +59,7 @@ app.config.globalProperties.selectDictLabel = selectDictLabel app.config.globalProperties.selectDictLabels = selectDictLabels // 全局组件挂载 +app.component('SelectDataTag', SelectDataTag) app.component('DictTag', DictTag) app.component('Pagination', Pagination) app.component('TreeSelect', TreeSelect) diff --git a/Yi.RuoYi.Vue3/src/views/system/dict/data.vue b/Yi.RuoYi.Vue3/src/views/system/dict/data.vue index 3f6a2d9b..6df8d842 100644 --- a/Yi.RuoYi.Vue3/src/views/system/dict/data.vue +++ b/Yi.RuoYi.Vue3/src/views/system/dict/data.vue @@ -230,6 +230,13 @@ > + +