6 changed files with 121 additions and 114 deletions
@ -1,29 +1,29 @@ |
|||||
using Volo.Abp.Application; |
using Volo.Abp.Application; |
||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
using Volo.Abp.SettingManagement; |
using Volo.Abp.SettingManagement; |
||||
using Volo.Abp.SettingManagement.Localization; |
using Volo.Abp.SettingManagement.Localization; |
||||
using Volo.Abp.VirtualFileSystem; |
using Volo.Abp.VirtualFileSystem; |
||||
|
|
||||
namespace LINGYUN.Abp.SettingManagement |
namespace LINGYUN.Abp.SettingManagement |
||||
{ |
{ |
||||
[DependsOn(typeof(AbpDddApplicationModule))] |
[DependsOn(typeof(AbpDddApplicationContractsModule))] |
||||
[DependsOn(typeof(AbpSettingManagementDomainSharedModule))] |
[DependsOn(typeof(AbpSettingManagementDomainSharedModule))] |
||||
public class AbpSettingManagementApplicationContractsModule : AbpModule |
public class AbpSettingManagementApplicationContractsModule : AbpModule |
||||
{ |
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
{ |
{ |
||||
Configure<AbpVirtualFileSystemOptions>(options => |
Configure<AbpVirtualFileSystemOptions>(options => |
||||
{ |
{ |
||||
options.FileSets.AddEmbedded<AbpSettingManagementApplicationContractsModule>(); |
options.FileSets.AddEmbedded<AbpSettingManagementApplicationContractsModule>(); |
||||
}); |
}); |
||||
|
|
||||
Configure<AbpLocalizationOptions>(options => |
Configure<AbpLocalizationOptions>(options => |
||||
{ |
{ |
||||
options.Resources |
options.Resources |
||||
.Get<AbpSettingManagementResource>() |
.Get<AbpSettingManagementResource>() |
||||
.AddVirtualJson("/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts"); |
.AddVirtualJson("/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts"); |
||||
}); |
}); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,25 +1,22 @@ |
|||||
using System; |
using Volo.Abp.Authorization.Permissions; |
||||
using System.Collections.Generic; |
using Volo.Abp.Localization; |
||||
using System.Text; |
using Volo.Abp.SettingManagement.Localization; |
||||
using Volo.Abp.Authorization.Permissions; |
|
||||
using Volo.Abp.Localization; |
namespace LINGYUN.Abp.SettingManagement |
||||
using Volo.Abp.SettingManagement.Localization; |
{ |
||||
|
public class AbpSettingManagementPermissionProvider : PermissionDefinitionProvider |
||||
namespace LINGYUN.Abp.SettingManagement |
{ |
||||
{ |
public override void Define(IPermissionDefinitionContext context) |
||||
public class AbpSettingManagementPermissionProvider : PermissionDefinitionProvider |
{ |
||||
{ |
var settingPermissionGroup = context.AddGroup(AbpSettingManagementPermissions.GroupName, L("Permission:SettingManagement")); |
||||
public override void Define(IPermissionDefinitionContext context) |
|
||||
{ |
var settingPermissions = settingPermissionGroup.AddPermission(AbpSettingManagementPermissions.Settings.Default, L("Permission:Settings")); |
||||
var settingPermissionGroup = context.AddGroup(AbpSettingManagementPermissions.GroupName, L("Permission:SettingManagement")); |
settingPermissions.AddChild(AbpSettingManagementPermissions.Settings.Manager, L("Permission:Manager")); |
||||
|
} |
||||
var settingPermissions = settingPermissionGroup.AddPermission(AbpSettingManagementPermissions.Settings.Default, L("Permission:Settings")); |
|
||||
settingPermissions.AddChild(AbpSettingManagementPermissions.Settings.Manager, L("Permission:Manager")); |
private static LocalizableString L(string name) |
||||
} |
{ |
||||
|
return LocalizableString.Create<AbpSettingManagementResource>(name); |
||||
private static LocalizableString L(string name) |
} |
||||
{ |
} |
||||
return LocalizableString.Create<AbpSettingManagementResource>(name); |
} |
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,42 +1,53 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace LINGYUN.Abp.SettingManagement |
namespace LINGYUN.Abp.SettingManagement |
||||
{ |
{ |
||||
public class SettingDetailsDto |
public class SettingDetailsDto |
||||
{ |
{ |
||||
public string Name { get; set; } |
public string Name { get; set; } |
||||
|
|
||||
public string DisplayName { get; set; } |
public string DisplayName { get; set; } |
||||
|
|
||||
public string Description { get; set; } |
public string Description { get; set; } |
||||
|
|
||||
public string Value { get; set; } |
public string Value { get; set; } |
||||
|
|
||||
public string DefaultValue { get; set; } |
public string DefaultValue { get; set; } |
||||
|
|
||||
public bool IsEncrypted { get; set; } |
public bool IsEncrypted { get; set; } |
||||
|
|
||||
public ValueType ValueType { get; set; } |
public ValueType ValueType { get; set; } |
||||
/// <summary>
|
/// <summary>
|
||||
/// 选项列表,仅当 ValueType 为 Option有效
|
/// 插槽,前端定义控件
|
||||
/// </summary>
|
/// </summary>
|
||||
public List<OptionDto> Options { get; set; } = new List<OptionDto>(); |
public string Slot { get; set; } |
||||
|
/// <summary>
|
||||
public SettingDetailsDto AddOption(string name, string value) |
/// 选项列表,仅当 ValueType 为 Option有效
|
||||
{ |
/// </summary>
|
||||
Options.Add(new OptionDto |
public List<OptionDto> Options { get; set; } = new List<OptionDto>(); |
||||
{ |
|
||||
Name = name, |
public SettingDetailsDto WithSlot(string slot) |
||||
Value = value |
{ |
||||
}); |
Slot = slot; |
||||
|
|
||||
return this; |
return this; |
||||
} |
} |
||||
|
|
||||
public SettingDetailsDto AddOptions(IEnumerable<OptionDto> options) |
public SettingDetailsDto AddOption(string name, string value) |
||||
{ |
{ |
||||
Options.AddRange(options); |
Options.Add(new OptionDto |
||||
return this; |
{ |
||||
} |
Name = name, |
||||
} |
Value = value |
||||
|
}); |
||||
|
|
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public SettingDetailsDto AddOptions(IEnumerable<OptionDto> options) |
||||
|
{ |
||||
|
Options.AddRange(options); |
||||
|
return this; |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
@ -1,13 +1,15 @@ |
|||||
using Volo.Abp.Modularity; |
using Volo.Abp.Application; |
||||
using Volo.Abp.SettingManagement; |
using Volo.Abp.Modularity; |
||||
|
using Volo.Abp.SettingManagement; |
||||
namespace LINGYUN.Abp.SettingManagement |
|
||||
{ |
namespace LINGYUN.Abp.SettingManagement |
||||
[DependsOn( |
{ |
||||
typeof(AbpSettingManagementDomainModule), |
[DependsOn( |
||||
typeof(AbpSettingManagementApplicationContractsModule) |
typeof(AbpSettingManagementDomainModule), |
||||
)] |
typeof(AbpSettingManagementApplicationContractsModule), |
||||
public class AbpSettingManagementApplicationModule : AbpModule |
typeof(AbpDddApplicationModule) |
||||
{ |
)] |
||||
} |
public class AbpSettingManagementApplicationModule : AbpModule |
||||
} |
{ |
||||
|
} |
||||
|
} |
||||
|
|||||
Loading…
Reference in new issue