Merge pull request 'feat: 😀实现系统配置参数值租户隔离' (#235) from jasondom/Admin.NET.Pro:v2 into v2
Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/235
This commit is contained in:
commit
ce225e9d86
@ -32,7 +32,7 @@ public partial class SysConfig : EntityBase
|
||||
/// <summary>
|
||||
/// 属性值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "属性值", Length = 256)]
|
||||
[SugarColumn(ColumnDescription = "属性值", Length = 512)]
|
||||
[MaxLength(256)]
|
||||
public string? Value { get; set; }
|
||||
|
||||
|
||||
35
Admin.NET/Admin.NET.Core/Entity/SysConfigValue.cs
Normal file
35
Admin.NET/Admin.NET.Core/Entity/SysConfigValue.cs
Normal file
@ -0,0 +1,35 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统配置参数值表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统配置参数值表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(ConfigId), OrderByType.Asc)]
|
||||
public partial class SysConfigValue : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "配置Id")]
|
||||
public long ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 属性默认值
|
||||
/// </summary>
|
||||
[MaxLength(64)]
|
||||
[SugarColumn(ColumnDescription = "属性默认值", Length = 512)]
|
||||
public string? Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配置
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToOne, nameof(ConfigId))]
|
||||
public SysConfig Config { get; set; }
|
||||
}
|
||||
@ -541,6 +541,12 @@ public enum ErrorCodeEnum
|
||||
[ErrorCodeItemMetadata("禁止删除系统参数")]
|
||||
D9001,
|
||||
|
||||
/// <summary>
|
||||
/// 禁止越权操作系统内置参数
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("禁止越权操作系统内置参数")]
|
||||
D9002,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名任务调度
|
||||
/// </summary>
|
||||
|
||||
@ -114,6 +114,7 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
|
||||
new SysMenu{ Id=1310000000333, Pid=1310000000331, Title="编辑", Permission="sysConfig/update", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000334, Pid=1310000000331, Title="增加", Permission="sysConfig/add", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000335, Pid=1310000000331, Title="删除", Permission="sysConfig/delete", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000336, Pid=1310000000331, Title="更新默认值", Permission="sysConfig/updateDefault", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
|
||||
new SysMenu{ Id=1310000000341, Pid=1310000000301, Title="字典管理", Path="/platform/dict", Name="sysDict", Component="/system/dict/index", Icon="ele-Collection", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=130 },
|
||||
new SysMenu{ Id=1310000000342, Pid=1310000000341, Title="查询", Permission="sysDictType/page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
|
||||
@ -34,6 +34,15 @@ public class AddConfigInput : SysConfig
|
||||
|
||||
public class UpdateConfigInput : AddConfigInput
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class UpdateDefaultValueInput : BaseIdInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认属性值
|
||||
/// </summary>
|
||||
public string DefaultValue { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteConfigInput : BaseIdInput
|
||||
|
||||
15
Admin.NET/Admin.NET.Core/Service/Config/Dto/ConfigOutput.cs
Normal file
15
Admin.NET/Admin.NET.Core/Service/Config/Dto/ConfigOutput.cs
Normal file
@ -0,0 +1,15 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
public class ConfigOutput : SysConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认属性值
|
||||
/// </summary>
|
||||
public string DefaultValue { get; set; }
|
||||
}
|
||||
@ -12,14 +12,21 @@ namespace Admin.NET.Core.Service;
|
||||
[ApiDescriptionSettings(Order = 440, Description = "参数配置")]
|
||||
public class SysConfigService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly UserManager _userManager;
|
||||
private readonly SysCacheService _sysCacheService;
|
||||
private readonly SqlSugarRepository<SysConfig> _sysConfigRep;
|
||||
private readonly SqlSugarRepository<SysConfigValue> _sysConfigValueRep;
|
||||
|
||||
public SysConfigService(SysCacheService sysCacheService,
|
||||
public SysConfigService(
|
||||
UserManager userManager,
|
||||
SysCacheService sysCacheService,
|
||||
SqlSugarRepository<SysConfigValue> sysConfigValueRep,
|
||||
SqlSugarRepository<SysConfig> sysConfigRep)
|
||||
{
|
||||
_sysConfigValueRep = sysConfigValueRep;
|
||||
_sysCacheService = sysCacheService;
|
||||
_sysConfigRep = sysConfigRep;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -28,9 +35,10 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取参数配置分页列表")]
|
||||
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigInput input)
|
||||
public async Task<SqlSugarPagedList<ConfigOutput>> Page(PageConfigInput input)
|
||||
{
|
||||
return await _sysConfigRep.AsQueryable()
|
||||
var query = await GetConfigQueryable();
|
||||
return await query.WhereIF(!_userManager.SuperAdmin, u => u.SysFlag == YesNoEnum.N)
|
||||
.Where(u => u.GroupCode != ConfigConst.SysWebConfigGroup || u.GroupCode == null) // 不显示 WebConfig 分组
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name?.Trim()), u => u.Name.Contains(input.Name))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Code?.Trim()), u => u.Code.Contains(input.Code))
|
||||
@ -44,10 +52,10 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取参数配置列表")]
|
||||
public async Task<List<SysConfig>> List(PageConfigInput input)
|
||||
public async Task<List<ConfigOutput>> List(PageConfigInput input)
|
||||
{
|
||||
return await _sysConfigRep.AsQueryable()
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
|
||||
var query = await GetConfigQueryable();
|
||||
return await query.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
@ -60,9 +68,9 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
[DisplayName("增加参数配置")]
|
||||
public async Task AddConfig(AddConfigInput input)
|
||||
{
|
||||
if (input.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D9002);
|
||||
var isExist = await _sysConfigRep.IsAnyAsync(u => u.Name == input.Name || u.Code == input.Code);
|
||||
if (isExist) throw Oops.Oh(ErrorCodeEnum.D9000);
|
||||
|
||||
await _sysConfigRep.InsertAsync(input.Adapt<SysConfig>());
|
||||
}
|
||||
|
||||
@ -76,6 +84,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
[UnitOfWork]
|
||||
public async Task UpdateConfig(UpdateConfigInput input)
|
||||
{
|
||||
if (input.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D9002);
|
||||
var isExist = await _sysConfigRep.IsAnyAsync(u => (u.Name == input.Name || u.Code == input.Code) && u.Id != input.Id);
|
||||
if (isExist) throw Oops.Oh(ErrorCodeEnum.D9000);
|
||||
|
||||
@ -92,8 +101,49 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
//}
|
||||
|
||||
var config = input.Adapt<SysConfig>();
|
||||
await _sysConfigRep.AsUpdateable(config).IgnoreColumns(true).ExecuteCommandAsync();
|
||||
if (input.SysFlag != YesNoEnum.Y)
|
||||
{
|
||||
config.Value = null;
|
||||
var tenantId = _userManager.TenantId;
|
||||
if (tenantId <= 0) tenantId = SqlSugarConst.DefaultTenantId;
|
||||
var configValue = await _sysConfigValueRep.AsQueryable().ClearFilter().Where(u => u.TenantId == tenantId).SingleAsync(u => u.ConfigId == config.Id);
|
||||
if (configValue == null)
|
||||
{
|
||||
await _sysConfigValueRep.InsertAsync(new SysConfigValue()
|
||||
{
|
||||
ConfigId = config.Id,
|
||||
Value = input.Value
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
configValue.Value = input.Value;
|
||||
await _sysConfigValueRep.UpdateAsync(configValue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await _sysConfigValueRep.DeleteAsync(u => u.ConfigId == config.Id);
|
||||
}
|
||||
// 非超管用户仅修改参数值
|
||||
if (_userManager.SuperAdmin) await _sysConfigRep.AsUpdateable(config).IgnoreColumnsIF(input.SysFlag != YesNoEnum.Y, u => u.Value).ExecuteCommandAsync();
|
||||
RemoveConfigCache(config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新参数默认值 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "UpdateDefault"), HttpPost]
|
||||
[DisplayName("更新参数默认值")]
|
||||
[UnitOfWork]
|
||||
public async Task UpdateDefaultConfig(UpdateDefaultValueInput input)
|
||||
{
|
||||
var config = await _sysConfigRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||
if (config.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D9002);
|
||||
config.Value = input.DefaultValue;
|
||||
await _sysConfigRep.UpdateAsync(config);
|
||||
RemoveConfigCache(config);
|
||||
}
|
||||
|
||||
@ -111,6 +161,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
if (config.SysFlag == YesNoEnum.Y) throw Oops.Oh(ErrorCodeEnum.D9001);
|
||||
|
||||
await _sysConfigRep.DeleteAsync(config);
|
||||
await _sysConfigValueRep.DeleteAsync(u => u.ConfigId == config.Id);
|
||||
|
||||
RemoveConfigCache(config);
|
||||
}
|
||||
@ -131,6 +182,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
if (config.SysFlag == YesNoEnum.Y) continue;
|
||||
|
||||
await _sysConfigRep.DeleteAsync(config);
|
||||
await _sysConfigValueRep.DeleteAsync(u => u.ConfigId == id);
|
||||
|
||||
RemoveConfigCache(config);
|
||||
}
|
||||
@ -155,7 +207,8 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
[NonAction]
|
||||
public async Task<SysConfig> GetConfig(string code)
|
||||
{
|
||||
return await _sysConfigRep.GetFirstAsync(u => u.Code == code);
|
||||
var query = await GetConfigQueryable();
|
||||
return await query.FirstAsync(u => u.Code == code);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -182,8 +235,9 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
var value = _sysCacheService.Get<string>($"{CacheConst.KeyConfig}{code}");
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
var config = await _sysConfigRep.CopyNew().GetFirstAsync(u => u.Code == code);
|
||||
value = config != null ? config.Value : default;
|
||||
var query = await GetConfigQueryable();
|
||||
var config = await query.FirstAsync(u => u.Code == code);
|
||||
value = config?.Value;
|
||||
_sysCacheService.Set($"{CacheConst.KeyConfig}{code}", value);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(value)) return default;
|
||||
@ -203,7 +257,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
if (config == null) return;
|
||||
|
||||
config.Value = value;
|
||||
await _sysConfigRep.AsUpdateable(config).ExecuteCommandAsync();
|
||||
await UpdateConfig(config.Adapt<UpdateConfigInput>());
|
||||
|
||||
RemoveConfigCache(config);
|
||||
}
|
||||
@ -215,7 +269,8 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
[DisplayName("获取分组列表")]
|
||||
public async Task<List<string>> GetGroupList()
|
||||
{
|
||||
return await _sysConfigRep.AsQueryable()
|
||||
var query = await GetConfigQueryable();
|
||||
return await query
|
||||
.Where(u => u.GroupCode != ConfigConst.SysWebConfigGroup || u.GroupCode == null) // 不显示 WebConfig 分组
|
||||
.GroupBy(u => u.GroupCode)
|
||||
.Select(u => u.GroupCode).ToListAsync();
|
||||
@ -259,11 +314,45 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
var configInfo = await _sysConfigRep.GetFirstAsync(u => u.Code == config.Code);
|
||||
if (configInfo == null) continue;
|
||||
|
||||
await _sysConfigRep.AsUpdateable().SetColumns(u => u.Value == config.Value).Where(u => u.Code == config.Code).ExecuteCommandAsync();
|
||||
configInfo.Value = config.Value;
|
||||
await UpdateConfig(configInfo.Adapt<UpdateConfigInput>());
|
||||
RemoveConfigCache(configInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取参数配置查询器
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public Task<ISugarQueryable<ConfigOutput>> GetConfigQueryable()
|
||||
{
|
||||
var tenantId = _userManager.TenantId;
|
||||
if (_userManager.TenantId <= 0) tenantId = SqlSugarConst.DefaultTenantId;
|
||||
return Task.FromResult(
|
||||
_sysConfigRep.AsQueryable()
|
||||
.LeftJoin<SysConfigValue>((u, w) => u.Id == w.ConfigId).ClearFilter()
|
||||
.Where((u, w) => w.TenantId == null || w.TenantId == tenantId)
|
||||
.Select((u, w) => new ConfigOutput
|
||||
{
|
||||
Id = u.Id,
|
||||
Name = u.Name,
|
||||
Code = u.Code,
|
||||
GroupCode = u.GroupCode,
|
||||
SysFlag = u.SysFlag,
|
||||
Remark = u.Remark,
|
||||
DefaultValue = u.Value,
|
||||
Value = w.Value ?? u.Value,
|
||||
CreateTime = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.CreateTime, w.CreateTime),
|
||||
UpdateTime = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.UpdateTime, w.UpdateTime),
|
||||
CreateUserId = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.CreateUserId, w.CreateUserId),
|
||||
CreateUserName = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.CreateUserName, w.CreateUserName),
|
||||
UpdateUserId = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.UpdateUserId, w.UpdateUserId),
|
||||
UpdateUserName = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.UpdateUserName, w.UpdateUserName),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除配置缓存
|
||||
/// </summary>
|
||||
|
||||
@ -11,22 +11,22 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import { Configuration } from '../configuration';
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
||||
import { AddConfigInput } from '../models';
|
||||
import { AdminResultListConfigOutput } from '../models';
|
||||
import { AdminResultListString } from '../models';
|
||||
import { AdminResultListSysConfig } from '../models';
|
||||
import { AdminResultSqlSugarPagedListSysConfig } from '../models';
|
||||
import { AdminResultSqlSugarPagedListConfigOutput } from '../models';
|
||||
import { AdminResultString } from '../models';
|
||||
import { AdminResultSysConfig } from '../models';
|
||||
import { BatchConfigInput } from '../models';
|
||||
import { DeleteConfigInput } from '../models';
|
||||
import { PageConfigInput } from '../models';
|
||||
import { UpdateConfigInput } from '../models';
|
||||
import { UpdateDefaultValueInput } from '../models';
|
||||
/**
|
||||
* SysConfigApi - axios parameter creator
|
||||
* @export
|
||||
@ -465,6 +465,54 @@ export const SysConfigApiAxiosParamCreator = function (configuration?: Configura
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数默认值 🔖
|
||||
* @param {UpdateDefaultValueInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysConfigUpdateDefaultPost: async (body?: UpdateDefaultValueInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysConfig/updateDefault`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数配置 🔖
|
||||
@ -626,7 +674,7 @@ export const SysConfigApiFp = function(configuration?: Configuration) {
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysConfig>>> {
|
||||
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListConfigOutput>>> {
|
||||
const localVarAxiosArgs = await SysConfigApiAxiosParamCreator(configuration).apiSysConfigListPost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
@ -640,13 +688,27 @@ export const SysConfigApiFp = function(configuration?: Configuration) {
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysConfig>>> {
|
||||
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListConfigOutput>>> {
|
||||
const localVarAxiosArgs = await SysConfigApiAxiosParamCreator(configuration).apiSysConfigPagePost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数默认值 🔖
|
||||
* @param {UpdateDefaultValueInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysConfigUpdateDefaultPost(body?: UpdateDefaultValueInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysConfigApiAxiosParamCreator(configuration).apiSysConfigUpdateDefaultPost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数配置 🔖
|
||||
@ -746,7 +808,7 @@ export const SysConfigApiFactory = function (configuration?: Configuration, base
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysConfig>> {
|
||||
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListConfigOutput>> {
|
||||
return SysConfigApiFp(configuration).apiSysConfigListPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
@ -756,9 +818,19 @@ export const SysConfigApiFactory = function (configuration?: Configuration, base
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysConfig>> {
|
||||
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListConfigOutput>> {
|
||||
return SysConfigApiFp(configuration).apiSysConfigPagePost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数默认值 🔖
|
||||
* @param {UpdateDefaultValueInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysConfigUpdateDefaultPost(body?: UpdateDefaultValueInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysConfigApiFp(configuration).apiSysConfigUpdateDefaultPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数配置 🔖
|
||||
@ -863,7 +935,7 @@ export class SysConfigApi extends BaseAPI {
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysConfigApi
|
||||
*/
|
||||
public async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysConfig>> {
|
||||
public async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListConfigOutput>> {
|
||||
return SysConfigApiFp(this.configuration).apiSysConfigListPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
@ -874,9 +946,20 @@ export class SysConfigApi extends BaseAPI {
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysConfigApi
|
||||
*/
|
||||
public async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysConfig>> {
|
||||
public async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListConfigOutput>> {
|
||||
return SysConfigApiFp(this.configuration).apiSysConfigPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数默认值 🔖
|
||||
* @param {UpdateDefaultValueInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysConfigApi
|
||||
*/
|
||||
public async apiSysConfigUpdateDefaultPost(body?: UpdateDefaultValueInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysConfigApiFp(this.configuration).apiSysConfigUpdateDefaultPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 更新参数配置 🔖
|
||||
|
||||
@ -11,61 +11,47 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { SysConfig } from './sys-config';
|
||||
/**
|
||||
import { ConfigOutput } from './config-output';
|
||||
/**
|
||||
* 全局返回结果
|
||||
*
|
||||
* @export
|
||||
* @interface AdminResultListSysConfig
|
||||
* @interface AdminResultListConfigOutput
|
||||
*/
|
||||
export interface AdminResultListSysConfig {
|
||||
|
||||
export interface AdminResultListConfigOutput {
|
||||
/**
|
||||
* 状态码
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AdminResultListSysConfig
|
||||
* @memberof AdminResultListConfigOutput
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* 类型success、warning、error
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultListSysConfig
|
||||
* @memberof AdminResultListConfigOutput
|
||||
*/
|
||||
type?: string | null;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultListSysConfig
|
||||
* @memberof AdminResultListConfigOutput
|
||||
*/
|
||||
message?: string | null;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*
|
||||
* @type {Array<SysConfig>}
|
||||
* @memberof AdminResultListSysConfig
|
||||
* @type {Array<ConfigOutput>}
|
||||
* @memberof AdminResultListConfigOutput
|
||||
*/
|
||||
result?: Array<SysConfig> | null;
|
||||
|
||||
result?: Array<ConfigOutput> | null;
|
||||
/**
|
||||
* 附加数据
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof AdminResultListSysConfig
|
||||
* @memberof AdminResultListConfigOutput
|
||||
*/
|
||||
extras?: any | null;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AdminResultListSysConfig
|
||||
* @memberof AdminResultListConfigOutput
|
||||
*/
|
||||
time?: Date;
|
||||
}
|
||||
@ -11,59 +11,47 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { SqlSugarPagedListSysConfig } from './sql-sugar-paged-list-sys-config';
|
||||
/**
|
||||
import { SqlSugarPagedListConfigOutput } from './sql-sugar-paged-list-config-output';
|
||||
/**
|
||||
* 全局返回结果
|
||||
*
|
||||
* @export
|
||||
* @interface AdminResultSqlSugarPagedListSysConfig
|
||||
* @interface AdminResultSqlSugarPagedListConfigOutput
|
||||
*/
|
||||
export interface AdminResultSqlSugarPagedListSysConfig {
|
||||
|
||||
export interface AdminResultSqlSugarPagedListConfigOutput {
|
||||
/**
|
||||
* 状态码
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AdminResultSqlSugarPagedListSysConfig
|
||||
* @memberof AdminResultSqlSugarPagedListConfigOutput
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* 类型success、warning、error
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultSqlSugarPagedListSysConfig
|
||||
* @memberof AdminResultSqlSugarPagedListConfigOutput
|
||||
*/
|
||||
type?: string | null;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultSqlSugarPagedListSysConfig
|
||||
* @memberof AdminResultSqlSugarPagedListConfigOutput
|
||||
*/
|
||||
message?: string | null;
|
||||
|
||||
/**
|
||||
* @type {SqlSugarPagedListSysConfig}
|
||||
* @memberof AdminResultSqlSugarPagedListSysConfig
|
||||
*
|
||||
* @type {SqlSugarPagedListConfigOutput}
|
||||
* @memberof AdminResultSqlSugarPagedListConfigOutput
|
||||
*/
|
||||
result?: SqlSugarPagedListSysConfig;
|
||||
|
||||
result?: SqlSugarPagedListConfigOutput;
|
||||
/**
|
||||
* 附加数据
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof AdminResultSqlSugarPagedListSysConfig
|
||||
* @memberof AdminResultSqlSugarPagedListConfigOutput
|
||||
*/
|
||||
extras?: any | null;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AdminResultSqlSugarPagedListSysConfig
|
||||
* @memberof AdminResultSqlSugarPagedListConfigOutput
|
||||
*/
|
||||
time?: Date;
|
||||
}
|
||||
117
Web/src/api-services/models/config-output.ts
Normal file
117
Web/src/api-services/models/config-output.ts
Normal file
@ -0,0 +1,117 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
import { YesNoEnum } from './yes-no-enum';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ConfigOutput
|
||||
*/
|
||||
export interface ConfigOutput {
|
||||
/**
|
||||
* 雪花Id
|
||||
* @type {number}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
* 创建时间
|
||||
* @type {Date}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
createTime?: Date;
|
||||
/**
|
||||
* 更新时间
|
||||
* @type {Date}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
updateTime?: Date | null;
|
||||
/**
|
||||
* 创建者Id
|
||||
* @type {number}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
createUserId?: number | null;
|
||||
/**
|
||||
* 创建者姓名
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
createUserName?: string | null;
|
||||
/**
|
||||
* 修改者Id
|
||||
* @type {number}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
updateUserId?: number | null;
|
||||
/**
|
||||
* 修改者姓名
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
updateUserName?: string | null;
|
||||
/**
|
||||
* 软删除
|
||||
* @type {boolean}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
isDelete?: boolean;
|
||||
/**
|
||||
* 名称
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 编码
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
code?: string | null;
|
||||
/**
|
||||
* 属性值
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
value?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {YesNoEnum}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
sysFlag?: YesNoEnum;
|
||||
/**
|
||||
* 分组编码
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
groupCode?: string | null;
|
||||
/**
|
||||
* 排序
|
||||
* @type {number}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
orderNo?: number;
|
||||
/**
|
||||
* 备注
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
remark?: string | null;
|
||||
/**
|
||||
* 默认属性值
|
||||
* @type {string}
|
||||
* @memberof ConfigOutput
|
||||
*/
|
||||
defaultValue?: string | null;
|
||||
}
|
||||
@ -38,6 +38,7 @@ export * from './admin-result-jobject';
|
||||
export * from './admin-result-list-api-output';
|
||||
export * from './admin-result-list-code-gen-config';
|
||||
export * from './admin-result-list-column-ouput';
|
||||
export * from './admin-result-list-config-output';
|
||||
export * from './admin-result-list-const-output';
|
||||
export * from './admin-result-list-database-output';
|
||||
export * from './admin-result-list-db-backup-output';
|
||||
@ -55,7 +56,6 @@ export * from './admin-result-list-role-table-output';
|
||||
export * from './admin-result-list-stat-log-output';
|
||||
export * from './admin-result-list-string';
|
||||
export * from './admin-result-list-sys-code-gen-template';
|
||||
export * from './admin-result-list-sys-config';
|
||||
export * from './admin-result-list-sys-dict-data';
|
||||
export * from './admin-result-list-sys-dict-type';
|
||||
export * from './admin-result-list-sys-file';
|
||||
@ -77,13 +77,13 @@ export * from './admin-result-login-output';
|
||||
export * from './admin-result-login-user-output';
|
||||
export * from './admin-result-object';
|
||||
export * from './admin-result-sm-key-pair-output';
|
||||
export * from './admin-result-sql-sugar-paged-list-config-output';
|
||||
export * from './admin-result-sql-sugar-paged-list-job-detail-output';
|
||||
export * from './admin-result-sql-sugar-paged-list-oauth-user-output';
|
||||
export * from './admin-result-sql-sugar-paged-list-open-access-output';
|
||||
export * from './admin-result-sql-sugar-paged-list-page-pos-output';
|
||||
export * from './admin-result-sql-sugar-paged-list-page-role-output';
|
||||
export * from './admin-result-sql-sugar-paged-list-sys-code-gen';
|
||||
export * from './admin-result-sql-sugar-paged-list-sys-config';
|
||||
export * from './admin-result-sql-sugar-paged-list-sys-dict-data';
|
||||
export * from './admin-result-sql-sugar-paged-list-sys-dict-type';
|
||||
export * from './admin-result-sql-sugar-paged-list-sys-file';
|
||||
@ -147,6 +147,7 @@ export * from './code-gen-type-enum';
|
||||
export * from './column-ouput';
|
||||
export * from './column-relation';
|
||||
export * from './compare-info';
|
||||
export * from './config-output';
|
||||
export * from './const-output';
|
||||
export * from './constructor-info';
|
||||
export * from './create-entity-input';
|
||||
@ -334,13 +335,13 @@ export * from './signature-input';
|
||||
export * from './sm-key-pair-output';
|
||||
export * from './sms-verify-code-input';
|
||||
export * from './sort-version';
|
||||
export * from './sql-sugar-paged-list-config-output';
|
||||
export * from './sql-sugar-paged-list-job-detail-output';
|
||||
export * from './sql-sugar-paged-list-oauth-user-output';
|
||||
export * from './sql-sugar-paged-list-open-access-output';
|
||||
export * from './sql-sugar-paged-list-page-pos-output';
|
||||
export * from './sql-sugar-paged-list-page-role-output';
|
||||
export * from './sql-sugar-paged-list-sys-code-gen';
|
||||
export * from './sql-sugar-paged-list-sys-config';
|
||||
export * from './sql-sugar-paged-list-sys-dict-data';
|
||||
export * from './sql-sugar-paged-list-sys-dict-type';
|
||||
export * from './sql-sugar-paged-list-sys-file';
|
||||
@ -429,6 +430,7 @@ export * from './update-code-gen-input';
|
||||
export * from './update-config-input';
|
||||
export * from './update-db-column-input';
|
||||
export * from './update-db-table-input';
|
||||
export * from './update-default-value-input';
|
||||
export * from './update-dict-data-input';
|
||||
export * from './update-dict-type-input';
|
||||
export * from './update-job-detail-input';
|
||||
|
||||
@ -11,69 +11,53 @@
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { SysConfig } from './sys-config';
|
||||
/**
|
||||
import { ConfigOutput } from './config-output';
|
||||
/**
|
||||
* 分页泛型集合
|
||||
*
|
||||
* @export
|
||||
* @interface SqlSugarPagedListSysConfig
|
||||
* @interface SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
export interface SqlSugarPagedListSysConfig {
|
||||
|
||||
export interface SqlSugarPagedListConfigOutput {
|
||||
/**
|
||||
* 页码
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SqlSugarPagedListSysConfig
|
||||
* @memberof SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
page?: number;
|
||||
|
||||
/**
|
||||
* 页容量
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SqlSugarPagedListSysConfig
|
||||
* @memberof SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
pageSize?: number;
|
||||
|
||||
/**
|
||||
* 总条数
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SqlSugarPagedListSysConfig
|
||||
* @memberof SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
total?: number;
|
||||
|
||||
/**
|
||||
* 总页数
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SqlSugarPagedListSysConfig
|
||||
* @memberof SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
totalPages?: number;
|
||||
|
||||
/**
|
||||
* 当前页集合
|
||||
*
|
||||
* @type {Array<SysConfig>}
|
||||
* @memberof SqlSugarPagedListSysConfig
|
||||
* @type {Array<ConfigOutput>}
|
||||
* @memberof SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
items?: Array<SysConfig> | null;
|
||||
|
||||
items?: Array<ConfigOutput> | null;
|
||||
/**
|
||||
* 是否有上一页
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof SqlSugarPagedListSysConfig
|
||||
* @memberof SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
hasPrevPage?: boolean;
|
||||
|
||||
/**
|
||||
* 是否有下一页
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof SqlSugarPagedListSysConfig
|
||||
* @memberof SqlSugarPagedListConfigOutput
|
||||
*/
|
||||
hasNextPage?: boolean;
|
||||
}
|
||||
32
Web/src/api-services/models/update-default-value-input.ts
Normal file
32
Web/src/api-services/models/update-default-value-input.ts
Normal file
@ -0,0 +1,32 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UpdateDefaultValueInput
|
||||
*/
|
||||
export interface UpdateDefaultValueInput {
|
||||
/**
|
||||
* 主键Id
|
||||
* @type {number}
|
||||
* @memberof UpdateDefaultValueInput
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* 默认属性值
|
||||
* @type {string}
|
||||
* @memberof UpdateDefaultValueInput
|
||||
*/
|
||||
defaultValue?: string | null;
|
||||
}
|
||||
@ -34,3 +34,8 @@
|
||||
--w-e-modal-button-bg-color: var(--el-color-primary) !important;
|
||||
--w-e-modal-button-border-color: var(--el-color-primary) !important;
|
||||
}
|
||||
|
||||
// 解决vxe-grid组件滚动条问题
|
||||
.vxe-grid--layout-body-wrapper .vxe-grid--layout-body-content-wrapper {
|
||||
overflow: hidden;
|
||||
}
|
||||
2
Web/src/views/system/cache/index.vue
vendored
2
Web/src/views/system/cache/index.vue
vendored
@ -6,7 +6,7 @@
|
||||
|
||||
<splitpanes>
|
||||
<pane size="20">
|
||||
<el-card shadow="hover" header="缓存列表" v-loading="state.loading" style="height: 100%" body-style="height:100%; overflow:auto">
|
||||
<el-card shadow="hover" header="缓存列表" v-loading="state.loading" style="height: 100%" body-style="height: calc(100% - 60px); overflow:auto">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>缓存列表</span>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
</el-space>
|
||||
</template> -->
|
||||
</el-input>
|
||||
<span v-if="state.ruleForm.id > 0">默认值:{{ state.ruleForm.defaultValue }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
@ -82,6 +83,7 @@
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button icon="ele-CircleCloseFilled" @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" icon="ele-CircleCheckFilled" v-if="state.ruleForm.id > 0" v-auth="'sysConfig/updateDefault'" @click="updateDefault">更新默认值</el-button>
|
||||
<el-button type="primary" icon="ele-CircleCheckFilled" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
@ -91,10 +93,10 @@
|
||||
|
||||
<script lang="ts" setup name="sysEditConfig">
|
||||
import { reactive, ref } from 'vue';
|
||||
|
||||
import { ElMessage } from "element-plus";
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysConfigApi } from '/@/api-services/api';
|
||||
import { UpdateConfigInput } from '/@/api-services/models';
|
||||
import { ConfigOutput } from "/@/api-services/models";
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
@ -103,7 +105,7 @@ const emits = defineEmits(['updateData']);
|
||||
const ruleFormRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
ruleForm: {} as UpdateConfigInput,
|
||||
ruleForm: {} as ConfigOutput,
|
||||
});
|
||||
|
||||
// 打开弹窗
|
||||
@ -124,6 +126,16 @@ const cancel = () => {
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
|
||||
// 更新默认值
|
||||
const updateDefault = () => {
|
||||
getAPI(SysConfigApi).apiSysConfigUpdateDefaultPost({
|
||||
id: state.ruleForm.id,
|
||||
defaultValue: state.ruleForm.value
|
||||
} as any).then((res: any) => {
|
||||
if (res.data.code == 200) ElMessage.success('更新成功');
|
||||
});
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
ruleFormRef.value.validate(async (valid: boolean) => {
|
||||
|
||||
@ -411,7 +411,4 @@ const updateDictSession = async () => {
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
:deep(.vxe-grid--layout-body-wrapper .vxe-grid--layout-body-content-wrapper) {
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user