From 023df80e8335934f2ae5aaa4268c92701823a8b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=BD=BB=E9=A3=8E2016?= <616036448@qq.com>
Date: Wed, 28 Aug 2024 20:19:05 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsevice=E6=A8=A1=E6=9D=BFb?=
=?UTF-8?q?ug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin.NET.Web.Entry/wwwroot/template/service_Service.cs.vm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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..e514874e 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);
From 51f992e63791307c6b1a1233632f2347ca008ce2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=BD=BB=E9=A3=8E2016?= <616036448@qq.com>
Date: Wed, 28 Aug 2024 20:35:46 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wwwroot/template/service_InputDto.cs.vm | 8 ++++----
.../wwwroot/template/service_Service.cs.vm | 8 ++++----
.../wwwroot/template/web_views_editDialog.vue.vm | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
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 e514874e..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
@@ -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) {