From a96986b721f2e5abd9a3754b4be369b4ef5100f6 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 06 5月 2025 15:37:11 +0800
Subject: [PATCH] 333
---
Weben_CMS专用代码生成器/Code/MainForm.cs | 44 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 41 insertions(+), 3 deletions(-)
diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs"
index e8da367..8821053 100644
--- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs"
+++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs"
@@ -104,6 +104,23 @@
string filePrefixName = this.tb_FileName.Text.Trim();//鏂囦欢鍓嶇紑鍚�
string modulelogo = this.tb_Modulelogo.Text.Trim();//妯″潡绠�鍐�
+
+ string _tb_DeleteAlertAttr = this.tb_DeleteAlertAttr.Text.Trim();//涓枃娉ㄩ噴
+ if (_tb_DeleteAlertAttr == "")
+ {
+ MessageBox.Show("璇疯緭鍏� 鍒犻櫎鎻愮ず瀛楁锛�");
+ this.tb_DeleteAlertAttr.Focus();
+ return;
+ }
+
+ string _tb_ValidateRepeatName = this.tb_ValidateRepeatName.Text.Trim();//涓枃娉ㄩ噴
+ if (_tb_ValidateRepeatName == "")
+ {
+ MessageBox.Show("璇疯緭鍏� 閲嶅鎬ф牎楠屽瓧娈碉紒");
+ this.tb_ValidateRepeatName.Focus();
+ return;
+ }
+
string _tb_LikeQueryAttrsName = this.tb_LikeQueryAttrsName.Text.Trim();//涓枃娉ㄩ噴
if (_tb_LikeQueryAttrsName == "")
{
@@ -201,6 +218,7 @@
GenerateCodeParam param = new GenerateCodeParam()
{
+ DeleteAlertAttr = CommonHelper.FirstLowercase(_tb_DeleteAlertAttr),
Modulelogo = modulelogo,
ChinaComment = chinaComment,
PageMenuName = menuName,
@@ -210,7 +228,8 @@
EntityName = entityName,
EntityInstanceName = tableAlias,
LikeQueryAttrs = _tb_LikeQueryAttrs,
- LikeQueryAttrsName = _tb_LikeQueryAttrsName
+ LikeQueryAttrsName = _tb_LikeQueryAttrsName,
+ ValidateRepeatName = this.tb_ValidateRepeatName.Text
};
//澶勭悊鏋氫妇绫诲瀷
List<EnumModel> enumList = new List<EnumModel>();
@@ -221,6 +240,19 @@
foreach (var item in arr_enumList)
{
var arr_single = item.Split('|');
+ enumList.Add(new EnumModel()
+ {
+ EnumAttrName = arr_single[0],
+ EnumType = arr_single[1],
+ EnumTypeDesc = arr_single[2]
+ });
+ }
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(str_enumList))
+ {
+ var arr_single = str_enumList.Split('|');
enumList.Add(new EnumModel()
{
EnumAttrName = arr_single[0],
@@ -356,8 +388,8 @@
tf = TextHelper.Export2File_V2(webRootPath + @"\Views", $"{param.EntityName}.module.scss", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
//22銆佺敓鎴� Views\NameSpacePath_Config 鏂囦欢
- str_generate = NameSpacePath_Config_Generate.CreateText(param);
- tf = TextHelper.Export2File_V2(webRootPath + @"\Views\config", $"{param.EntityName}.module.scss", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
+ str_generate = EntityNameClass_json_Generate.CreateText(param);
+ tf = TextHelper.Export2File_V2(webRootPath + @"\Views\config", $"{param.EntityName}.json", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
//23銆佺敓鎴� Views\NameSpacePath_Config 鏂囦欢
@@ -419,6 +451,12 @@
#endregion
+ //36銆佺敓鎴� AutoMapperProfile 鏂囦欢
+ var autoMapFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\MapperProfiles";
+ str_generate = AutoMapperProfile_Generate.CreateText(param);
+ tf = TextHelper.Export2File_V2(autoMapFilePath, param.EntityName + $"AutoMapperProfile.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
+
+
////鐢熸垚 OutputModel 鏂囦欢
//str_generate = OutputModel_Generate.CreateQueryModelLText(modulelogo, chinaComment, columnList, entityName);
--
Gitblit v1.9.3