From 45143e5b5d76dd816070927bde71b44f27f35e93 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: Tue, 4 Jul 2023 21:09:54 +0800
Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=BB=A3=E7=A0=81=E7=94=9F?=
=?UTF-8?q?=E6=88=90=E6=96=B0=E5=A2=9E=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E7=94=9F=E6=88=90=E9=80=89=E6=8B=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.Admin.WebApi/wwwroot/CodeGenTemplate/v3/Vue.txt | 14 ++++++++++++++
ZR.CodeGenerator/CodeGeneratorTool.cs | 3 ++-
ZR.CodeGenerator/Model/ReplaceDto.cs | 4 ++++
ZR.Model/System/Generate/GenTable.cs | 6 +++++-
4 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/v3/Vue.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/v3/Vue.txt
index d101e69..2653e4e 100644
--- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/v3/Vue.txt
+++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/v3/Vue.txt
@@ -201,6 +201,19 @@ $end
$end
+$if(replaceDto.OperBtnStyle == 2)
+
+$if(replaceDto.ShowBtnView)
+
+$end
+$if(replaceDto.ShowBtnEdit)
+
+$end
+$if(replaceDto.ShowBtnDelete)
+
+$end
+
+$else
$if(replaceDto.ShowBtnView)
$end
@@ -209,6 +222,7 @@ $if(replaceDto.ShowBtnEdit)
$end
$if(replaceDto.ShowBtnDelete)
+$end
$end
diff --git a/ZR.CodeGenerator/CodeGeneratorTool.cs b/ZR.CodeGenerator/CodeGeneratorTool.cs
index 1020638..3bf61f0 100644
--- a/ZR.CodeGenerator/CodeGeneratorTool.cs
+++ b/ZR.CodeGenerator/CodeGeneratorTool.cs
@@ -50,7 +50,8 @@ namespace ZR.CodeGenerator
ShowBtnView = dto.GenTable.Options.CheckedBtn.Any(f => f == 5),
ShowBtnTruncate = dto.GenTable.Options.CheckedBtn.Any(f => f == 6),
ShowBtnMultiDel = dto.GenTable.Options.CheckedBtn.Any(f => f == 7),
- ViewFileName = dto.GenTable.BusinessName.FirstUpperCase()
+ ViewFileName = dto.GenTable.BusinessName.FirstUpperCase(),
+ OperBtnStyle = dto.GenTable.Options.OperBtnStyle
};
var columns = dto.GenTable.Columns;
diff --git a/ZR.CodeGenerator/Model/ReplaceDto.cs b/ZR.CodeGenerator/Model/ReplaceDto.cs
index 6ea178f..e2f974e 100644
--- a/ZR.CodeGenerator/Model/ReplaceDto.cs
+++ b/ZR.CodeGenerator/Model/ReplaceDto.cs
@@ -69,5 +69,9 @@ namespace ZR.CodeGenerator.Model
/// vue页面文件名
///
public string ViewFileName { get; set; }
+ ///
+ /// 操作按钮样式
+ ///
+ public int OperBtnStyle { get; set; }
}
}
diff --git a/ZR.Model/System/Generate/GenTable.cs b/ZR.Model/System/Generate/GenTable.cs
index ec49963..6e3199e 100644
--- a/ZR.Model/System/Generate/GenTable.cs
+++ b/ZR.Model/System/Generate/GenTable.cs
@@ -105,7 +105,7 @@ namespace ZR.Model.System.Generate
public class Options
{
- public long ParentMenuId { get; set; } = 0;
+ public long ParentMenuId { get; set; }
public string SortType { get; set; } = "asc";
public string SortField { get; set; } = string.Empty;
public string TreeCode { get; set; } = string.Empty;
@@ -128,5 +128,9 @@ namespace ZR.Model.System.Generate
/// 自动生成菜单
///
public bool GenerateMenu { get; set; }
+ ///
+ /// 操作按钮样式
+ ///
+ public int OperBtnStyle { get; set; } = 1;
}
}