From f12cbfe9cba26c1a0e3abf1fe09a3c9cd9586a81 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周日, 11 5月 2025 11:59:39 +0800
Subject: [PATCH] 优化 代码生成器

---
 Weben_CMS专用代码生成器/Code/Generate/Entity/InputQueryModel_Generate.cs          |    2 
 Weben_CMS专用代码生成器/Code/MainForm.cs                                          |    2 
 Weben_CMS专用代码生成器/Code/Model/GenerateCodeParam.cs                           |    4 +
 Weben_CMS专用代码生成器/Code/Templete/Entity/InputQueryModel模板.txt                |    1 
 Weben_CMS专用代码生成器/Code/File/GenerateCodeConfigParamFiles/出入库单据详情.txt        |    2 
 Weben_CMS专用代码生成器/Code/MainForm.Designer.cs                                 |   28 ++++----
 Weben_CMS专用代码生成器/Code/File/GenerateCodeConfigParamFiles/出入库单据.txt          |    2 
 Weben_CMS专用代码生成器/Code/App.config                                           |    3 
 Weben_CMS专用代码生成器/Code/Utility/StructStrHelper.cs                           |   77 ++++++++++++++++++++-----
 Weben_CMS专用代码生成器/Code/Templete/Web/Controllers/EntityModeQueryDrawer模板.txt |    2 
 10 files changed, 88 insertions(+), 35 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/App.config" "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/App.config"
index ce09596..389ad5f 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/App.config"
+++ "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/App.config"
@@ -1,9 +1,10 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <connectionStrings>
+    <add name="Shao_鏈湴WmsMysql" connectionString="Server=localhost;Database=cms.plugin.pipelinelems;Uid=root;Pwd=123abc.com;" />
     <add name="鏈湴_MySql_CMS" connectionString="Server=localhost;Database=07a6b2f4bbb04e8bb23a9f17a4a769c2_project;Uid=root;Pwd=123abc.com;" />
 	  <add name="ZS_鏈湴WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" />
-    <add name="Shao_鏈湴WmsMysql" connectionString="Server=localhost;Database=cms.plugin.pipelinelems;Uid=root;Pwd=123abc.com;" />
+   
     <!--  <add name="LA22012_姝︽眽鐗ч噹_鐢熶骇搴揰浼熸湰鐜" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=123abc.com" /> 
     <add name="LA22012_姝︽眽鐗ч噹_鐢熶骇搴揰26娴嬭瘯鐜" connectionString="Data Source=172.27.96.26;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=MJC!2022@wms" />
     <add name="LA22012_姝︽眽鐗ч噹_澶囦欢搴揰浼熸湰鐜" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=123abc.com" />
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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256.txt" "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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256.txt"
index 7c2b782..a59d60b 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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256.txt"
+++ "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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256.txt"
@@ -9,6 +9,6 @@
 [妯$硦鏌ヨ瀛楁]:'OrderNo', 'MaterialNo', 'MaterialBatch'
 [妯$硦鏌ヨ瀛楁鍚峕:璇疯緭鍏ュ崟鎹彿/鐗╂枡缂栧彿/鎵规
 [椤圭洰鍛藉悕绌洪棿]:HIAWms
-[鏋氫妇绫诲瀷瀛楁闆嗗悎]:OrderStatus|OrderStatusEnum|OrderStatusDesc,OrderType|OrderTypeEnum|OrderTypeDesc,StockType|StockTypeEnum|StockTypeDesc
+[鏋氫妇绫诲瀷瀛楁闆嗗悎]:OrderStatus,OrderStatusEnum&OrderType,OrderTypeEnum&StockType,StockTypeEnum
 [鍓嶇鏍规枃浠跺す鍚嶇О]:web
 [鎺掑簭]:CreationTime
\ No newline at end of file
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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256\350\257\246\346\203\205.txt" "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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256\350\257\246\346\203\205.txt"
index ad2ca63..3b619b8 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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256\350\257\246\346\203\205.txt"
+++ "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/File/GenerateCodeConfigParamFiles/\345\207\272\345\205\245\345\272\223\345\215\225\346\215\256\350\257\246\346\203\205.txt"
@@ -9,6 +9,6 @@
 [妯$硦鏌ヨ瀛楁]:'OrderNo', 'MaterialNo', 'MaterialId'
 [妯$硦鏌ヨ瀛楁鍚峕:璇疯緭鍏ュ崟鎹彿/鐗╂枡缂栧彿/鐗╂枡ID
 [椤圭洰鍛藉悕绌洪棿]:HIAWms
-[鏋氫妇绫诲瀷瀛楁闆嗗悎]:OrderType|OrderTypeEnum|OrderTypeDesc
+[鏋氫妇绫诲瀷瀛楁闆嗗悎]:OrderType,OrderTypeEnum
 [鍓嶇鏍规枃浠跺す鍚嶇О]:web
 [鎺掑簭]:CreationTime
\ No newline at end of file
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/Generate/Entity/InputQueryModel_Generate.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/Generate/Entity/InputQueryModel_Generate.cs"
index 6d6b398..5a1981c 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/Generate/Entity/InputQueryModel_Generate.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/Generate/Entity/InputQueryModel_Generate.cs"
@@ -26,7 +26,7 @@
             List<ColumnModel> newColumnNameList = ListHelper.OnlyRemoveId(param.ColumnNameList);
             for (int i = 0; i < newColumnNameList.Count; ++i)
             {
-                attrString += StructStrHelper.GenerateAttributeForQueryModel(newColumnNameList[i]);
+                attrString += StructStrHelper.GenerateAttributeForQueryModel(newColumnNameList[i], param);
                 attrString += StructStrHelper.GenerateAttributeForQueryModelMode(newColumnNameList[i]);
             }
             str = str.Replace("$QueryAttributes$", attrString);
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.Designer.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.Designer.cs"
index dfb041a..d0ab2c9 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.Designer.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.Designer.cs"
@@ -60,6 +60,7 @@
             this.lbl_DataSource = new System.Windows.Forms.Label();
             this.cmb_DataSource = new System.Windows.Forms.ComboBox();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.label1 = new System.Windows.Forms.Label();
             this.tb_DeleteAlertAttr = new System.Windows.Forms.TextBox();
             this.label25 = new System.Windows.Forms.Label();
             this.tb_ValidateRepeatName = new System.Windows.Forms.TextBox();
@@ -78,7 +79,6 @@
             this.tb_FilePath = new System.Windows.Forms.TextBox();
             this.btn_SelectFile = new System.Windows.Forms.Button();
             this.button1 = new System.Windows.Forms.Button();
-            this.label1 = new System.Windows.Forms.Label();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.SuspendLayout();
@@ -402,6 +402,16 @@
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "鑷畾涔夐厤缃�";
             // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.ForeColor = System.Drawing.Color.Red;
+            this.label1.Location = new System.Drawing.Point(976, 185);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(245, 12);
+            this.label1.TabIndex = 66;
+            this.label1.Text = "濡傛灉涓虹┖锛岀郴缁熼粯璁ゆ墍鏈夊瓧绗︿覆鐨勫睍绀哄垪鏌ヨ";
+            // 
             // tb_DeleteAlertAttr
             // 
             this.tb_DeleteAlertAttr.Location = new System.Drawing.Point(552, 246);
@@ -503,10 +513,10 @@
             this.label19.AutoSize = true;
             this.label19.Location = new System.Drawing.Point(318, 346);
             this.label19.Name = "label19";
-            this.label19.Size = new System.Drawing.Size(563, 12);
+            this.label19.Size = new System.Drawing.Size(485, 12);
             this.label19.TabIndex = 53;
-            this.label19.Text = "PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|Mate" +
-    "rialTypeDesc";
+            this.label19.Text = "PurchaseType,PurchaseTypeEnum&MaterialType,MaterialTypeEnum&IsMainBranch,YesNoEnu" +
+    "m";
             // 
             // label18
             // 
@@ -553,16 +563,6 @@
             this.button1.Text = "娓呯┖瀵煎叆璺緞锛侊紒";
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click_1);
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.ForeColor = System.Drawing.Color.Red;
-            this.label1.Location = new System.Drawing.Point(976, 185);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(245, 12);
-            this.label1.TabIndex = 66;
-            this.label1.Text = "濡傛灉涓虹┖锛岀郴缁熼粯璁ゆ墍鏈夊瓧绗︿覆鐨勫睍绀哄垪鏌ヨ";
             // 
             // MainForm
             // 
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 a3cde54..6e9bc75 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"
@@ -43,7 +43,7 @@
             this.tb_LikeQueryAttrsName.Text = "璇疯緭鍏ョ墿鏂欑紪鐮�/鐗╂枡鍚嶇О/澶囨敞";
 
             //this.tb_EntityProName.Text = "wmsMaterial";//瀹炰綋绫诲璞″悕
-            this.tb_EnumList.Text = "PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|MaterialTypeDesc,IsMainBranch|YesNoEnum|IsMainBranchDesc";
+            this.tb_EnumList.Text = "PurchaseType,PurchaseTypeEnum&MaterialType,MaterialTypeEnum&IsMainBranch,YesNoEnum";
 
             this.cmb_DataSource.DropDownStyle = ComboBoxStyle.DropDownList;
             List<ListItem> itemList = CommonHelper.GetDataSources();
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/Model/GenerateCodeParam.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/Model/GenerateCodeParam.cs"
index e855d58..f12717a 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/Model/GenerateCodeParam.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/Model/GenerateCodeParam.cs"
@@ -90,6 +90,10 @@
         /// 鏋氫妇灞炴�у悕
         /// </summary>
         public string EnumAttrName { get; set; }
+
+        /// <summary>
+        /// 鏋氫妇绫诲瀷
+        /// </summary>
         public string EnumType { get; set; }
         public string EnumTypeDesc { get; set; }
 
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/Templete/Entity/InputQueryModel\346\250\241\346\235\277.txt" "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/Templete/Entity/InputQueryModel\346\250\241\346\235\277.txt"
index 15b20c5..dba75f6 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/Templete/Entity/InputQueryModel\346\250\241\346\235\277.txt"
+++ "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/Templete/Entity/InputQueryModel\346\250\241\346\235\277.txt"
@@ -1,3 +1,4 @@
+using CMS.Plugin.$NameSpacePath$.Domain.Shared.Enums;
 using CmsQueryExtensions.Extension;
 using Volo.Abp.Application.Dtos;
 
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/Templete/Web/Controllers/EntityModeQueryDrawer\346\250\241\346\235\277.txt" "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/Templete/Web/Controllers/EntityModeQueryDrawer\346\250\241\346\235\277.txt"
index edb796f..54c1878 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/Templete/Web/Controllers/EntityModeQueryDrawer\346\250\241\346\235\277.txt"
+++ "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/Templete/Web/Controllers/EntityModeQueryDrawer\346\250\241\346\235\277.txt"
@@ -75,7 +75,7 @@
     },
   })
   /**
-   * 添加的form字段
+   * 高级查询的form字段
    */
   const formItems = reactive([
     $PageAddFormAttributes_Query$
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/Utility/StructStrHelper.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/Utility/StructStrHelper.cs"
index ec86934..aee0a90 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/Utility/StructStrHelper.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/Utility/StructStrHelper.cs"
@@ -237,6 +237,7 @@
                 attrStr += "        /// " + columnModel.Description + "\n";
                 attrStr += "        /// </summary>\n";
 
+                var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                 DataTypeEnum myDataType = (DataTypeEnum)Enum.Parse(typeof(DataTypeEnum), "dt_" + columnModel.DataType);
                 switch (myDataType)
                 {
@@ -259,12 +260,21 @@
                     case DataTypeEnum.dt_tinyint:
                     case DataTypeEnum.dt_bit:
                         if (columnModel.IsNullable) { str_NullFlag = "? "; }
-                        attrStr += "        public bool" + str_NullFlag + attr + " { get; set; }\n";
-                        attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        if (findEnumObj != null)
+                        {
+                            attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
+                        else
+                        {
+                            attrStr += "        public bool" + str_NullFlag + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
+
                         break;
                     case DataTypeEnum.dt_int:
                         if (columnModel.IsNullable) { str_NullFlag = "? "; }
-                        var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
+
                         if (findEnumObj != null)
                         {
                             attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
@@ -454,6 +464,7 @@
                 attrStr += "        /// " + columnModel.Description + "\n";
                 attrStr += "        /// </summary>\n";
 
+                var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                 DataTypeEnum myDataType = (DataTypeEnum)Enum.Parse(typeof(DataTypeEnum), "dt_" + columnModel.DataType);
                 switch (myDataType)
                 {
@@ -476,12 +487,21 @@
                     case DataTypeEnum.dt_tinyint:
                     case DataTypeEnum.dt_bit:
                         if (columnModel.IsNullable) { str_NullFlag = "? "; }
-                        attrStr += "        public bool" + str_NullFlag + attr + " { get; set; }\n";
-                        attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+
+                        if (findEnumObj != null)
+                        {
+                            attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
+                        else
+                        {
+                            attrStr += "        public bool" + str_NullFlag + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
                         break;
                     case DataTypeEnum.dt_int:
                         if (columnModel.IsNullable) { str_NullFlag = "? "; }
-                        var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
+
                         if (findEnumObj != null)
                         {
                             attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
@@ -511,7 +531,6 @@
                 //澧炲姞瀵规灇涓剧被鍨嬬殑鏀寔 
                 if (param.EnumList?.Count > 0)
                 {
-                    var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                     if (findEnumObj != null)
                     {
                         attrStr += "        /// <summary>\n";
@@ -558,6 +577,7 @@
                 attrStr += "        /// </summary>\n";
                 attrStr += $"        [ExcelColumn(Name = \"{columnModel.Description}\", Width = 25)]\n";
 
+                var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                 DataTypeEnum myDataType = (DataTypeEnum)Enum.Parse(typeof(DataTypeEnum), "dt_" + columnModel.DataType);
                 switch (myDataType)
                 {
@@ -580,12 +600,21 @@
                     case DataTypeEnum.dt_tinyint:
                     case DataTypeEnum.dt_bit:
                         if (columnModel.IsNullable) { str_NullFlag = "? "; }
-                        attrStr += "        public bool" + str_NullFlag + attr + " { get; set; }\n";
-                        attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        if (findEnumObj != null)
+                        {
+                            attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
+                        else
+                        {
+                            attrStr += "        public bool" + str_NullFlag + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
+
                         break;
                     case DataTypeEnum.dt_int:
                         if (columnModel.IsNullable) { str_NullFlag = "? "; }
-                        var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
+
                         if (findEnumObj != null)
                         {
                             attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + attr + " { get; set; }\n";
@@ -620,7 +649,7 @@
         /// </summary>
         /// <param name="columnModel"></param>
         /// <returns></returns>
-        public static string GenerateAttributeForQueryModel(ColumnModel columnModel)
+        public static string GenerateAttributeForQueryModel(ColumnModel columnModel, GenerateCodeParam param)
         {
             try
             {
@@ -643,6 +672,7 @@
                 attrStr += "        /// " + columnModel.Description + "\n";
                 attrStr += "        /// </summary>\n";
 
+                var findEnumObj = param.EnumList.Where(x => x.EnumAttrName == attr).FirstOrDefault();
                 DataTypeEnum myDataType = (DataTypeEnum)Enum.Parse(typeof(DataTypeEnum), "dt_" + columnModel.DataType);
                 switch (myDataType)
                 {
@@ -663,13 +693,29 @@
                         attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
                         break;
                     case DataTypeEnum.dt_int:
-                        attrStr += "        public int" + str_NullFlag + emptyStr + attr + " { get; set; }\n";
-                        attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        if (findEnumObj != null)
+                        {
+                            attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + emptyStr + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
+                        else
+                        {
+                            attrStr += "        public int" + str_NullFlag + emptyStr + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
                         break;
                     case DataTypeEnum.dt_bit:
                     case DataTypeEnum.dt_tinyint:
-                        attrStr += "        public bool" + str_NullFlag + emptyStr + attr + " { get; set; }\n";
-                        attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        if (findEnumObj != null)
+                        {
+                            attrStr += $"        public {findEnumObj.EnumType}" + str_NullFlag + emptyStr + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
+                        else
+                        {
+                            attrStr += "        public bool" + str_NullFlag + emptyStr + attr + " { get; set; }\n";
+                            attrStr += "\n";//鏈�鍚庢槸鍔犱竴涓┖鏍�
+                        }
                         break;
                     default:
                         attrStr += "        public string" + emptyStr + attr + " { get; set; }\n";
@@ -2067,6 +2113,7 @@
                             {
                                 elment = "select";
                                 sb.Append("                   el: '" + elment + "', \n");
+                                sb.Append("                   clearable:true, \n");
                                 sb.Append("                   option: [], \n");
                                 isWriteInt = false;
                             }

--
Gitblit v1.9.3