修复input模板的bug

This commit is contained in:
轻风2016 2024-08-28 16:03:26 +08:00
parent 51b594c3bd
commit 2dc09a1196

View File

@ -86,7 +86,7 @@ if (@column.WhetherAddUpdate == "Y"){
@if(@column.WhetherRequired=="Y"){ @if(@column.WhetherRequired=="Y"){
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")] @:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
} }
@if(@column.NetType.StartsWith("string")&&!@column.RuleItems.Any(t=>t.Type=="length")){ @if(@column.NetType.StartsWith("string")&&!@column.RuleItems.Any(t=>t.Type=="length")&&@column.ColumnLength>0){
@:[StringLength(@(@column.ColumnLength), ErrorMessage = "@(@column.ColumnComment)不能超过@(@column.ColumnLength)个字符")] @:[StringLength(@(@column.ColumnLength), ErrorMessage = "@(@column.ColumnComment)不能超过@(@column.ColumnLength)个字符")]
} }
@if(@column.AnyRule){ @if(@column.AnyRule){
@ -143,7 +143,7 @@ if (@column.WhetherAddUpdate == "Y"){
@if(@column.WhetherRequired=="Y"){ @if(@column.WhetherRequired=="Y"){
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")] @:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
} }
@if(@column.NetType.StartsWith("string")&&!@column.RuleItems.Any(t=>t.Type=="length")){ @if(@column.NetType.StartsWith("string")&&!@column.RuleItems.Any(t=>t.Type=="length")&&@column.ColumnLength>0){
@:[StringLength(@(@column.ColumnLength), ErrorMessage = "@(@column.ColumnComment)不能超过@(@column.ColumnLength)个字符")] @:[StringLength(@(@column.ColumnLength), ErrorMessage = "@(@column.ColumnComment)不能超过@(@column.ColumnLength)个字符")]
} }
@if(@column.AnyRule){ @if(@column.AnyRule){