From 854a05cd5d30eeb483b9bf159e5ca40b9a05ad6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Fri, 6 May 2022 22:12:15 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Model/System/Dto/MenuDto.cs | 4 ++++ ZR.Model/System/SysMenu.cs | 6 +++++- ZR.Model/System/Vo/RouterVo.cs | 8 ++++++++ ZR.Service/System/SysMenuService.cs | 4 ++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ZR.Model/System/Dto/MenuDto.cs b/ZR.Model/System/Dto/MenuDto.cs index 76714b8..9b7492d 100644 --- a/ZR.Model/System/Dto/MenuDto.cs +++ b/ZR.Model/System/Dto/MenuDto.cs @@ -68,5 +68,9 @@ namespace ZR.Model.System.Dto /// 菜单图标 /// public string icon { get; set; } = string.Empty; + /// + /// 翻译key + /// + public string MenuNameKey { get; set; } } } diff --git a/ZR.Model/System/SysMenu.cs b/ZR.Model/System/SysMenu.cs index b44da88..1a61890 100644 --- a/ZR.Model/System/SysMenu.cs +++ b/ZR.Model/System/SysMenu.cs @@ -80,7 +80,11 @@ namespace ZR.Model.System /// 菜单图标 /// public string icon { get; set; } = string.Empty; - + /// + /// 菜单名key + /// + [SugarColumn(ColumnName = "menuName_key")] + public string MenuNameKey { get; set; } /// /// 子菜单 /// diff --git a/ZR.Model/System/Vo/RouterVo.cs b/ZR.Model/System/Vo/RouterVo.cs index 73b7399..d55e653 100644 --- a/ZR.Model/System/Vo/RouterVo.cs +++ b/ZR.Model/System/Vo/RouterVo.cs @@ -39,6 +39,7 @@ namespace ZR.Model.System.Vo /// 设置为true,则不会被 缓存 /// public bool NoCache { get; set; } + public string TitleKey { get; set; } = string.Empty; public Meta(string title, string icon, bool noCache) { @@ -46,5 +47,12 @@ namespace ZR.Model.System.Vo Icon = icon; NoCache = noCache; } + public Meta(string title, string icon, bool noCache, string titleKey) + { + Title = title; + Icon = icon; + NoCache = noCache; + TitleKey = string.IsNullOrEmpty(titleKey) ? title : titleKey; + } } } diff --git a/ZR.Service/System/SysMenuService.cs b/ZR.Service/System/SysMenuService.cs index ac6da4e..a9fa525 100644 --- a/ZR.Service/System/SysMenuService.cs +++ b/ZR.Service/System/SysMenuService.cs @@ -273,7 +273,7 @@ namespace ZR.Service Name = GetRouteName(menu), Path = GetRoutePath(menu), Component = GetComponent(menu), - Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache)) + Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache), menu.MenuNameKey) }; List cMenus = menu.children; @@ -292,7 +292,7 @@ namespace ZR.Service Path = menu.path, Component = menu.component, Name = string.IsNullOrEmpty(menu.path) ? "" : menu.path.ToLower(), - Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache)) + Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache), menu.MenuNameKey) }; childrenList.Add(children); router.Children = childrenList; From 1d9ec93e1210b81977033fa2f0ef7c4b57d39338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Fri, 6 May 2022 22:12:51 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../System/CommonLangController.cs | 239 ++++++++++++++++++ ZR.Model/System/CommonLang.cs | 59 +++++ ZR.Model/System/Dto/CommonLangDto.cs | 35 +++ ZR.Model/System/Vo/LangVo.cs | 13 + ZR.Repository/System/CommonLangRepository.cs | 20 ++ ZR.Service/System/CommonLangService.cs | 92 +++++++ .../ISystemService/ICommonLangService.cs | 21 ++ 7 files changed, 479 insertions(+) create mode 100644 ZR.Admin.WebApi/Controllers/System/CommonLangController.cs create mode 100644 ZR.Model/System/CommonLang.cs create mode 100644 ZR.Model/System/Dto/CommonLangDto.cs create mode 100644 ZR.Model/System/Vo/LangVo.cs create mode 100644 ZR.Repository/System/CommonLangRepository.cs create mode 100644 ZR.Service/System/CommonLangService.cs create mode 100644 ZR.Service/System/ISystemService/ICommonLangService.cs diff --git a/ZR.Admin.WebApi/Controllers/System/CommonLangController.cs b/ZR.Admin.WebApi/Controllers/System/CommonLangController.cs new file mode 100644 index 0000000..77d82b7 --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/System/CommonLangController.cs @@ -0,0 +1,239 @@ +using Infrastructure; +using Infrastructure.Attribute; +using Infrastructure.Enums; +using Infrastructure.Model; +using Mapster; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using ZR.Admin.WebApi.Extensions; +using ZR.Admin.WebApi.Filters; +using ZR.Common; +using ZR.Model; +using ZR.Model.Dto; +using ZR.Model.Models; +using ZR.Service.System.ISystemService; + +namespace ZR.Admin.WebApi.Controllers +{ + /// + /// 多语言配置Controller + /// + /// @author zr + /// @date 2022-05-06 + /// + [Verify] + [Route("system/CommonLang")] + public class CommonLangController : BaseController + { + /// + /// 多语言配置接口 + /// + private readonly ICommonLangService _CommonLangService; + + public CommonLangController(ICommonLangService CommonLangService) + { + _CommonLangService = CommonLangService; + } + + /// + /// 查询多语言配置列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "system:lang:list")] + public IActionResult QueryCommonLang([FromQuery] CommonLangQueryDto parm) + { + if (parm.ShowMode == 2) + { + PagedInfo pagedInfo = new(); + pagedInfo.Result = _CommonLangService.GetListToPivot(parm); + + return SUCCESS(pagedInfo); + } + + return SUCCESS(_CommonLangService.GetList(parm)); + } + + /// + /// 查询多语言配置列表 + /// + /// + [HttpGet("list/{lang}")] + [AllowAnonymous] + public IActionResult QueryCommonLangs() + { + var msgList = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "zh-cn" }); + var msgListEn = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "en" }); + var msgListTw = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "zh-tw" }); + Dictionary dic = new(); + Dictionary dicEn = new(); + Dictionary dicTw = new(); + SetLang(msgList, dic); + SetLang(msgListEn, dicEn); + SetLang(msgListTw, dicTw); + return SUCCESS(new + { + en = dicEn, + cn = dic, + tw = dicTw + }); + } + + private static void SetLang(List msgList, Dictionary dic) + { + foreach (var item in msgList) + { + if (!dic.ContainsKey(item.LangKey)) + { + dic.Add(item.LangKey, item.LangName); + } + } + } + + /// + /// 查询多语言配置详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "system:lang:query")] + public IActionResult GetCommonLang(long Id) + { + var response = _CommonLangService.GetFirst(x => x.Id == Id); + var modal = response.Adapt(); + if (modal != null) + { + var list = _CommonLangService.GetList(f => f.LangKey == modal.LangKey); + modal.LangName = list.Find(f => f.LangCode == "zh-cn")?.LangName; + modal.LangNameEn = list.Find(f => f.LangCode == "en")?.LangName; + modal.LangNameTw = list.Find(f => f.LangCode == "zh-tw")?.LangName; + } + return SUCCESS(modal); + } + + /// + /// 查询多语言配置详情 + /// + /// + /// + [HttpGet("key/{langKey}")] + [ActionPermissionFilter(Permission = "system:lang:query")] + public IActionResult GetCommonLangByKey(string langKey) + { + var response = _CommonLangService.GetList(x => x.LangKey == langKey); + + return SUCCESS(response); + } + /// + /// 添加多语言配置 + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "system:lang:add")] + [Log(Title = "多语言配置", BusinessType = BusinessType.INSERT)] + public IActionResult AddCommonLang([FromBody] CommonLangDto parm) + { + if (parm == null) + { + throw new CustomException("请求参数错误"); + } + + //从 Dto 映射到 实体 + var modal = parm.Adapt().ToCreate(HttpContext); + var list = _CommonLangService.GetList(f => f.LangKey == modal.LangKey); + modal.Addtime = DateTime.Now; + modal.LangCode = "zh-cn"; + modal.LangName = parm.LangName; + if (!list.Any(f => f.LangCode == modal.LangCode)) + { + _CommonLangService.InsertReturnSnowflakeId(modal); + } + modal.LangCode = "zh-tw"; + modal.LangName = parm.LangNameTw; + if (!list.Any(f => f.LangCode == modal.LangCode)) + { + _CommonLangService.InsertReturnSnowflakeId(modal); + } + modal.LangCode = "en"; + modal.LangName = parm.LangNameEn; + if (!list.Any(f => f.LangCode == modal.LangCode)) + { + _CommonLangService.InsertReturnSnowflakeId(modal); + } + return ToResponse(1); + } + + /// + /// 更新多语言配置 + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "system:lang:edit")] + [Log(Title = "多语言配置", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateCommonLang([FromBody] CommonLangDto parm) + { + if (parm == null) + { + throw new CustomException("请求实体不能为空"); + } + //从 Dto 映射到 实体 + var modal = parm.Adapt().ToUpdate(HttpContext); + var list = _CommonLangService.GetList(f => f.LangKey == modal.LangKey); + + _CommonLangService.Update(w => w.LangKey == modal.LangKey && w.LangCode == "zh-cn", it => new CommonLang() + { + LangName = modal.LangName, + }); + + _CommonLangService.Update(w => w.LangKey == modal.LangKey && w.LangCode == "zh-tw", it => new CommonLang() + { + LangName = parm.LangNameTw, + }); + + _CommonLangService.Update(w => w.LangKey == modal.LangKey && w.LangCode == "en", it => new CommonLang() + { + LangName = parm.LangNameEn, + }); + + return ToResponse(1); + } + + /// + /// 删除多语言配置 + /// + /// + [HttpDelete("{ids}")] + [ActionPermissionFilter(Permission = "system:lang:delete")] + [Log(Title = "多语言配置", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteCommonLang(string ids) + { + long[] idsArr = Tools.SpitLongArrary(ids); + if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } + + var response = _CommonLangService.Delete(idsArr); + + return ToResponse(response); + } + + /// + /// 导出多语言配置 + /// + /// + [Log(Title = "多语言配置", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)] + [HttpGet("export")] + [ActionPermissionFilter(Permission = "system:lang:export")] + public IActionResult Export([FromQuery] CommonLangQueryDto parm) + { + parm.PageSize = 10000; + var list = _CommonLangService.GetList(parm).Result; + + string sFileName = ExportExcel(list, "CommonLang", "多语言配置"); + return SUCCESS(new { path = "/export/" + sFileName, fileName = sFileName }); + } + + } +} \ No newline at end of file diff --git a/ZR.Model/System/CommonLang.cs b/ZR.Model/System/CommonLang.cs new file mode 100644 index 0000000..b48c740 --- /dev/null +++ b/ZR.Model/System/CommonLang.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using SqlSugar; +using OfficeOpenXml.Attributes; +using Newtonsoft.Json; + +namespace ZR.Model.Models +{ + /// + /// 多语言配置,数据实体对象 + /// + /// @author zr + /// @date 2022-05-06 + /// + [Tenant("0")] + [SugarTable("sys_common_lang")] + public class CommonLang + { + /// + /// 描述 : id + /// 空值 : false + /// + [JsonConverter(typeof(ValueToStringConverter))] + [EpplusTableColumn(Header = "id")] + [SugarColumn(IsPrimaryKey = true)] + public long Id { get; set; } + + /// + /// 描述 : 语言code + /// 空值 : false + /// + [EpplusTableColumn(Header = "语言code")] + [SugarColumn(ColumnName = "lang_code")] + public string LangCode { get; set; } + + /// + /// 描述 : 语言key + /// 空值 : true + /// + [EpplusTableColumn(Header = "语言key")] + [SugarColumn(ColumnName = "lang_key")] + public string LangKey { get; set; } + + /// + /// 描述 : 名称 + /// 空值 : false + /// + [EpplusTableColumn(Header = "名称")] + [SugarColumn(ColumnName = "lang_name")] + public string LangName { get; set; } + + /// + /// 描述 : 添加时间 + /// 空值 : true + /// + [EpplusTableColumn(Header = "添加时间", NumberFormat = "yyyy-MM-dd HH:mm:ss")] + public DateTime? Addtime { get; set; } + } +} \ No newline at end of file diff --git a/ZR.Model/System/Dto/CommonLangDto.cs b/ZR.Model/System/Dto/CommonLangDto.cs new file mode 100644 index 0000000..1f56d7b --- /dev/null +++ b/ZR.Model/System/Dto/CommonLangDto.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace ZR.Model.Dto +{ + /// + /// 多语言配置输入对象 + /// + public class CommonLangDto + { + [Required(ErrorMessage = "id不能为空")] + public long Id { get; set; } + //[Required(ErrorMessage = "语言code不能为空")] + public string LangCode { get; set; } + public string LangKey { get; set; } + [Required(ErrorMessage = "名称不能为空")] + public string LangName { get; set; } + public string LangNameEn { get; set; } + public string LangNameTw { get; set; } + //public List Langs { get; set; } + } + + /// + /// 多语言配置查询对象 + /// + public class CommonLangQueryDto : PagerInfo + { + public string LangCode { get; set; } + public string LangKey { get; set; } + public DateTime? BeginAddtime { get; set; } + public DateTime? EndAddtime { get; set; } + public int ShowMode { get; set; } + } +} diff --git a/ZR.Model/System/Vo/LangVo.cs b/ZR.Model/System/Vo/LangVo.cs new file mode 100644 index 0000000..802d842 --- /dev/null +++ b/ZR.Model/System/Vo/LangVo.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZR.Model.System.Vo +{ + public class LangVo + { + + } +} diff --git a/ZR.Repository/System/CommonLangRepository.cs b/ZR.Repository/System/CommonLangRepository.cs new file mode 100644 index 0000000..9ef5eb1 --- /dev/null +++ b/ZR.Repository/System/CommonLangRepository.cs @@ -0,0 +1,20 @@ +using System; +using Infrastructure.Attribute; +using ZR.Repository.System; +using ZR.Model.Models; + +namespace ZR.Repository +{ + /// + /// 多语言配置仓储 + /// + /// @author zr + /// @date 2022-05-06 + /// + [AppService(ServiceLifetime = LifeTime.Transient)] + public class CommonLangRepository : BaseRepository + { + #region 业务逻辑代码 + #endregion + } +} \ No newline at end of file diff --git a/ZR.Service/System/CommonLangService.cs b/ZR.Service/System/CommonLangService.cs new file mode 100644 index 0000000..818442d --- /dev/null +++ b/ZR.Service/System/CommonLangService.cs @@ -0,0 +1,92 @@ +using Infrastructure.Attribute; +using SqlSugar; +using System.Collections.Generic; +using System.Linq; +using ZR.Model; +using ZR.Model.Dto; +using ZR.Model.Models; +using ZR.Repository; +using ZR.Service.System.ISystemService; + +namespace ZR.Service.System +{ + /// + /// 多语言配置Service业务层处理 + /// + /// @author zr + /// @date 2022-05-06 + /// + [AppService(ServiceType = typeof(ICommonLangService), ServiceLifetime = LifeTime.Transient)] + public class CommonLangService : BaseService, ICommonLangService + { + private readonly CommonLangRepository _CommonLangrepository; + public CommonLangService(CommonLangRepository repository) + { + _CommonLangrepository = repository; + } + + #region 业务逻辑代码 + + /// + /// 查询多语言配置列表 + /// + /// + /// + public PagedInfo GetList(CommonLangQueryDto parm) + { + //开始拼装查询条件 + var predicate = Expressionable.Create(); + + //搜索条件查询语法参考Sqlsugar + predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangCode), it => it.LangCode == parm.LangCode); + predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangKey), it => it.LangKey.Contains(parm.LangKey)); + //predicate = predicate.AndIF(parm.BeginAddtime == null, it => it.Addtime >= DateTime.Now.AddDays(-1)); + predicate = predicate.AndIF(parm.BeginAddtime != null, it => it.Addtime >= parm.BeginAddtime && it.Addtime <= parm.EndAddtime); + var response = _CommonLangrepository + .Queryable() + .Where(predicate.ToExpression()) + .ToPage(parm); + return response; + } + + /// + /// 行转列 + /// + /// + /// + public dynamic GetListToPivot(CommonLangQueryDto parm) + { + //开始拼装查询条件 + var predicate = Expressionable.Create(); + + //搜索条件查询语法参考Sqlsugar + predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangCode), it => it.LangCode == parm.LangCode); + predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangKey), it => it.LangKey.Contains(parm.LangKey)); + //predicate = predicate.AndIF(parm.BeginAddtime == null, it => it.Addtime >= DateTime.Now.AddDays(-1)); + predicate = predicate.AndIF(parm.BeginAddtime != null, it => it.Addtime >= parm.BeginAddtime && it.Addtime <= parm.EndAddtime); + var response = _CommonLangrepository + .Queryable() + .Where(predicate.ToExpression()) + .ToPivotList(it => it.LangCode, it => it.LangKey, it => it.Max(f => f.LangName)); + return response; + } + + public List GetLangList(CommonLangQueryDto parm) + { + //开始拼装查询条件 + var predicate = Expressionable.Create(); + + //搜索条件查询语法参考Sqlsugar + predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangCode), it => it.LangCode == parm.LangCode); + //predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangKey), it => it.LangKey.Contains(parm.LangKey)); + //predicate = predicate.AndIF(parm.BeginAddtime == null, it => it.Addtime >= DateTime.Now.AddDays(-1)); + //predicate = predicate.AndIF(parm.BeginAddtime != null, it => it.Addtime >= parm.BeginAddtime && it.Addtime <= parm.EndAddtime); + var response = _CommonLangrepository + .Queryable() + .Where(predicate.ToExpression()) + .ToList(); + return response; + } + #endregion + } +} \ No newline at end of file diff --git a/ZR.Service/System/ISystemService/ICommonLangService.cs b/ZR.Service/System/ISystemService/ICommonLangService.cs new file mode 100644 index 0000000..67c6351 --- /dev/null +++ b/ZR.Service/System/ISystemService/ICommonLangService.cs @@ -0,0 +1,21 @@ +using System; +using ZR.Model; +using ZR.Model.Dto; +using ZR.Model.Models; +using System.Collections.Generic; + +namespace ZR.Service.System.ISystemService +{ + /// + /// 多语言配置service接口 + /// + /// @author zr + /// @date 2022-05-06 + /// + public interface ICommonLangService : IBaseService + { + PagedInfo GetList(CommonLangQueryDto parm); + List GetLangList(CommonLangQueryDto parm); + dynamic GetListToPivot(CommonLangQueryDto parm); + } +} From e34959c87ac4538f6ca2c7ca9ac9c522e79e4434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sat, 7 May 2022 13:16:37 +0800 Subject: [PATCH 03/13] =?UTF-8?q?fix=E8=A1=A8=E5=90=8D=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Model/System/SysTasksLog.cs | 2 +- ZR.Model/System/SysTasksQz.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZR.Model/System/SysTasksLog.cs b/ZR.Model/System/SysTasksLog.cs index 32ab87e..a540d06 100644 --- a/ZR.Model/System/SysTasksLog.cs +++ b/ZR.Model/System/SysTasksLog.cs @@ -9,7 +9,7 @@ namespace ZR.Model.System /// /// 任务日志 /// - [SugarTable("sys_Tasks_log")] + [SugarTable("sys_tasks_log")] [Tenant("0")] public class SysTasksLog { diff --git a/ZR.Model/System/SysTasksQz.cs b/ZR.Model/System/SysTasksQz.cs index 2827394..4f9ef06 100644 --- a/ZR.Model/System/SysTasksQz.cs +++ b/ZR.Model/System/SysTasksQz.cs @@ -10,7 +10,7 @@ namespace ZR.Model.System /// ///计划任务 /// - [SugarTable("Sys_TasksQz")] + [SugarTable("sys_tasksQz")] [Tenant("0")] public class SysTasksQz { From 44d8cd01eb404a59a82a0cf5a51289d945171329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sat, 7 May 2022 13:37:36 +0800 Subject: [PATCH 04/13] update RouterVo.cs --- ZR.Model/System/Vo/RouterVo.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ZR.Model/System/Vo/RouterVo.cs b/ZR.Model/System/Vo/RouterVo.cs index d55e653..9c0140d 100644 --- a/ZR.Model/System/Vo/RouterVo.cs +++ b/ZR.Model/System/Vo/RouterVo.cs @@ -17,7 +17,6 @@ namespace ZR.Model.System.Vo public bool Hidden { get; set; } public string Name { get; set; } public string Path { get; set; } - //[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string Redirect { get; set; } public Meta Meta { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] @@ -52,7 +51,7 @@ namespace ZR.Model.System.Vo Title = title; Icon = icon; NoCache = noCache; - TitleKey = string.IsNullOrEmpty(titleKey) ? title : titleKey; + TitleKey = titleKey; } } } From 2b11b01bb5fc92c3286cdd250d3fb1fd534fbae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sat, 7 May 2022 13:38:14 +0800 Subject: [PATCH 05/13] =?UTF-8?q?mysql=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=9A=E8=AF=AD=E8=A8=80=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- document/admin-mysql.sql | 217 +++++++++++++++++++++++---------------- 1 file changed, 127 insertions(+), 90 deletions(-) diff --git a/document/admin-mysql.sql b/document/admin-mysql.sql index b6cca20..c7bb693 100644 --- a/document/admin-mysql.sql +++ b/document/admin-mysql.sql @@ -157,6 +157,11 @@ INSERT INTO `sys_dict_data` VALUES (28, 2, '失败', '1', 'sys_common_status', ' INSERT INTO `sys_dict_data` VALUES (29, 1, '发布', '1', 'sys_article_status', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:34:56', '', NULL, NULL); INSERT INTO `sys_dict_data` VALUES (30, 2, '草稿', '2', 'sys_article_status', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (31, 1, '中文', 'zh-cn', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (32, 2, '英文', 'en', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (33, 3, '繁体', 'zh-tw', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); + + SET FOREIGN_KEY_CHECKS = 1; -- ---------------------------- @@ -192,6 +197,7 @@ INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0', INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 'Y', 'admin', SYSDATE(), '', NULL, '操作类型列表'); INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 'Y', 'admin', SYSDATE(), '', NULL, '登录状态列表'); INSERT INTO `sys_dict_type` VALUES (11, '文章状态', 'sys_article_status', '0', 'Y', 'admin', SYSDATE(), '', NULL, NULL); +INSERT INTO `sys_dict_type` VALUES (12, '多语言类型', 'sys_lang_type', '0', 'Y', 'admin', SYSDATE(), '', NULL, '多语言字典类型'); SET FOREIGN_KEY_CHECKS = 1; @@ -236,6 +242,7 @@ CREATE TABLE `sys_menu` ( `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注', + `menuName_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单名翻译字典名', PRIMARY KEY (`menuId`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单权限表' ROW_FORMAT = Dynamic; @@ -243,121 +250,121 @@ CREATE TABLE `sys_menu` ( -- Records of sys_menu -- ---------------------------- -- 一级菜单 -INSERT INTO sys_menu VALUES (1, '系统管理', 0, 1, 'system', NULL, 0, 0, 'M', '0', '0', '', 'system', '', SYSDATE(), '', NULL, '系统管理目录'); -INSERT INTO sys_menu VALUES (2, '系统监控', 0, 2, 'monitor', NULL, 0, 0, 'M', '0', '0', '', 'monitor', '', SYSDATE(), '', NULL, '系统监控目录'); -INSERT INTO sys_menu VALUES (3, '系统工具', 0, 3, 'tool', NULL, 0, 0, 'M', '0', '0', '', 'tool', '', SYSDATE(), '', NULL, '系统工具目录'); -INSERT INTO sys_menu VALUES (5, '外部打开', 0, 5, 'http://www.izhaorui.cn', NULL, 1, 0, 'M', '0', '0', '', 'link', '', SYSDATE(), '', NULL, 'Zr官网地址'); -INSERT INTO sys_menu VALUES (6, '控制台', 0, 0, 'dashboard', 'index_v1', 0, 0, 'C', '0', '0', '', 'dashboard', '', SYSDATE(), '', NULL, ''); +INSERT INTO sys_menu VALUES (1, '系统管理', 0, 1, 'system', NULL, 0, 0, 'M', '0', '0', '', 'system', '', SYSDATE(), '', NULL, '系统管理目录', 'menu.system'); +INSERT INTO sys_menu VALUES (2, '系统监控', 0, 2, 'monitor', NULL, 0, 0, 'M', '0', '0', '', 'monitor', '', SYSDATE(), '', NULL, '系统监控目录', 'menu.monitoring'); +INSERT INTO sys_menu VALUES (3, '系统工具', 0, 3, 'tool', NULL, 0, 0, 'M', '0', '0', '', 'tool', '', SYSDATE(), '', NULL, '系统工具目录', 'menu.systemTools'); +INSERT INTO sys_menu VALUES (5, '官网地址', 0, 5, 'http://www.izhaorui.cn/doc', NULL, 1, 0, 'M', '0', '0', '', 'link', '', SYSDATE(), '', NULL, 'Zr官网地址', 'menu.officialWebsite'); +INSERT INTO sys_menu VALUES (6, '控制台', 0, 0, 'dashboard', 'index_v1', 0, 0, 'C', '0', '0', '', 'dashboard', '', SYSDATE(), '', NULL, '', 'menu.dashboard'); -- 二级菜单 -INSERT INTO sys_menu VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', 0, 0, 'C', '0', '0', 'system:user:list', 'user', '', SYSDATE(), '', NULL, '用户管理菜单'); -INSERT INTO sys_menu VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', 0, 0, 'C', '0', '0', 'system:role:list', 'peoples', '', SYSDATE(), '', NULL, '角色管理菜单'); -INSERT INTO sys_menu VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', 0, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', '', SYSDATE(), '', NULL, '菜单管理菜单'); -INSERT INTO sys_menu VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', 0, 0, 'C', '0', '0', 'system:dept:list', 'tree', '', SYSDATE(), '', NULL, '部门管理菜单'); -INSERT INTO sys_menu VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', 0, 0, 'C', '0', '0', 'system:post:list', 'post', '', SYSDATE(), '', NULL, '岗位管理菜单'); -INSERT INTO sys_menu VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', 0, 0, 'C', '0', '0', 'system:dict:list', 'dict', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (106, '角色分配', 1, 2, 'roleusers', 'system/roleusers/index', 0, 0, 'C', '1', '0', 'system:roleusers:list', 'people', '', SYSDATE(), '', NULL, NULL); -INSERT into sys_menu VALUES (107, '参数设置', 1, 8, 'config','system/config/index', 0, 0, 'C', '0', '0', 'system:config:list','edit', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (108, '日志管理', 1, 10, 'log', '' , 0, 0, 'M', '0', '0', '', 'log', '', SYSDATE(), '', NULL, '日志管理菜单'); -INSERT INTO sys_menu VALUES (109, '通知公告', 1, 9, 'notice', 'system/notice/index', 0, 0, 'C', '0', '0', 'system:notice:list', 'message', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (110, '定时任务', 2, 10, 'job', 'monitor/job/index', 0, 0, 'C', '0', '0', '', 'job', '', SYSDATE(), '', NULL, '定时任务菜单'); -INSERT INTO sys_menu VALUES (112, '服务监控', 2, 11, 'server', 'monitor/server/index', 0, 0, 'C', '0', '0', 'monitor:server:list', 'server', '', SYSDATE(), '', NULL, '服务监控菜单'); -INSERT INTO sys_menu VALUES (113, '缓存监控', 2, 12, 'cache', 'monitor/cache/index', 0, 0, 'C', '1', '1', 'monitor:cache:list', 'redis', '', SYSDATE(), '', NULL, '缓存监控菜单'); +INSERT INTO sys_menu VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', 0, 0, 'C', '0', '0', 'system:user:list', 'user', '', SYSDATE(), '', NULL, '用户管理菜单', 'menu.systemUser'); +INSERT INTO sys_menu VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', 0, 0, 'C', '0', '0', 'system:role:list', 'peoples', '', SYSDATE(), '', NULL, '角色管理菜单', 'menu.systemRole'); +INSERT INTO sys_menu VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', 0, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', '', SYSDATE(), '', NULL, '菜单管理菜单', 'menu.systemMenu'); +INSERT INTO sys_menu VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', 0, 0, 'C', '0', '0', 'system:dept:list', 'tree', '', SYSDATE(), '', NULL, '部门管理菜单', 'menu.systemDept'); +INSERT INTO sys_menu VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', 0, 0, 'C', '0', '0', 'system:post:list', 'post', '', SYSDATE(), '', NULL, '岗位管理菜单', 'menu.systemPost'); +INSERT INTO sys_menu VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', 0, 0, 'C', '0', '0', 'system:dict:list', 'dict', '', SYSDATE(), '', NULL, '', 'menu.systemDic'); +INSERT INTO sys_menu VALUES (106, '角色分配', 1, 2, 'roleusers', 'system/roleusers/index', 0, 0, 'C', '1', '0', 'system:roleusers:list', 'people', '', SYSDATE(), '', NULL, NULL, ''); +INSERT into sys_menu VALUES (107, '参数设置', 1, 8, 'config','system/config/index', 0, 0, 'C', '0', '0', 'system:config:list','edit', '', SYSDATE(), '', NULL, '', 'menu.systemParam'); +INSERT INTO sys_menu VALUES (108, '日志管理', 1, 10, 'log', '' , 0, 0, 'M', '0', '0', '', 'log', '', SYSDATE(), '', NULL, '日志管理菜单', 'menu.systemLog'); +INSERT INTO sys_menu VALUES (109, '通知公告', 1, 9, 'notice', 'system/notice/index', 0, 0, 'C', '0', '0', 'system:notice:list', 'message', '', SYSDATE(), '', NULL, '通知公告菜单', 'menu.systemNotice'); +INSERT INTO sys_menu VALUES (110, '定时任务', 2, 10, 'job', 'monitor/job/index', 0, 0, 'C', '0', '0', '', 'job', '', SYSDATE(), '', NULL, '定时任务菜单', 'menu.timedTask'); +INSERT INTO sys_menu VALUES (112, '服务监控', 2, 11, 'server', 'monitor/server/index', 0, 0, 'C', '0', '0', 'monitor:server:list', 'server', '', SYSDATE(), '', NULL, '服务监控菜单', 'menu.serviceMonitor'); +INSERT INTO sys_menu VALUES (113, '缓存监控', 2, 12, 'cache', 'monitor/cache/index', 0, 0, 'C', '1', '1', 'monitor:cache:list', 'redis', '', SYSDATE(), '', NULL, '缓存监控菜单', 'menu.cacheMonitor'); -INSERT INTO sys_menu VALUES (114, '表单构建', 3, 13, 'build', 'tool/build/index', 0, 0, 'C', '0', '0', 'tool:build:list', 'build', '', SYSDATE(), '', NULL, '表单构建菜单'); -INSERT INTO sys_menu VALUES (115, '代码生成', 3, 14, 'gen', 'tool/gen/index', 0, 0, 'C', '0', '0', 'tool:gen:list', 'code', '', SYSDATE(), '', NULL, '代码生成菜单'); -INSERT INTO sys_menu VALUES (116, '系统接口', 3, 15, 'swagger', 'tool/swagger/index', 0, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', '', SYSDATE(), '', NULL, '系统接口菜单'); -INSERT INTO sys_menu VALUES (117, '发送邮件', 3, 16, 'sendEmail', 'tool/email/sendEmail', 0, 0, 'C', '0', '0', 'tool:email:send', 'email', '', SYSDATE(), '', NULL, '发送邮件菜单'); -INSERT INTO sys_menu VALUES (118, '文章管理', 3, 18, 'article', NULL, 0, 0, 'M', '0', '0', NULL, 'documentation', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (114, '表单构建', 3, 13, 'build', 'tool/build/index', 0, 0, 'C', '0', '0', 'tool:build:list', 'build', '', SYSDATE(), '', NULL, '表单构建菜单', 'menu.formBuild'); +INSERT INTO sys_menu VALUES (115, '代码生成', 3, 14, 'gen', 'tool/gen/index', 0, 0, 'C', '0', '0', 'tool:gen:list', 'code', '', SYSDATE(), '', NULL, '代码生成菜单', 'menu.codeGeneration'); +INSERT INTO sys_menu VALUES (116, '系统接口', 3, 15, 'swagger', 'tool/swagger/index', 0, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', '', SYSDATE(), '', NULL, '系统接口菜单', 'menu.systemInterface'); +INSERT INTO sys_menu VALUES (117, '发送邮件', 3, 16, 'sendEmail', 'tool/email/sendEmail', 0, 0, 'C', '0', '0', 'tool:email:send', 'email', '', SYSDATE(), '', NULL, '发送邮件菜单', 'menu.sendEmail'); +INSERT INTO sys_menu VALUES (118, '文章管理', 3, 18, 'article', NULL, 0, 0, 'M', '0', '0', NULL, 'documentation', '', SYSDATE(), '', NULL, NULL, 'menu.systemArticle'); -INSERT INTO sys_menu VALUES (1047, '发布文章', 3, 2, '/article/publish', 'system/article/publish', 0, 0, 'C', '1', '0', 'system:article:publish', 'log', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (119, '文章列表', 118, 1, 'index', 'system/article/manager', 0, 0, 'C', '0', '0', 'system:article:list', 'list', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1047, '发布文章', 3, 2, '/article/publish', 'system/article/publish', 0, 0, 'C', '1', '0', 'system:article:publish', 'log', '', SYSDATE(), '', NULL, NULL, ''); +INSERT INTO sys_menu VALUES (119, '文章列表', 118, 1, 'index', 'system/article/manager', 0, 0, 'C', '0', '0', 'system:article:list', 'list', '', SYSDATE(), '', NULL, NULL, 'menu.articleList'); -- 三级菜单日志管理 -INSERT INTO sys_menu VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', 0, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', '', SYSDATE(), '', NULL, '操作日志菜单'); -INSERT INTO sys_menu VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', 0, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', '', SYSDATE(), '', NULL, '登录日志菜单'); +INSERT INTO sys_menu VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', 0, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', '', SYSDATE(), '', NULL, '操作日志菜单', 'menu.operLog'); +INSERT INTO sys_menu VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', 0, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', '', SYSDATE(), '', NULL, '登录日志菜单', 'menu.loginLog'); -- 用户管理 按钮 -INSERT INTO sys_menu VALUES (1001, '用户查询', 100, 1, '', '', 0, 0, 'F', '0', '0', 'system:user:query', '', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1002, '用户添加', 100, 2, '', '', 0, 0, 'F', '0', '0', 'system:user:add', '', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1003, '用户修改', 100, 3, '', '', 0, 0, 'F', '0', '0', 'system:user:edit', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1004, '用户删除', 100, 4, '', '', 0, 0, 'F', '0', '0', 'system:user:delete', '', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1005, '用户导出', 100, 5, '', '', 0, 0, 'F', '0', '0', 'system:user:export', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1006, '用户导入', 100, 6, '', '', 0, 0, 'F', '0', '0', 'system:user:import', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1007, '重置密码', 100, 7, '', '', 0, 0, 'F', '0', '0', 'system:user:resetPwd', '#', '', SYSDATE(), '', NULL, ''); +INSERT INTO sys_menu VALUES (1001, '用户查询', 100, 1, '', '', 0, 0, 'F', '0', '0', 'system:user:query', '', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1002, '用户添加', 100, 2, '', '', 0, 0, 'F', '0', '0', 'system:user:add', '', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1003, '用户修改', 100, 3, '', '', 0, 0, 'F', '0', '0', 'system:user:edit', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1004, '用户删除', 100, 4, '', '', 0, 0, 'F', '0', '0', 'system:user:delete', '', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1005, '用户导出', 100, 5, '', '', 0, 0, 'F', '0', '0', 'system:user:export', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1006, '用户导入', 100, 6, '', '', 0, 0, 'F', '0', '0', 'system:user:import', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1007, '重置密码', 100, 7, '', '', 0, 0, 'F', '0', '0', 'system:user:resetPwd', '#', '', SYSDATE(), '', NULL, '', NULL); -- 权限管理 按钮 -INSERT INTO sys_menu VALUES (1008, '角色查询', 101, 1, '', '', 0, 0, 'F', '0', '0', 'system:role:query', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1009, '角色新增', 101, 2, '', '', 0, 0, 'F', '0', '0', 'system:role:add', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1010, '角色修改', 101, 3, '', '', 0, 0, 'F', '0', '0', 'system:role:edit', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1011, '角色删除', 101, 4, '', '', 0, 0, 'F', '0', '0', 'system:role:remove', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1012, '角色授权', 101, 5, '', '', 0, 0, 'F', '0', '0', 'system:role:authorize', '#', '', SYSDATE(), '', NULL, ''); +INSERT INTO sys_menu VALUES (1008, '角色查询', 101, 1, '', '', 0, 0, 'F', '0', '0', 'system:role:query', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1009, '角色新增', 101, 2, '', '', 0, 0, 'F', '0', '0', 'system:role:add', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1010, '角色修改', 101, 3, '', '', 0, 0, 'F', '0', '0', 'system:role:edit', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1011, '角色删除', 101, 4, '', '', 0, 0, 'F', '0', '0', 'system:role:remove', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1012, '角色授权', 101, 5, '', '', 0, 0, 'F', '0', '0', 'system:role:authorize', '#', '', SYSDATE(), '', NULL, '', NULL); -- 分配用户 按钮 -INSERT INTO sys_menu VALUES (1029, '新增用户', 106, 2, '', '', 0, 0, 'F', '0', '0', 'system:roleusers:add', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1030, '删除用户', 106, 3, '', '', 0, 0, 'F', '0', '0', 'system:roleusers:remove', NULL, '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1029, '新增用户', 106, 2, '', '', 0, 0, 'F', '0', '0', 'system:roleusers:add', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1030, '删除用户', 106, 3, '', '', 0, 0, 'F', '0', '0', 'system:roleusers:remove', NULL, '', SYSDATE(), '', NULL, NULL, NULL); -- 菜单管理 按钮 -INSERT INTO sys_menu VALUES (1013, '菜单查询', 102, 1, '', '', 0, 0, 'F', '0', '0', 'system:menu:query', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1014, '菜单新增', 102, 2, '', '', 0, 0, 'F', '0', '0', 'system:menu:add', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1015, '菜单修改', 102, 3, '', '', 0, 0, 'F', '0', '0', 'system:menu:edit', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1016, '菜单删除', 102, 4, '', '', 0, 0, 'F', '0', '0', 'system:menu:remove', '#', '', SYSDATE(), '', NULL, ''); -INSERT INTO sys_menu VALUES (1017, '修改排序', 102, 5, '', '', 0, 0, 'F', '0', '0', 'system:menu:changeSort', '', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1013, '菜单查询', 102, 1, '', '', 0, 0, 'F', '0', '0', 'system:menu:query', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1014, '菜单新增', 102, 2, '', '', 0, 0, 'F', '0', '0', 'system:menu:add', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1015, '菜单修改', 102, 3, '', '', 0, 0, 'F', '0', '0', 'system:menu:edit', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1016, '菜单删除', 102, 4, '', '', 0, 0, 'F', '0', '0', 'system:menu:remove', '#', '', SYSDATE(), '', NULL, '', NULL); +INSERT INTO sys_menu VALUES (1017, '修改排序', 102, 5, '', '', 0, 0, 'F', '0', '0', 'system:menu:changeSort', '', '', SYSDATE(), '', NULL, NULL, NULL); -- 部门管理 按钮 -INSERT INTO sys_menu VALUES (1018, '部门查询', 103, 1, '', '', 0, 0, 'F', '0', '0', 'system:dept:query', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1019, '部门新增', 103, 2, '', '', 0, 0, 'F', '0', '0', 'system:dept:add', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1020, '部门修改', 103, 3, '', '', 0, 0, 'F', '0', '0', 'system:dept:update', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1021, '部门删除', 103, 4, '', '', 0, 0, 'F', '0', '0', 'system:dept:remove', NULL, '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1018, '部门查询', 103, 1, '', '', 0, 0, 'F', '0', '0', 'system:dept:query', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1019, '部门新增', 103, 2, '', '', 0, 0, 'F', '0', '0', 'system:dept:add', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1020, '部门修改', 103, 3, '', '', 0, 0, 'F', '0', '0', 'system:dept:update', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1021, '部门删除', 103, 4, '', '', 0, 0, 'F', '0', '0', 'system:dept:remove', NULL, '', SYSDATE(), '', NULL, NULL, NULL); -- 岗位管理 按钮 -INSERT INTO sys_menu VALUES (1022, '岗位查询', 104, 1, '', '', 0, 0, 'F', '0', '0', 'system:post:list', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1023, '岗位添加', 104, 2, '', '', 0, 0, 'F', '0', '0', 'system:post:add', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1024, '岗位删除', 104, 3, '', '', 0, 0, 'F', '0', '0', 'system:post:remove', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1025, '岗位编辑', 104, 4, '', '', 0, 0, 'F', '0', '0', 'system:post:edit', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1070, '岗位导出', 104, 4, '', '', 0, 0, 'F', '0', '0', 'system:post:export', '', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1022, '岗位查询', 104, 1, '', '', 0, 0, 'F', '0', '0', 'system:post:list', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1023, '岗位添加', 104, 2, '', '', 0, 0, 'F', '0', '0', 'system:post:add', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1024, '岗位删除', 104, 3, '', '', 0, 0, 'F', '0', '0', 'system:post:remove', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1025, '岗位编辑', 104, 4, '', '', 0, 0, 'F', '0', '0', 'system:post:edit', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1070, '岗位导出', 104, 4, '', '', 0, 0, 'F', '0', '0', 'system:post:export', '', '', SYSDATE(), '', NULL, NULL, NULL); -- 字典管理 按钮 -INSERT INTO sys_menu VALUES (1026, '字典新增', 105, 1, '', '', 0, 0, 'F', '0', '0', 'system:dict:add', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1027, '字典修改', 105, 2, '', '', 0, 0, 'F', '0', '0', 'system:dict:edit', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1028, '字典删除', 105, 3, '', '', 0, 0, 'F', '0', '0', 'system:dict:remove', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1071, '字典导出', 105, 3, '', '', 0, 0, 'F', '0', '0', 'system:dict:export', NULL, '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1026, '字典新增', 105, 1, '', '', 0, 0, 'F', '0', '0', 'system:dict:add', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1027, '字典修改', 105, 2, '', '', 0, 0, 'F', '0', '0', 'system:dict:edit', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1028, '字典删除', 105, 3, '', '', 0, 0, 'F', '0', '0', 'system:dict:remove', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1071, '字典导出', 105, 3, '', '', 0, 0, 'F', '0', '0', 'system:dict:export', NULL, '', SYSDATE(), '', NULL, NULL, NULL); -- 定时任务 按钮 -INSERT INTO sys_menu values (1032, '任务查询', 110, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:list', '#', '', sysdate(), '', null, ''); -INSERT INTO sys_menu VALUES (1033, '任务新增', 110, 2, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:add', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1034, '任务删除', 110, 3, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:delete', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1035, '任务修改', 110, 4, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:edit', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1036, '任务启动', 110, 5, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:start', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1037, '任务运行', 110, 7, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:run', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1038, '任务停止', 110, 8, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:stop', NULL, '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1039, '任务日志', 2, 0, 'job/log', 'monitor/job/log', 0, 0, 'C', '1', '0', 'monitor:job:query', 'log', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1040, '任务导出', 110, 10, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:export', NULL, '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu values (1032, '任务查询', 110, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:list', '#', '', sysdate(), '', null, '', NULL); +INSERT INTO sys_menu VALUES (1033, '任务新增', 110, 2, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:add', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1034, '任务删除', 110, 3, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:delete', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1035, '任务修改', 110, 4, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:edit', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1036, '任务启动', 110, 5, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:start', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1037, '任务运行', 110, 7, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:run', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1038, '任务停止', 110, 8, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:stop', NULL, '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1039, '任务日志', 2, 0, 'job/log', 'monitor/job/log', 0, 0, 'C', '1', '0', 'monitor:job:query', 'log', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1040, '任务导出', 110, 10, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:job:export', NULL, '', SYSDATE(), '', NULL, NULL, NULL); -- 操作日志 按钮 -INSERT INTO sys_menu values (1041, '操作查询', 500, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:operlog:query', '', '', sysdate(), '', null, NULL); -INSERT INTO sys_menu VALUES (1042, '操作删除', 500, 2, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:operlog:remove', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1043, '操作日志导出', 500,3, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:operlog:export', '', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu values (1041, '操作查询', 500, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:operlog:query', '', '', sysdate(), '', null, NULL, NULL); +INSERT INTO sys_menu VALUES (1042, '操作删除', 500, 2, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:operlog:remove', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1043, '操作日志导出', 500,3, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:operlog:export', '', '', SYSDATE(), '', NULL, NULL, NULL); -- 登录日志 按钮 -INSERT INTO sys_menu values (1044, '登录查询', 501, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:logininfor:query', '', '', sysdate(), '', null, NULL); -INSERT INTO sys_menu VALUES (1045, '登录删除', 501, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:logininfor:remove', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1046, '登录日志导出', 501, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:logininfor:export', '', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu values (1044, '登录查询', 501, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:logininfor:query', '', '', sysdate(), '', null, NULL, NULL); +INSERT INTO sys_menu VALUES (1045, '登录删除', 501, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:logininfor:remove', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1046, '登录日志导出', 501, 1, '#', NULL, 0, 0, 'F', '0', '0', 'monitor:logininfor:export', '', '', SYSDATE(), '', NULL, NULL, NULL); -- 文章管理 按钮 -INSERT INTO sys_menu VALUES (1048, '文章新增', 118, 3, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:add', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1049, '文章修改', 118, 4, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:update', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1050, '文章删除', 118, 5, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:delete', '', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1048, '文章新增', 118, 3, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:add', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1049, '文章修改', 118, 4, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:update', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1050, '文章删除', 118, 5, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:delete', '', '', SYSDATE(), '', NULL, NULL, NULL); -- 通知公告 按钮 -INSERT INTO sys_menu VALUES (1051, '查询公告', 109, 1, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:query', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1052, '新增公告', 109, 2, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:add', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1053, '删除公告', 109, 3, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:delete', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1054, '修改公告', 109, 4, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:update', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1055, '导出公告', 109, 5, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:export', '', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1051, '查询公告', 109, 1, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:query', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1052, '新增公告', 109, 2, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:add', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1053, '删除公告', 109, 3, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:delete', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1054, '修改公告', 109, 4, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:update', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1055, '导出公告', 109, 5, '#', NULL, 0, 0, 'F', '0', '0', 'system:notice:export', '', '', SYSDATE(), '', NULL, NULL, NULL); -- 代码生成 按钮 -INSERT INTO sys_menu VALUES (1060, '生成修改', 3, 1, '/gen/editTable', 'tool/gen/editTable', 0, 0, 'C', '1', '0', 'tool:gen:edit', '', '', SYSDATE(), '', NULL, NULL); -insert into sys_menu VALUES (1061, '生成查询', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:query', '', '', sysdate(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1062, '生成删除', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:remove', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1063, '导入代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:import', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1064, '生成代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:code', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (1065, '预览代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:preview', '', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (1060, '生成修改', 3, 1, '/gen/editTable', 'tool/gen/editTable', 0, 0, 'C', '1', '0', 'tool:gen:edit', '', '', SYSDATE(), '', NULL, NULL, NULL); +insert into sys_menu VALUES (1061, '生成查询', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:query', '', '', sysdate(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1062, '生成删除', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:remove', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1063, '导入代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:import', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1064, '生成代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:code', '', '', SYSDATE(), '', NULL, NULL, NULL); +INSERT INTO sys_menu VALUES (1065, '预览代码', 115, 1, '#', NULL, 0, 0, 'F', '0', '0', 'tool:gen:preview', '', '', SYSDATE(), '', NULL, NULL, NULL); -- 文件存储菜单 -INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time, remark) -VALUES ('文件存储', 3, 17, 'file', 'tool/file/index', 0, 0, 'C', '0', '0', 'tool:file:list', 'upload', '', sysdate(), '文件存储菜单'); +INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time, remark, menuName_key) +VALUES ('文件存储', 3, 17, 'file', 'tool/file/index', 0, 0, 'C', '0', '0', 'tool:file:list', 'upload', '', sysdate(), '文件存储菜单', 'menu.fileStorage'); -- 按钮父菜单id SELECT @fileMenuId := LAST_INSERT_ID(); @@ -377,6 +384,23 @@ VALUES ('修改', @fileMenuId, 4, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:upd INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time) VALUES ('导出', @fileMenuId, 5, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:export', '', sysdate()); +-- 多语言配置菜单 +INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time, menuName_key) +VALUES ('多语言配置', 1, 20, 'CommonLang', 'system/CommonLang', 0, 0, 'C', '0', '0', 'system:lang:list', 'language', 'system', sysdate(), 'menu.systemLang'); + +SELECT @langMenuId := LAST_INSERT_ID(); + +INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time) +VALUES ('查询', @langMenuId, 1, '#', NULL, 0, 0, 'F', '0', '0', 'system:lang:query', '', 'system', sysdate()); + +INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time) +VALUES ('新增', @langMenuId, 2, '#', NULL, 0, 0, 'F', '0', '0', 'system:lang:add', '', 'system', sysdate()); + +INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time) +VALUES ('删除', @langMenuId, 3, '#', NULL, 0, 0, 'F', '0', '0', 'system:lang:delete', '', 'system', sysdate()); + +INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time) +VALUES ('修改', @langMenuId, 4, '#', NULL, 0, 0, 'F', '0', '0', 'system:lang:edit', '', 'system', sysdate()); -- ---------------------------- -- Table structure for sys_oper_log @@ -784,3 +808,16 @@ CREATE TABLE `sys_file` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for sys_common_lang +-- ---------------------------- +DROP TABLE IF EXISTS `sys_common_lang`; +CREATE TABLE `sys_common_lang` ( + `id` bigint(20) NOT NULL COMMENT 'id', + `lang_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '语言code eg:zh-cn', + `lang_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '翻译key值', + `lang_name` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '翻译内容', + `addtime` datetime(0) NULL DEFAULT NULL COMMENT '添加时间', + PRIMARY KEY (`Id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; From 83e0ba78928995f55fe84a6559de69efcf935428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sat, 7 May 2022 22:16:38 +0800 Subject: [PATCH 06/13] update admin-mysql.sql --- document/admin-mysql.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/document/admin-mysql.sql b/document/admin-mysql.sql index c7bb693..a97f551 100644 --- a/document/admin-mysql.sql +++ b/document/admin-mysql.sql @@ -157,9 +157,9 @@ INSERT INTO `sys_dict_data` VALUES (28, 2, '失败', '1', 'sys_common_status', ' INSERT INTO `sys_dict_data` VALUES (29, 1, '发布', '1', 'sys_article_status', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:34:56', '', NULL, NULL); INSERT INTO `sys_dict_data` VALUES (30, 2, '草稿', '2', 'sys_article_status', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (31, 1, '中文', 'zh-cn', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (32, 2, '英文', 'en', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); -INSERT INTO `sys_dict_data` VALUES (33, 3, '繁体', 'zh-tw', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (32, 1, '中文', 'zh-cn', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (33, 2, '英文', 'en', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (34, 3, '繁体', 'zh-tw', 'sys_lang_type', NULL, NULL, NULL, '0', 'admin', '2021-08-19 10:35:06', '', NULL, NULL); SET FOREIGN_KEY_CHECKS = 1; @@ -386,7 +386,7 @@ VALUES ('导出', @fileMenuId, 5, '#', NULL, 0, 0, 'F', '0', '0', 'tool:file:exp -- 多语言配置菜单 INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time, menuName_key) -VALUES ('多语言配置', 1, 20, 'CommonLang', 'system/CommonLang', 0, 0, 'C', '0', '0', 'system:lang:list', 'language', 'system', sysdate(), 'menu.systemLang'); +VALUES ('多语言配置', 1, 20, 'CommonLang', 'system/commonLang/index', 0, 0, 'C', '0', '0', 'system:lang:list', 'language', 'system', sysdate(), 'menu.systemLang'); SELECT @langMenuId := LAST_INSERT_ID(); From 464f74914f8b0ee9c83d765c6236cf6ba5a106f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sat, 7 May 2022 22:16:59 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=A0storage?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Repository/BaseRepository.cs | 9 ++++++++- ZR.Repository/IBaseRepository.cs | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ZR.Repository/BaseRepository.cs b/ZR.Repository/BaseRepository.cs index 9da0605..c10ef49 100644 --- a/ZR.Repository/BaseRepository.cs +++ b/ZR.Repository/BaseRepository.cs @@ -149,7 +149,14 @@ namespace ZR.Repository throw; } } - + public IStorageable Storageable(T t) + { + return Context.Storageable(t); + } + public IStorageable Storageable(List t) + { + return Context.Storageable(t); + } /// /// /// diff --git a/ZR.Repository/IBaseRepository.cs b/ZR.Repository/IBaseRepository.cs index 488a4aa..6604d2a 100644 --- a/ZR.Repository/IBaseRepository.cs +++ b/ZR.Repository/IBaseRepository.cs @@ -37,7 +37,8 @@ namespace ZR.Repository int Update(Expression> where, Expression> columns); #endregion update - + IStorageable Storageable(T t); + IStorageable Storageable(List t); DbResult UseTran(Action action); DbResult UseTran(SqlSugarClient client, Action action); From 892094ded64f4360496dab158c35b1e55a341d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sat, 7 May 2022 22:17:32 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../System/CommonLangController.cs | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/CommonLangController.cs b/ZR.Admin.WebApi/Controllers/System/CommonLangController.cs index 77d82b7..04a89b0 100644 --- a/ZR.Admin.WebApi/Controllers/System/CommonLangController.cs +++ b/ZR.Admin.WebApi/Controllers/System/CommonLangController.cs @@ -184,22 +184,16 @@ namespace ZR.Admin.WebApi.Controllers var modal = parm.Adapt().ToUpdate(HttpContext); var list = _CommonLangService.GetList(f => f.LangKey == modal.LangKey); - _CommonLangService.Update(w => w.LangKey == modal.LangKey && w.LangCode == "zh-cn", it => new CommonLang() - { - LangName = modal.LangName, - }); + List langs = new(); + langs.Add(new CommonLang() { Addtime = DateTime.Now, LangCode = "zh-cn", LangKey = modal.LangKey, LangName = parm.LangName }); + langs.Add(new CommonLang() { Addtime = DateTime.Now, LangCode = "zh-tw", LangKey = modal.LangKey, LangName = parm.LangNameTw }); + langs.Add(new CommonLang() { Addtime = DateTime.Now, LangCode = "en", LangKey = modal.LangKey, LangName = parm.LangNameEn }); + var storage = _CommonLangService.Storageable(langs).WhereColumns(it => new { it.LangKey, it.LangCode }).ToStorage(); - _CommonLangService.Update(w => w.LangKey == modal.LangKey && w.LangCode == "zh-tw", it => new CommonLang() - { - LangName = parm.LangNameTw, - }); + long r = storage.AsInsertable.ExecuteReturnSnowflakeId();//执行插入 + storage.AsUpdateable.UpdateColumns(it => new { it.LangName }).ExecuteCommand();//执行修改 - _CommonLangService.Update(w => w.LangKey == modal.LangKey && w.LangCode == "en", it => new CommonLang() - { - LangName = parm.LangNameEn, - }); - - return ToResponse(1); + return ToResponse(r); } /// From aba8768c447f30daca5ca5ca01b432b52480dc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sun, 8 May 2022 13:47:01 +0800 Subject: [PATCH 09/13] update appsettings.json --- ZR.Admin.WebApi/appsettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZR.Admin.WebApi/appsettings.json b/ZR.Admin.WebApi/appsettings.json index bbead78..0421a75 100644 --- a/ZR.Admin.WebApi/appsettings.json +++ b/ZR.Admin.WebApi/appsettings.json @@ -12,13 +12,13 @@ }, "conn_zrAdmin_type": 1, //MySql = 0, SqlServer = 1 "conn_bus_type": 1, - "urls": "http://localhost:8888", //Ŀurl + "urls": "http://localhost:8888", //ĿurlĶ˿ǰ˶ӦdevServerҲҪ޸ "corsUrls": "http://localhost:8887", //ַǰĿǰ˷뵥Ҫã"," "JwtSettings": { "Issuer": "ZRAdmin.NET", "Audience": "ZRAdmin.NET", "SecretKey": "SecretKey-ZRADMIN.NET-20210101", - "Expire": 30 + "Expire": 30//jwt¼ʱ䣨֣ }, "DemoMode": false, //Ƿʾģʽ "DbKey": "", //ݿkey From 6ab0f86ca272a7aa858084df3ec3c4293667b593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sun, 8 May 2022 14:08:18 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=A0=E5=AF=BC=E8=88=AA=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CodeGenTemplate/TplControllers.txt | 24 +++------- .../wwwroot/CodeGenTemplate/TplIService.txt | 1 + .../wwwroot/CodeGenTemplate/TplModel.txt | 12 ++++- .../wwwroot/CodeGenTemplate/TplService.txt | 45 +++++++++++++------ ZR.CodeGenerator/CodeGeneratorTool.cs | 3 +- ZR.CodeGenerator/ZR.CodeGenerator.csproj | 2 +- ZR.Model/System/Generate/GenTable.cs | 6 +++ ZR.Model/ZR.Model.csproj | 2 +- ZR.Repository/ZR.Repository.csproj | 2 +- ZR.Service/System/GenTableService.cs | 6 ++- 10 files changed, 67 insertions(+), 36 deletions(-) diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt index eb25c9d..acf31de 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt @@ -1,26 +1,22 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Infrastructure; +using Infrastructure; using Infrastructure.Attribute; using Infrastructure.Enums; using Infrastructure.Model; using Mapster; +using Microsoft.AspNetCore.Mvc; using ${options.ModelsNamespace}.Dto; using ${options.ModelsNamespace}.Models; using ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNamespace}Service; using ${options.ApiControllerNamespace}.Extensions; using ${options.ApiControllerNamespace}.Filters; -using ZR.Common; -using Infrastructure.Extensions; -using System.Linq; +using ${options.BaseNamespace}.Common; namespace ${options.ApiControllerNamespace}.Controllers { /// /// ${genTable.functionName}Controller - /// + /// + /// @tableName ${genTable.TableName} /// @author ${replaceDto.Author} /// @date ${replaceDto.AddTime} /// @@ -97,14 +93,8 @@ $if(replaceDto.ShowBtnAdd) //从 Dto 映射到 实体 var modal = parm.Adapt<${replaceDto.ModelTypeName}>().ToCreate(HttpContext); - var response = _${replaceDto.ModelTypeName}Service.Insert(modal, it => new - { -$foreach(item in genTable.Columns) -$if((item.IsInsert)) - it.$item.CsharpField, -$end -${end} - }); + var response = _${replaceDto.ModelTypeName}Service.Add${replaceDto.ModelTypeName}(modal); + return ToResponse(response); } $end diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt index 310864d..a0c2451 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt @@ -19,5 +19,6 @@ namespace ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNam $if(genTable.TplCategory == "tree") List<${replaceDto.ModelTypeName}> GetTreeList(${replaceDto.ModelTypeName}QueryDto parm); $end + int Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm); } } diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplModel.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplModel.txt index 566d9b8..9c9236a 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplModel.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplModel.txt @@ -23,7 +23,7 @@ $if(replaceDto.ShowBtnExport) [EpplusTableColumn(Header = "$if(item.ColumnComment == "")${item.CsharpField}${else}${item.ColumnComment}${end}"$if(item.CsharpType == "DateTime"), NumberFormat = "yyyy-MM-dd HH:mm:ss"$end)] $end $if(item.IsPk || item.IsIncrement) - [SqlSugar.SugarColumn(IsPrimaryKey = ${item.IsPk.ToString().ToLower()}, IsIdentity = ${item.IsIncrement.ToString().ToLower()}$if(item.CsharpField.ToLower() != item.ColumnName.ToLower()), ColumnName = "$item.ColumnName"$end)] + [SugarColumn(IsPrimaryKey = ${item.IsPk.ToString().ToLower()}, IsIdentity = ${item.IsIncrement.ToString().ToLower()}$if(item.CsharpField.ToLower() != item.ColumnName.ToLower()), ColumnName = "$item.ColumnName"$end)] $elseif(item.CsharpField.ToLower() != item.ColumnName.ToLower()) [SugarColumn(ColumnName = "$item.ColumnName")] $end @@ -35,5 +35,15 @@ $if(genTable.TplCategory == "tree") [SugarColumn(IsIgnore = true)] public List<${replaceDto.ModelTypeName}> Children { get; set; } $end + +$if(genTable.TplCategory == "subNav" && genTable.SubTable != null) + [Navigate(NavigateType.Dynamic, null)] //自定义关系映射 + public ${genTable.SubTable.ClassName} Sub { get; set; } +$end + +$if(genTable.TplCategory == "subNavMore" && genTable.SubTable != null) + [Navigate(NavigateType.Dynamic, null)] //自定义关系映射 + public List<${genTable.SubTable.ClassName}> Sub { get; set; } +$end } } \ No newline at end of file diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt index b3e2add..219b23b 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt @@ -1,13 +1,13 @@ -using Infrastructure; +using System; +using SqlSugar; +using System.Collections.Generic; +using Infrastructure; using Infrastructure.Attribute; using ${options.ModelsNamespace}; using ${options.ModelsNamespace}.Dto; using ${options.ModelsNamespace}.Models; using ${options.IRepositoriesNamespace}; using ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNamespace}Service; -using System; -using SqlSugar; -using System.Collections.Generic; namespace ${options.ServicesNamespace}.${options.SubNamespace} { @@ -20,10 +20,10 @@ namespace ${options.ServicesNamespace}.${options.SubNamespace} [AppService(ServiceType = typeof(I${replaceDto.ModelTypeName}Service), ServiceLifetime = LifeTime.Transient)] public class ${replaceDto.ModelTypeName}Service : BaseService<${replaceDto.ModelTypeName}>, I${replaceDto.ModelTypeName}Service { - private readonly ${replaceDto.ModelTypeName}Repository _${replaceDto.ModelTypeName}repository; + private readonly ${replaceDto.ModelTypeName}Repository _${replaceDto.ModelTypeName}Repository; public ${replaceDto.ModelTypeName}Service(${replaceDto.ModelTypeName}Repository repository) { - _${replaceDto.ModelTypeName}repository = repository; + _${replaceDto.ModelTypeName}Repository = repository; } #region 业务逻辑代码 @@ -51,15 +51,17 @@ $elseif(column.CsharpType == "int" || column.CsharpType == "long") $end $end $end -$if(genTable.SortField != "" && genTable.SortField != null) - var response = _${replaceDto.ModelTypeName}repository - .GetPages(predicate.ToExpression(), parm, it => it.${genTable.SortField}, "${genTable.SortType}"); -$else - var response = _${replaceDto.ModelTypeName}repository + var response = _${replaceDto.ModelTypeName}Repository .Queryable() +$if(genTable.SubTableName != "" && genTable.SubTableName != null) + .Includes(it => it.Sub.MappingField(z => z.${genTable.SubTableFkName}, () => it.${replaceDto.PKName})) +$end +$if(genTable.SortField != "" && genTable.SortField != null) + .OrderBy("${genTable.SortField} ${genTable.SortType}") +$end .Where(predicate.ToExpression()) .ToPage(parm); -$end + return response; } @@ -85,12 +87,29 @@ $end $end $end - var response = _${replaceDto.ModelTypeName}repository.Queryable().Where(predicate.ToExpression()) + var response = _${replaceDto.ModelTypeName}Repository.Queryable().Where(predicate.ToExpression()) .ToTree(it => it.Children, it => it.${genTable.TreeParentCode}, 0); return response; } $end + /// + /// 添加${genTable.FunctionName} + /// + /// + /// + public int Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm) + { + var response = _${replaceDto.ModelTypeName}Repository.Insert(parm, it => new + { +${foreach(item in genTable.Columns)} +$if((item.IsInsert)) + it.$item.CsharpField, +$end +${end} + }); + return response; + } #endregion } } \ No newline at end of file diff --git a/ZR.CodeGenerator/CodeGeneratorTool.cs b/ZR.CodeGenerator/CodeGeneratorTool.cs index 3ea5e63..3f1ac66 100644 --- a/ZR.CodeGenerator/CodeGeneratorTool.cs +++ b/ZR.CodeGenerator/CodeGeneratorTool.cs @@ -513,7 +513,7 @@ namespace ZR.CodeGenerator /// private static void InitJntTemplate(GenerateDto dto, ReplaceDto replaceDto) { - Engine.Current.Clean(); + //Engine.Current.Clean(); dto.GenTable.Columns = dto.GenTable.Columns.OrderBy(x => x.Sort).ToList(); bool showCustomInput = dto.GenTable.Columns.Any(f => f.HtmlType.Equals(GenConstants.HTML_CUSTOM_INPUT, StringComparison.OrdinalIgnoreCase)); //jnt模板引擎全局变量 @@ -525,6 +525,7 @@ namespace ZR.CodeGenerator options.OutMode = OutMode.Auto; //options.DisableeLogogram = true;//禁用简写 options.Data.Set("refs", "$");//特殊标签替换 + options.Data.Set("t", "$");//特殊标签替换 options.Data.Set("modal", "$");//特殊标签替换 options.Data.Set("index", "$");//特殊标签替换 options.Data.Set("confirm", "$");//特殊标签替换 diff --git a/ZR.CodeGenerator/ZR.CodeGenerator.csproj b/ZR.CodeGenerator/ZR.CodeGenerator.csproj index 17787d8..bab66bd 100644 --- a/ZR.CodeGenerator/ZR.CodeGenerator.csproj +++ b/ZR.CodeGenerator/ZR.CodeGenerator.csproj @@ -12,6 +12,6 @@ - + diff --git a/ZR.Model/System/Generate/GenTable.cs b/ZR.Model/System/Generate/GenTable.cs index a50f585..a668623 100644 --- a/ZR.Model/System/Generate/GenTable.cs +++ b/ZR.Model/System/Generate/GenTable.cs @@ -103,6 +103,12 @@ namespace ZR.Model.System.Generate /// [SqlSugar.SugarColumn(IsIgnore = true)] public int[] CheckedBtn { get; set; } = new int[] { 1, 2, 3 }; + + /// + /// 字表信息 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public GenTable SubTable { get; set; } #endregion } } diff --git a/ZR.Model/ZR.Model.csproj b/ZR.Model/ZR.Model.csproj index d1a23b6..7915d47 100644 --- a/ZR.Model/ZR.Model.csproj +++ b/ZR.Model/ZR.Model.csproj @@ -7,7 +7,7 @@ - + diff --git a/ZR.Repository/ZR.Repository.csproj b/ZR.Repository/ZR.Repository.csproj index ae91d4c..e76ef0d 100644 --- a/ZR.Repository/ZR.Repository.csproj +++ b/ZR.Repository/ZR.Repository.csproj @@ -14,7 +14,7 @@ - + diff --git a/ZR.Service/System/GenTableService.cs b/ZR.Service/System/GenTableService.cs index 3a5afa0..a9fbe81 100644 --- a/ZR.Service/System/GenTableService.cs +++ b/ZR.Service/System/GenTableService.cs @@ -57,7 +57,11 @@ namespace ZR.Service.System { var info = GenTableRepository.GetId(tableId); SetTableFromOptions(info); - + if (info != null && !info.SubTableName.IsEmpty()) + { + info.SubTable = GenTableRepository.Queryable().Where(f => f.SubTableName == info.TableName).First(); + SetTableFromOptions(info?.SubTable); + } return info; } From f82a82387e14b9d33dc701bc0537abcc7bd3127b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sun, 8 May 2022 14:09:06 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=96=87=E5=AD=97=E5=A2=9E=E5=8A=A0=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/CodeGenTemplate/TplVue.txt | 6 ++-- .../wwwroot/CodeGenTemplate/TplVueSelect.txt | 6 ++-- .../wwwroot/CodeGenTemplate/v3/TreeVue.txt | 26 ++++++++++------ .../wwwroot/CodeGenTemplate/v3/Vue.txt | 31 ++++++++++++------- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt index 28199bf..f744b87 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt @@ -1,10 +1,10 @@