完成字典、字典类型管理相关

This commit is contained in:
橙子
2023-02-05 15:17:11 +08:00
parent b01d242cbc
commit 95484877a3
51 changed files with 1388 additions and 76 deletions

View File

@@ -28,17 +28,17 @@ namespace Yi.Framework.Core.Sqlsugar.Repositories
public async Task<List<T>> GetPageListAsync(Expression<Func<T, bool>> whereExpression, IPagedAndSortedResultRequestDto page)
{
return await base.GetPageListAsync(whereExpression, new PageModel { PageIndex = page.PageIndex, PageSize = page.PageSize });
return await base.GetPageListAsync(whereExpression, new PageModel { PageIndex = page.PageNum, PageSize = page.PageSize });
}
public async Task<List<T>> GetPageListAsync(Expression<Func<T, bool>> whereExpression, IPagedAndSortedResultRequestDto page, Expression<Func<T, object>>? orderByExpression = null, OrderByEnum orderByType = OrderByEnum.Asc)
{
return await base.GetPageListAsync(whereExpression, new PageModel { PageIndex = page.PageIndex, PageSize = page.PageSize }, orderByExpression, orderByType.EnumToEnum<OrderByType>());
return await base.GetPageListAsync(whereExpression, new PageModel { PageIndex = page.PageNum, PageSize = page.PageSize }, orderByExpression, orderByType.EnumToEnum<OrderByType>());
}
public async Task<List<T>> GetPageListAsync(Expression<Func<T, bool>> whereExpression, IPagedAndSortedResultRequestDto page, string? orderBy, OrderByEnum orderByType = OrderByEnum.Asc)
{
return await _DbQueryable.Where(whereExpression).OrderByIF(orderBy is not null, orderBy + " " + orderByType.ToString().ToLower()).ToPageListAsync(page.PageIndex, page.PageSize);
return await _DbQueryable.Where(whereExpression).OrderByIF(orderBy is not null, orderBy + " " + orderByType.ToString().ToLower()).ToPageListAsync(page.PageNum, page.PageSize);
}

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SqlSugarCore" Version="5.1.3.46-preview11" />
<PackageReference Include="SqlSugarCore" Version="5.1.3.49" />
</ItemGroup>
<ItemGroup>

View File

@@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.3.46-preview11" />
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.3.50-preview01" />
<PackageReference Include="StartupModules" Version="4.0.0" />
</ItemGroup>

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Data.Auditing
{
public class AuditedObject : IAuditedObject
{
public DateTime CreationTime { get; set; }= DateTime.Now;
public long? CreatorId { get; set; }
public long? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}

View File

@@ -8,6 +8,6 @@ namespace Yi.Framework.Data.Entities
{
public interface IState
{
public bool State { get; set; }
public bool? State { get; set; }
}
}

View File

@@ -9,7 +9,7 @@ namespace Yi.Framework.Ddd.Dtos
{
public interface IPagedAndSortedResultRequestDto
{
int PageIndex { get; set; }
int PageNum { get; set; }
int PageSize { get; set; }
string? SortBy { get; set; }

View File

@@ -9,7 +9,7 @@ namespace Yi.Framework.Ddd.Dtos
{
public class PagedAndSortedResultRequestDto : IPagedAndSortedResultRequestDto
{
public int PageIndex { get; set; } = 1;
public int PageNum { get; set; } = 1;
public int PageSize { get; set; } = int.MaxValue;
public string? SortBy { get; set; }
public OrderByEnum SortType { get; set; } = OrderByEnum.Desc;

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Ddd.Dtos
{
public class PagedDto<T>
{
public PagedDto(long totalCount, List<T> items)
{
Total = totalCount;
Items = items;
}
public long Total { get; set; }
public List<T> Items{ get; set; }
}
}

View File

@@ -14,10 +14,13 @@ TemplateFactory templateFactory = new();
//string modelName = "Exhibition";
//string nameSpaces = "Yi.BBS";
//List<string> entityNames = new() { "Banner" };
string modelName = "Identity";
//string modelName = "Identity";
//string nameSpaces = "Yi.RBAC";
//List<string> entityNames = new() { "_" };
string modelName = "Dictionary";
string nameSpaces = "Yi.RBAC";
List<string> entityNames = new() { "_" };
List<string> entityNames = new() { "_", "_" };

View File

@@ -4,6 +4,26 @@
<name>Yi.RBAC.Application.Contracts</name>
</assembly>
<members>
<member name="T:Yi.RBAC.Application.Contracts.Dictionary.Dtos.DictionaryTypeCreateInputVo">
<summary>
DictionaryType输入创建对象
</summary>
</member>
<member name="T:Yi.RBAC.Application.Contracts.Dictionary.Dtos.DictionaryCreateInputVo">
<summary>
Dictionary输入创建对象
</summary>
</member>
<member name="T:Yi.RBAC.Application.Contracts.Dictionary.IDictionaryService">
<summary>
Dictionary服务抽象
</summary>
</member>
<member name="T:Yi.RBAC.Application.Contracts.Dictionary.IDictionaryTypeService">
<summary>
DictionaryType服务抽象
</summary>
</member>
<member name="T:Yi.RBAC.Application.Contracts.Identity.Dtos.DeptCreateInputVo">
<summary>
Dept输入创建对象

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
/// <summary>
/// Dictionary输入创建对象
/// </summary>
public class DictionaryCreateInputVo
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string? Remark { get; set; }
public string? ListClass { get; set; }
public string? CssClass { get; set; }
public string DictType { get; set; } = string.Empty;
public string? DictLabel { get; set; }
public string DictValue { get; set; } = string.Empty;
public bool IsDefault { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryGetListInputVo : PagedAndSortedResultRequestDto
{
public string? DictType { get; set; }
public string? DictLabel { get; set; }
public bool? State { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string? Remark { get; set; }
public string? ListClass { get; set; }
public string? CssClass { get; set; }
public string DictType { get; set; } = string.Empty;
public string? DictLabel { get; set; }
public string DictValue { get; set; } = string.Empty;
public bool IsDefault { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string? Remark { get; set; }
public string? ListClass { get; set; }
public string? CssClass { get; set; }
public string DictType { get; set; } = string.Empty;
public string? DictLabel { get; set; }
public string DictValue { get; set; } = string.Empty;
public bool IsDefault { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryUpdateInputVo
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string? Remark { get; set; }
public string? ListClass { get; set; }
public string? CssClass { get; set; }
public string DictType { get; set; } = string.Empty;
public string? DictLabel { get; set; }
public string DictValue { get; set; } = string.Empty;
public bool IsDefault { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
/// <summary>
/// DictionaryType输入创建对象
/// </summary>
public class DictionaryTypeCreateInputVo
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string DictName { get; set; } = string.Empty;
public string DictType { get; set; } = string.Empty;
public string? Remark { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryTypeGetListInputVo : PagedAllResultRequestDto
{
public string? DictName { get; set; }
public string? DictType { get; set; }
public string? Remark { get; set; }
public bool? State { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryTypeGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string DictName { get; set; } = string.Empty;
public string DictType { get; set; } = string.Empty;
public string? Remark { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryTypeGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string DictName { get; set; } = string.Empty;
public string DictType { get; set; } = string.Empty;
public string? Remark { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Application.Contracts.Dictionary.Dtos
{
public class DictionaryTypeUpdateInputVo
{
public long Id { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public long? CreatorId { get; set; }
public string DictName { get; set; } = string.Empty;
public string DictType { get; set; } = string.Empty;
public string? Remark { get; set; }
public bool State { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
using Yi.Framework.Ddd.Services.Abstract;
namespace Yi.RBAC.Application.Contracts.Dictionary
{
/// <summary>
/// Dictionary服务抽象
/// </summary>
public interface IDictionaryService : ICrudAppService<DictionaryGetOutputDto, DictionaryGetListOutputDto, long, DictionaryGetListInputVo, DictionaryCreateInputVo, DictionaryUpdateInputVo>
{
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
using Yi.Framework.Ddd.Services.Abstract;
namespace Yi.RBAC.Application.Contracts.Dictionary
{
/// <summary>
/// DictionaryType服务抽象
/// </summary>
public interface IDictionaryTypeService : ICrudAppService<DictionaryTypeGetOutputDto, DictionaryTypeGetListOutputDto, long, DictionaryTypeGetListInputVo, DictionaryTypeCreateInputVo, DictionaryTypeUpdateInputVo>
{
}
}

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Application.Contracts.Account.Dtos
namespace Yi.RBAC.Application.Contracts.Identity.Dtos.Account
{
public class LoginInputVo
{

View File

@@ -4,7 +4,29 @@
<name>Yi.RBAC.Application</name>
</assembly>
<members>
<member name="M:Yi.RBAC.Application.Identity.AccountService.PostLoginAsync(Yi.RBAC.Application.Contracts.Account.Dtos.LoginInputVo)">
<member name="T:Yi.RBAC.Application.Dictionary.DictionaryService">
<summary>
Dictionary服务实现
</summary>
</member>
<member name="P:Yi.RBAC.Application.Dictionary.DictionaryService._dictionaryRepository">
<summary>
查询
</summary>
</member>
<member name="M:Yi.RBAC.Application.Dictionary.DictionaryService.GetDicType(System.String)">
<summary>
根据字典类型获取字典列表
</summary>
<param name="dicType"></param>
<returns></returns>
</member>
<member name="T:Yi.RBAC.Application.Dictionary.DictionaryTypeService">
<summary>
DictionaryType服务实现
</summary>
</member>
<member name="M:Yi.RBAC.Application.Identity.AccountService.PostLoginAsync(Yi.RBAC.Application.Contracts.Identity.Dtos.Account.LoginInputVo)">
<summary>
登录
</summary>

View File

@@ -0,0 +1,48 @@
using Yi.RBAC.Application.Contracts.Dictionary;
using NET.AutoWebApi.Setting;
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.Framework.Ddd.Services;
using Microsoft.AspNetCore.Mvc;
using Yi.Framework.Ddd.Dtos;
using Yi.RBAC.Domain.Dictionary.Repositories;
namespace Yi.RBAC.Application.Dictionary
{
/// <summary>
/// Dictionary服务实现
/// </summary>
[AppService]
public class DictionaryService : CrudAppService<DictionaryEntity, DictionaryGetOutputDto, DictionaryGetListOutputDto, long, DictionaryGetListInputVo, DictionaryCreateInputVo, DictionaryUpdateInputVo>,
IDictionaryService, IAutoApiService
{
/// <summary>
/// 查询
/// </summary>
[Autowired]
private IDictionaryRepository _dictionaryRepository { get; set; }
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
{
var data = await _dictionaryRepository.SelectGetListAsync(await MapToEntityAsync(input), input);
return new PagedResultDto<DictionaryGetListOutputDto>
{
Total = data.Total,
Items = await MapToGetListOutputDtosAsync(data.Items)
};
}
/// <summary>
/// 根据字典类型获取字典列表
/// </summary>
/// <param name="dicType"></param>
/// <returns></returns>
[Route("/api/dictionary/dic-type/{dicType}")]
public async Task<List<DictionaryGetListOutputDto>> GetDicType([FromRoute] string dicType)
{
var entities = await _repository.GetListAsync(u => u.DictType == dicType && u.State == true);
var result = await MapToGetListOutputDtosAsync(entities);
return result;
}
}
}

View File

@@ -0,0 +1,33 @@
using Yi.RBAC.Application.Contracts.Dictionary;
using NET.AutoWebApi.Setting;
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.Framework.Ddd.Services;
using Yi.RBAC.Domain.Dictionary.Repositories;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Dictionary
{
/// <summary>
/// DictionaryType服务实现
/// </summary>
[AppService]
public class DictionaryTypeService : CrudAppService<DictionaryTypeEntity, DictionaryTypeGetOutputDto, DictionaryTypeGetListOutputDto, long, DictionaryTypeGetListInputVo, DictionaryTypeCreateInputVo, DictionaryTypeUpdateInputVo>,
IDictionaryTypeService, IAutoApiService
{
[Autowired]
private IDictionaryTypeRepository _dictionaryTypeRepository { get; set; }
public async override Task<PagedResultDto<DictionaryTypeGetListOutputDto>> GetListAsync(DictionaryTypeGetListInputVo input)
{
var data = await _dictionaryTypeRepository.SelectGetListAsync(await MapToEntityAsync(input), input);
return new PagedResultDto<DictionaryTypeGetListOutputDto>
{
Total = data.Total,
Items = await MapToGetListOutputDtosAsync(data.Items)
};
}
}
}

View File

@@ -0,0 +1,23 @@
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
using Yi.RBAC.Domain.Dictionary.Entities;
namespace Yi.RBAC.Application.Dictionary.MapperConfig
{
public class DictionaryProfile: Profile
{
public DictionaryProfile()
{
CreateMap<DictionaryGetListInputVo, DictionaryEntity>();
CreateMap<DictionaryCreateInputVo, DictionaryEntity>();
CreateMap<DictionaryUpdateInputVo, DictionaryEntity>();
CreateMap<DictionaryEntity, DictionaryGetListOutputDto>();
CreateMap<DictionaryEntity, DictionaryGetOutputDto>();
}
}
}

View File

@@ -0,0 +1,23 @@
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
using Yi.RBAC.Domain.Dictionary.Entities;
namespace Yi.RBAC.Application.Dictionary.MapperConfig
{
public class DictionaryTypeProfile: Profile
{
public DictionaryTypeProfile()
{
CreateMap<DictionaryTypeGetListInputVo, DictionaryTypeEntity>();
CreateMap<DictionaryTypeCreateInputVo, DictionaryTypeEntity>();
CreateMap<DictionaryTypeUpdateInputVo, DictionaryTypeEntity>();
CreateMap<DictionaryTypeEntity, DictionaryTypeGetListOutputDto>();
CreateMap<DictionaryTypeEntity, DictionaryTypeGetOutputDto>();
}
}
}

View File

@@ -17,7 +17,6 @@ using Yi.Framework.Core.Exceptions;
using Yi.Framework.Ddd.Repositories;
using Yi.Framework.Ddd.Services;
using Yi.Framework.ThumbnailSharp;
using Yi.RBAC.Application.Contracts.Account.Dtos;
using Yi.RBAC.Application.Contracts.Identity;
using Yi.RBAC.Application.Contracts.Identity.Dtos.Account;
using Yi.RBAC.Domain.Identity;

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Domain.Shared.Dictionary.ConstClasses
{
/// <summary>
/// 常量定义
/// </summary>
public class DictionaryConst
{
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Domain.Shared.Dictionary.ConstClasses
{
/// <summary>
/// 常量定义
/// </summary>
public class DictionaryTypeConst
{
}
}

View File

@@ -0,0 +1,369 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.DataSeeds;
using Yi.Framework.Ddd.Repositories;
using Yi.RBAC.Domain.Dictionary.Entities;
namespace Yi.RBAC.Domain.DataSeeds
{
[AppService(typeof(IDataSeed))]
public class DictionaryDataSeed : AbstractDataSeed<DictionaryEntity>
{
public DictionaryDataSeed(IRepository<DictionaryEntity> repository) : base(repository)
{
}
public override List<DictionaryEntity> GetSeedData()
{
List<DictionaryEntity> entities= new List<DictionaryEntity>();
DictionaryEntity dictInfo1 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "男",
DictValue = "0",
DictType = "sys_user_sex",
OrderNum = 100,
Remark = "性别男",
IsDeleted = false,
};
entities.Add(dictInfo1);
DictionaryEntity dictInfo2 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "女",
DictValue = "1",
DictType = "sys_user_sex",
OrderNum = 99,
Remark = "性别女",
IsDeleted = false,
};
entities.Add(dictInfo2);
DictionaryEntity dictInfo3 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "未知",
DictValue = "2",
DictType = "sys_user_sex",
OrderNum = 98,
Remark = "性别未知",
IsDeleted = false,
};
entities.Add(dictInfo3);
DictionaryEntity dictInfo4 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "显示",
DictValue = "true",
DictType = "sys_show_hide",
OrderNum = 100,
Remark = "显示菜单",
IsDeleted = false,
};
entities.Add(dictInfo4);
DictionaryEntity dictInfo5 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "隐藏",
DictValue = "false",
DictType = "sys_show_hide",
OrderNum = 99,
Remark = "隐藏菜单",
IsDeleted = false,
};
entities.Add(dictInfo5);
DictionaryEntity dictInfo6 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "正常",
DictValue = "true",
DictType = "sys_normal_disable",
OrderNum = 100,
Remark = "正常状态",
IsDeleted = false,
};
entities.Add(dictInfo6);
DictionaryEntity dictInfo7 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "停用",
DictValue = "false",
DictType = "sys_normal_disable",
OrderNum = 99,
Remark = "停用状态",
IsDeleted = false,
ListClass = "danger"
};
entities.Add(dictInfo7);
DictionaryEntity dictInfo8 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "正常",
DictValue = "0",
DictType = "sys_job_status",
OrderNum = 100,
Remark = "正常状态",
IsDeleted = false,
};
entities.Add(dictInfo8);
DictionaryEntity dictInfo9 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "暂停",
DictValue = "1",
DictType = "sys_job_status",
OrderNum = 99,
Remark = "停用状态",
IsDeleted = false,
ListClass = "danger"
};
entities.Add(dictInfo9);
DictionaryEntity dictInfo10 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "默认",
DictValue = "DEFAULT",
DictType = "sys_job_group",
OrderNum = 100,
Remark = "默认分组",
IsDeleted = false,
};
entities.Add(dictInfo10);
DictionaryEntity dictInfo11 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "系统",
DictValue = "SYSTEM",
DictType = "sys_job_group",
OrderNum = 99,
Remark = "系统分组",
IsDeleted = false,
};
entities.Add(dictInfo11);
DictionaryEntity dictInfo12 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "是",
DictValue = "Y",
DictType = "sys_yes_no",
OrderNum = 100,
Remark = "系统默认是",
IsDeleted = false,
};
entities.Add(dictInfo12);
DictionaryEntity dictInfo13 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "否",
DictValue = "N",
DictType = "sys_yes_no",
OrderNum = 99,
Remark = "系统默认否",
IsDeleted = false,
ListClass = "danger"
};
entities.Add(dictInfo13);
DictionaryEntity dictInfo14 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "通知",
DictValue = "1",
DictType = "sys_notice_type",
OrderNum = 100,
Remark = "通知",
IsDeleted = false,
};
entities.Add(dictInfo14);
DictionaryEntity dictInfo15 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "公告",
DictValue = "2",
DictType = "sys_notice_type",
OrderNum = 99,
Remark = "公告",
IsDeleted = false,
};
entities.Add(dictInfo15);
DictionaryEntity dictInfo16 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "正常",
DictValue = "0",
DictType = "sys_notice_status",
OrderNum = 100,
Remark = "正常状态",
IsDeleted = false,
};
entities.Add(dictInfo16);
DictionaryEntity dictInfo17 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "关闭",
DictValue = "1",
DictType = "sys_notice_status",
OrderNum = 99,
Remark = "关闭状态",
IsDeleted = false,
ListClass = "danger"
};
entities.Add(dictInfo17);
DictionaryEntity dictInfo18 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "新增",
DictValue = "1",
DictType = "sys_oper_type",
OrderNum = 100,
Remark = "新增操作",
IsDeleted = false,
};
entities.Add(dictInfo18);
DictionaryEntity dictInfo19 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "修改",
DictValue = "2",
DictType = "sys_oper_type",
OrderNum = 99,
Remark = "修改操作",
IsDeleted = false,
};
entities.Add(dictInfo19);
DictionaryEntity dictInfo22 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "删除",
DictValue = "3",
DictType = "sys_oper_type",
OrderNum = 98,
Remark = "删除操作",
IsDeleted = false,
ListClass = "danger"
};
entities.Add(dictInfo22);
DictionaryEntity dictInfo23 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "授权",
DictValue = "4",
DictType = "sys_oper_type",
OrderNum = 97,
Remark = "授权操作",
IsDeleted = false,
};
entities.Add(dictInfo23);
DictionaryEntity dictInfo24 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "导出",
DictValue = "5",
DictType = "sys_oper_type",
OrderNum = 96,
Remark = "导出操作",
IsDeleted = false,
};
entities.Add(dictInfo24);
DictionaryEntity dictInfo25 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "导入",
DictValue = "6",
DictType = "sys_oper_type",
OrderNum = 95,
Remark = "导入操作",
IsDeleted = false,
};
entities.Add(dictInfo25);
DictionaryEntity dictInfo26 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "强退",
DictValue = "7",
DictType = "sys_oper_type",
OrderNum = 94,
Remark = "强退操作",
IsDeleted = false,
};
entities.Add(dictInfo26);
DictionaryEntity dictInfo27 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "生成代码",
DictValue = "8",
DictType = "sys_oper_type",
OrderNum = 93,
Remark = "生成代码操作",
IsDeleted = false,
};
entities.Add(dictInfo27);
DictionaryEntity dictInfo28 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "清空数据",
DictValue = "9",
DictType = "sys_oper_type",
OrderNum = 92,
Remark = "清空数据操作",
IsDeleted = false,
ListClass = "danger"
};
entities.Add(dictInfo28);
DictionaryEntity dictInfo20 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "成功",
DictValue = "false",
DictType = "sys_common_status",
OrderNum = 100,
Remark = "正常状态",
IsDeleted = false,
};
entities.Add(dictInfo20);
DictionaryEntity dictInfo21 = new DictionaryEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictLabel = "失败",
DictValue = "true",
DictType = "sys_common_status",
OrderNum = 99,
Remark = "失败状态",
IsDeleted = false,
ListClass = "danger"
};
entities.Add(dictInfo21);
return entities;
}
}
}

View File

@@ -0,0 +1,135 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.DataSeeds;
using Yi.Framework.Ddd.Repositories;
using Yi.RBAC.Domain.Dictionary.Entities;
namespace Yi.RBAC.Domain.DataSeeds
{
[AppService(typeof(IDataSeed))]
public class DictionaryTypeDataSeed : AbstractDataSeed<DictionaryTypeEntity>
{
public DictionaryTypeDataSeed(IRepository<DictionaryTypeEntity> repository) : base(repository)
{
}
public override List<DictionaryTypeEntity> GetSeedData()
{
List<DictionaryTypeEntity> entities= new List<DictionaryTypeEntity>();
DictionaryTypeEntity dict1 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "用户性别",
DictType = "sys_user_sex",
OrderNum = 100,
Remark = "用户性别列表",
IsDeleted = false,
};
entities.Add(dict1);
DictionaryTypeEntity dict2 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "菜单状态",
DictType = "sys_show_hide",
OrderNum = 100,
Remark = "菜单状态列表",
IsDeleted = false,
};
entities.Add(dict2);
DictionaryTypeEntity dict3 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "系统开关",
DictType = "sys_normal_disable",
OrderNum = 100,
Remark = "系统开关列表",
IsDeleted = false,
};
entities.Add(dict3);
DictionaryTypeEntity dict4 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "任务状态",
DictType = "sys_job_status",
OrderNum = 100,
Remark = "任务状态列表",
IsDeleted = false,
};
entities.Add(dict4);
DictionaryTypeEntity dict5 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "任务分组",
DictType = "sys_job_group",
OrderNum = 100,
Remark = "任务分组列表",
IsDeleted = false,
};
entities.Add(dict5);
DictionaryTypeEntity dict6 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "系统是否",
DictType = "sys_yes_no",
OrderNum = 100,
Remark = "系统是否列表",
IsDeleted = false,
};
entities.Add(dict6);
DictionaryTypeEntity dict7 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "通知类型",
DictType = "sys_notice_type",
OrderNum = 100,
Remark = "通知类型列表",
IsDeleted = false,
};
entities.Add(dict7);
DictionaryTypeEntity dict8 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "通知状态",
DictType = "sys_notice_status",
OrderNum = 100,
Remark = "通知状态列表",
IsDeleted = false,
};
entities.Add(dict8);
DictionaryTypeEntity dict9 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "操作类型",
DictType = "sys_oper_type",
OrderNum = 100,
Remark = "操作类型列表",
IsDeleted = false,
};
entities.Add(dict9);
DictionaryTypeEntity dict10 = new DictionaryTypeEntity()
{
Id = SnowFlakeSingle.Instance.NextId(),
DictName = "系统状态",
DictType = "sys_common_status",
OrderNum = 100,
Remark = "登录状态列表",
IsDeleted = false,
};
entities.Add(dict10);
return entities;
}
}
}

View File

@@ -0,0 +1,76 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.Auditing;
using Yi.Framework.Data.Entities;
using Yi.Framework.Ddd.Entities;
namespace Yi.RBAC.Domain.Dictionary.Entities
{
[SugarTable("Dictionary")]
public class DictionaryEntity : AuditedObject, IEntity<long>, ISoftDelete, IOrderNum,IState
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
/// <summary>
/// 逻辑删除
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// 排序
/// </summary>
public int OrderNum { get; set; } = 0;
/// <summary>
/// 状态
/// </summary>
public bool? State { get; set; } = true;
/// <summary>
/// 描述
///</summary>
[SugarColumn(ColumnName = "Remark")]
public string? Remark { get; set; }
/// <summary>
/// tag类型
///</summary>
[SugarColumn(ColumnName = "ListClass")]
public string? ListClass { get; set; }
/// <summary>
/// tagClass
///</summary>
[SugarColumn(ColumnName = "CssClass")]
public string? CssClass { get; set; }
/// <summary>
/// 字典类型
///</summary>
[SugarColumn(ColumnName = "DictType")]
public string DictType { get; set; } = string.Empty;
/// <summary>
/// 字典标签
///</summary>
[SugarColumn(ColumnName = "DictLabel")]
public string? DictLabel { get; set; }
/// <summary>
/// 字典值
///</summary>
[SugarColumn(ColumnName = "DictValue")]
public string DictValue { get; set; } = string.Empty;
/// <summary>
/// 是否为该类型的默认值
///</summary>
[SugarColumn(ColumnName = "IsDefault")]
public bool IsDefault { get; set; }
}
}

View File

@@ -0,0 +1,55 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.Auditing;
using Yi.Framework.Data.Entities;
using Yi.Framework.Ddd.Entities;
namespace Yi.RBAC.Domain.Dictionary.Entities
{
[SugarTable("DictionaryType")]
public class DictionaryTypeEntity : AuditedObject,IEntity<long>, ISoftDelete, IOrderNum
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
/// <summary>
/// 逻辑删除
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// 排序
/// </summary>
public int OrderNum { get; set; } = 0;
/// <summary>
/// 状态
/// </summary>
public bool? State { get; set; } = true;
/// <summary>
/// 字典名称
///</summary>
[SugarColumn(ColumnName = "DictName")]
public string DictName { get; set; } = string.Empty;
/// <summary>
/// 字典类型
///</summary>
[SugarColumn(ColumnName = "DictType")]
public string DictType { get; set; } = string.Empty;
/// <summary>
/// 描述
///</summary>
[SugarColumn(ColumnName = "Remark")]
public string? Remark { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
using Yi.Framework.Ddd.Dtos.Abstract;
using Yi.Framework.Ddd.Repositories;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.RBAC.Domain.Identity.Entities;
namespace Yi.RBAC.Domain.Dictionary.Repositories
{
public interface IDictionaryRepository : IRepository<DictionaryEntity>
{
Task<PagedDto<DictionaryEntity>> SelectGetListAsync(DictionaryEntity input, IPagedAndSortedResultRequestDto pageInput);
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
using Yi.Framework.Ddd.Dtos.Abstract;
using Yi.Framework.Ddd.Repositories;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.RBAC.Domain.Identity.Entities;
namespace Yi.RBAC.Domain.Dictionary.Repositories
{
public interface IDictionaryTypeRepository : IRepository<DictionaryTypeEntity>
{
Task<PagedDto<DictionaryTypeEntity>> SelectGetListAsync(DictionaryTypeEntity input, IPagedAllResultRequestDto pageInput);
}
}

View File

@@ -4,6 +4,96 @@
<name>Yi.RBAC.Domain</name>
</assembly>
<members>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.Id">
<summary>
主键
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.IsDeleted">
<summary>
逻辑删除
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.OrderNum">
<summary>
排序
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.State">
<summary>
状态
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.Remark">
<summary>
描述
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.ListClass">
<summary>
tag类型
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.CssClass">
<summary>
tagClass
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.DictType">
<summary>
字典类型
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.DictLabel">
<summary>
字典标签
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.DictValue">
<summary>
字典值
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryEntity.IsDefault">
<summary>
是否为该类型的默认值
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryTypeEntity.Id">
<summary>
主键
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryTypeEntity.IsDeleted">
<summary>
逻辑删除
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryTypeEntity.OrderNum">
<summary>
排序
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryTypeEntity.State">
<summary>
状态
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryTypeEntity.DictName">
<summary>
字典名称
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryTypeEntity.DictType">
<summary>
字典类型
</summary>
</member>
<member name="P:Yi.RBAC.Domain.Dictionary.Entities.DictionaryTypeEntity.Remark">
<summary>
描述
</summary>
</member>
<member name="T:Yi.RBAC.Domain.Identity.AccountManager">
<summary>
用户领域服务

View File

@@ -54,7 +54,7 @@ namespace Yi.RBAC.Domain.Identity.Entities
/// <summary>
/// 状态
/// </summary>
public bool State { get; set; }
public bool? State { get; set; }
/// <summary>
/// 部门名称

View File

@@ -56,7 +56,7 @@ namespace Yi.RBAC.Domain.Identity.Entities
/// <summary>
/// 状态
/// </summary>
public bool State { get; set; }
public bool? State { get; set; }
/// <summary>
/// 菜单名

View File

@@ -55,7 +55,7 @@ namespace Yi.RBAC.Domain.Identity.Entities
/// <summary>
/// 状态
/// </summary>
public bool State { get; set; }
public bool? State { get; set; }
/// <summary>
/// 岗位编码

View File

@@ -79,7 +79,7 @@ namespace Yi.RBAC.Domain.Identity.Entities
/// <summary>
/// 状态
/// </summary>
public bool State { get; set; }
public bool? State { get; set; }
[Navigate(typeof(RoleMenuEntity), nameof(RoleMenuEntity.RoleId), nameof(RoleMenuEntity.MenuId))]

View File

@@ -133,7 +133,7 @@ namespace Yi.RBAC.Domain.Identity.Entities
/// <summary>
/// 状态
/// </summary>
public bool State { get; set; } = true;
public bool? State { get; set; } = true;
/// <summary>

View File

@@ -0,0 +1,36 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core.Sqlsugar.Repositories;
using Yi.Framework.Ddd.Dtos;
using Yi.Framework.Ddd.Dtos.Abstract;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.RBAC.Domain.Dictionary.Repositories;
using Yi.RBAC.Domain.Identity.Entities;
using Yi.RBAC.Domain.Identity.Repositories;
namespace Yi.RBAC.Sqlsugar.Repositories
{
[AppService]
public class DictionaryRepository : SqlsugarRepository<DictionaryEntity>, IDictionaryRepository
{
public DictionaryRepository(ISqlSugarClient context) : base(context)
{
}
public async Task<PagedDto<DictionaryEntity>> SelectGetListAsync(DictionaryEntity input, IPagedAndSortedResultRequestDto pageInput)
{
RefAsync<int> total = 0;
var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
.WhereIF(input.State is not null,x => x.State == input.State)
.ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total);
return new PagedDto<DictionaryEntity>(total, entities);
}
}
}

View File

@@ -0,0 +1,35 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core.Sqlsugar.Repositories;
using Yi.Framework.Ddd.Dtos;
using Yi.Framework.Ddd.Dtos.Abstract;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.RBAC.Domain.Dictionary.Repositories;
namespace Yi.RBAC.Sqlsugar.Repositories
{
[AppService]
public class DictionaryTypeRepository : SqlsugarRepository<DictionaryTypeEntity>, IDictionaryTypeRepository
{
public DictionaryTypeRepository(ISqlSugarClient context) : base(context)
{
}
public async Task<PagedDto<DictionaryTypeEntity>> SelectGetListAsync(DictionaryTypeEntity input, IPagedAllResultRequestDto pageInput)
{
RefAsync<int> total = 0;
var entities = await _DbQueryable.WhereIF(input.DictName is not null, x => x.DictName.Contains(input.DictName!))
.WhereIF(input.DictType is not null, x => x.DictType!.Contains(input.DictType!))
.WhereIF(input.State is not null, x => x.State == input.State)
.WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null ,x=>x.CreationTime>=pageInput.StartTime && x.CreationTime<=pageInput.EndTime)
.ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total);
return new PagedDto<DictionaryTypeEntity>(total, entities);
}
}
}

View File

@@ -29,7 +29,7 @@ namespace Yi.RBAC.Sqlsugar.Repositories
var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.UserName), x => x.UserName.Contains(input.UserName!)).
WhereIF(input.Phone is not null, x => x.Phone.ToString()! .Contains(input.Phone.ToString()!)).
WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name!.Contains(input.Name!)).
WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null, x => x.CreationTime >= pageInput.StartTime && x.CreationTime <= pageInput.EndTime).ToPageListAsync(pageInput.PageIndex, pageInput.PageSize);
WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null, x => x.CreationTime >= pageInput.StartTime && x.CreationTime <= pageInput.EndTime).ToPageListAsync(pageInput.PageNum, pageInput.PageSize);
return entities;
}

View File

@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询字典数据列表
export function listData(query) {
return request({
url: '/dictionaryInfo/pageList',
url: '/dictionary',
method: 'get',
params: query
})
@@ -12,7 +12,7 @@ export function listData(query) {
// 查询字典数据详细
export function getData(dictCode) {
return request({
url: '/dictionaryInfo/getById/' + dictCode,
url: '/dictionary/' + dictCode,
method: 'get'
})
}
@@ -20,7 +20,7 @@ export function getData(dictCode) {
// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
return request({
url: '/dictionaryInfo/GetListByType/' + dictType,
url: '/dictionary/dic-type/' + dictType,
method: 'get'
})
}
@@ -28,7 +28,7 @@ export function getDicts(dictType) {
// 新增字典数据
export function addData(data) {
return request({
url: '/dictionaryInfo/add',
url: '/dictionary',
method: 'post',
data: data
})
@@ -37,7 +37,7 @@ export function addData(data) {
// 修改字典数据
export function updateData(data) {
return request({
url: '/dictionaryInfo/update',
url: `/dictionary/${data.id}`,
method: 'put',
data: data
})
@@ -45,14 +45,9 @@ export function updateData(data) {
// 删除字典数据
export function delData(dictCode) {
if("string"==typeof(dictCode))
{
dictCode=[dictCode];
}
console.log(dictCode,"dictCode")
return request({
url: '/dictionaryInfo/delList',
method: 'delete',
data:dictCode
url: `/dictionary/${dictCode}`,
method: 'delete'
})
}

View File

@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询字典类型列表
export function listType(query) {
return request({
url: '/dictionary/pageList',
url: '/dictionary-type',
method: 'get',
params: query
})
@@ -12,7 +12,7 @@ export function listType(query) {
// 查询字典类型详细
export function getType(dictId) {
return request({
url: '/dictionary/getById/' + dictId,
url: '/dictionary-type/' + dictId,
method: 'get'
})
}
@@ -20,7 +20,7 @@ export function getType(dictId) {
// 新增字典类型
export function addType(data) {
return request({
url: '/dictionary/add',
url: '/dictionary-type',
method: 'post',
data: data
})
@@ -29,7 +29,7 @@ export function addType(data) {
// 修改字典类型
export function updateType(data) {
return request({
url: '/dictionary/update',
url: `/dictionary-type/${data.id}`,
method: 'put',
data: data
})
@@ -37,14 +37,9 @@ export function updateType(data) {
// 删除字典类型
export function delType(dictId) {
if("string"==typeof(dictId))
{
dictId=[dictId];
}
return request({
url: '/dictionary/delList',
url: `/dictionary-type/${dictId}`,
method: 'delete',
data:dictId
})
}
@@ -59,7 +54,7 @@ export function refreshCache() {
// 获取字典选择框列表
export function optionselect() {
return request({
url: '/dictionary/getList',
url: '/dictionary-type',
method: 'get'
})
}

View File

@@ -19,13 +19,13 @@
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="数据状态" clearable>
<el-form-item label="状态" prop="state">
<el-select v-model="queryParams.state" placeholder="数据状态" clearable>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:key="JSON.parse(dict.value)"
:label="dict.label"
:value="dict.value"
:value="JSON.parse(dict.value)"
/>
</el-select>
</el-form-item>
@@ -96,15 +96,15 @@
</el-table-column>
<el-table-column label="字典键值" align="center" prop="dictValue" />
<el-table-column label="字典排序" align="center" prop="orderNum" />
<el-table-column label="状态" align="center" prop="isDeleted">
<el-table-column label="状态" align="center" prop="state">
<template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.isDeleted" />
<dict-tag :options="sys_normal_disable" :value="scope.row.state" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<el-table-column label="创建时间" align="center" prop="creationTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.creationTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
@@ -161,8 +161,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="isDeleted">
<el-radio-group v-model="form.isDeleted">
<el-form-item label="状态" prop="state">
<el-radio-group v-model="form.state">
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="JSON.parse(dict.value)">{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
@@ -217,7 +217,7 @@ const data = reactive({
pageSize: 10,
dictName: undefined,
dictType: undefined,
isDeleted: false
state: true
},
rules: {
dictLabel: [{ required: true, message: "数据标签不能为空", trigger: "blur" }],
@@ -240,14 +240,14 @@ function getTypes(dictId) {
/** 查询字典类型列表 */
function getTypeList() {
getDictOptionselect().then(response => {
typeOptions.value = response.data;
typeOptions.value = response.data.items;
});
}
/** 查询字典数据列表 */
function getList() {
loading.value = true;
listData(queryParams.value).then(response => {
dataList.value = response.data.data;
dataList.value = response.data.items;
total.value = response.data.total;
loading.value = false;
});
@@ -266,7 +266,7 @@ function reset() {
cssClass: undefined,
listClass: "default",
orderNum: 0,
isDeleted: false,
state: true,
remark: undefined
};
proxy.resetForm("dataRef");

View File

@@ -19,18 +19,18 @@
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="isDeleted">
<el-form-item label="状态" prop="state">
<el-select
v-model="queryParams.isDeleted"
v-model="queryParams.state"
placeholder="字典状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:key="JSON.parse(dict.value)"
:label="dict.label"
:value="dict.value"
:value="JSON.parse(dict.value)"
/>
</el-select>
</el-form-item>
@@ -112,15 +112,15 @@
</router-link>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="isDeleted">
<el-table-column label="状态" align="center" prop="state">
<template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.isDeleted" />
<dict-tag :options="sys_normal_disable" :value="scope.row.state" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<el-table-column label="创建时间" align="center" prop="creationTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.creationTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -158,8 +158,8 @@
<el-form-item label="字典类型" prop="dictType">
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-form-item>
<el-form-item label="状态" prop="isDeleted">
<el-radio-group v-model="form.isDeleted">
<el-form-item label="状态" prop="state">
<el-radio-group v-model="form.state">
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="JSON.parse(dict.value)">{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
@@ -202,7 +202,7 @@ const data = reactive({
pageSize: 10,
dictName: undefined,
dictType: undefined,
isDeleted: false
state: true
},
rules: {
dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }],
@@ -216,7 +216,7 @@ const { queryParams, form, rules } = toRefs(data);
function getList() {
loading.value = true;
listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
typeList.value = response.data.data;
typeList.value = response.data.items;
total.value = response.data.total;
loading.value = false;
});
@@ -228,13 +228,7 @@ function cancel() {
}
/** 表单重置 */
function reset() {
form.value = {
id: undefined,
dictName: undefined,
dictType: undefined,
isDeleted: false,
remark: undefined
};
proxy.resetForm("dictRef");
}
/** 搜索按钮操作 */