diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_InputDto.cs.vm b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_InputDto.cs.vm index c5c9d3d4..64b7580d 100644 --- a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_InputDto.cs.vm +++ b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_InputDto.cs.vm @@ -178,14 +178,14 @@ if (@column.WhetherAddUpdate == "Y"){ @:public class Exists@(RemoteField)Input @:{ @:/// - @:/// 字段名称 + @:/// 字段值 @:/// - @:public string FieldName { get; set; } + @:public string FieldValue { get; set; } @: @:/// - @:/// 旧字段名 + @:/// 旧字段值 @:/// - @:public string OldFieldName { get; set; } + @:public string OldFieldValue { get; set; } @:} } @{ diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_Service.cs.vm b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_Service.cs.vm index c9f0901c..88b7d381 100644 --- a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_Service.cs.vm +++ b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/service_Service.cs.vm @@ -175,7 +175,7 @@ if (@column.ColumnKey == "True"){ var entity = input.Adapt<@(@Model.ClassName)>(); @if(Model.RemoteVerify){ @://验证重复值 - @:if (await _advertsRep.IsAnyAsync(t => t.@(RemoteField) == entity.@(RemoteField) && t.@(@PKName) != entity.@(@PKName))) + @:if (await _@(@Model.LowerClassName)Rep.IsAnyAsync(t => t.@(RemoteField) == entity.@(RemoteField) && t.@(@PKName) != entity.@(@PKName))) @:{ @://已存在 @:throw Oops.Oh(ErrorCodeEnum.D1006); @@ -272,20 +272,20 @@ if(@column.EffectType == "ApiTreeSelect" && !definedObjects.ContainsKey("@(@colu @:[DisplayName("检查@(RemoteField)字段是否可用")] @:public async Task Exists@(RemoteField)Async(Exists@(RemoteField)Input param) @:{ - @:if (string.IsNullOrWhiteSpace(param.FieldName)) + @:if (string.IsNullOrWhiteSpace(param.FieldValue)) @:{ @:return false; @:} - @:if (!string.IsNullOrWhiteSpace(param.OldFieldName)) + @:if (!string.IsNullOrWhiteSpace(param.OldFieldValue)) @:{ - @:if (param.FieldName.Trim() == param.OldFieldName.Trim()) + @:if (param.FieldValue.Trim() == param.OldFieldValue.Trim()) @:{ @://编辑状态下触发的 @:return true; @:} @:} - @:return !(await _@(@Model.LowerClassName)Rep.IsAnyAsync(t => t.@(RemoteField).Equals(param.FieldName.Trim()))); + @:return !(await _@(@Model.LowerClassName)Rep.IsAnyAsync(t => t.@(RemoteField).Equals(param.FieldValue.Trim()))); @:} } diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_editDialog.vue.vm b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_editDialog.vue.vm index 7a453f2c..91aedc53 100644 --- a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_editDialog.vue.vm +++ b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_editDialog.vue.vm @@ -264,8 +264,8 @@ const rules = ref({ @:callback(new Error("请输入@(@column.ColumnComment)")); @:} @:let param = { - @:fieldName: value, - @:oldFieldName: state.ruleForm.old@(RemoteField) + @:fieldValue: value, + @:oldFieldValue: state.ruleForm.old@(RemoteField) @:}; @:exists@(RemoteField)(param).then((res) => { @:if (res.data.result) {