diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplDto.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplDto.txt index a424ac5..f697b72 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplDto.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplDto.txt @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using ${options.ModelsNamespace}.Dto; using ${options.ModelsNamespace}.Models; @@ -12,6 +13,9 @@ namespace ${options.DtosNamespace}.Dto { $foreach(item in genTable.Columns) $if((item.IsInsert || item.IsEdit || item.IsPk || item.IsIncrement)) +$if(item.IsRequired) + [Required(ErrorMessage = "${item.ColumnComment}不能为空")] +$end public $item.CsharpType$item.RequiredStr $item.CsharpField { get; set; } $end $end diff --git a/ZR.CodeGenerator/CodeGenerateTemplate.cs b/ZR.CodeGenerator/CodeGenerateTemplate.cs index 1ea848c..8beb673 100644 --- a/ZR.CodeGenerator/CodeGenerateTemplate.cs +++ b/ZR.CodeGenerator/CodeGenerateTemplate.cs @@ -80,7 +80,7 @@ namespace ZR.CodeGenerator //时间 sb.AppendLine(" "); sb.AppendLine($" "); - sb.AppendLine($" "); + sb.AppendLine($" "); sb.AppendLine(" "); sb.AppendLine(" "); } @@ -192,7 +192,7 @@ namespace ZR.CodeGenerator if (dbFieldInfo.HtmlType == GenConstants.HTML_DATETIME) { sb.AppendLine($" "); - sb.AppendLine($" "); sb.AppendLine(" "); } @@ -270,6 +270,7 @@ namespace ZR.CodeGenerator } #endregion + //模板调用 public static string QueryExp(string propertyName, string queryType) { @@ -303,6 +304,7 @@ namespace ZR.CodeGenerator } return ""; } + /// /// 格式化字典数据显示到table /// diff --git a/ZR.Service/System/SysTasksLogService.cs b/ZR.Service/System/SysTasksLogService.cs index f2a2ace..4e66a94 100644 --- a/ZR.Service/System/SysTasksLogService.cs +++ b/ZR.Service/System/SysTasksLogService.cs @@ -37,9 +37,5 @@ namespace ZR.Service.System return logModel; } - public PagedInfo GetPages(Expression> where, PagerInfo parm, Expression> order, string orderType) - { - throw new NotImplementedException(); - } } } diff --git a/ZR.Vue/src/components/FileUpload/index.vue b/ZR.Vue/src/components/FileUpload/index.vue index 097d485..0bba384 100644 --- a/ZR.Vue/src/components/FileUpload/index.vue +++ b/ZR.Vue/src/components/FileUpload/index.vue @@ -1,8 +1,7 @@