From 36fc063fec47f54b4cc3eedd5ddb85a5ac5c6cd8 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 20 5月 2025 11:38:17 +0800
Subject: [PATCH] 高级查询过滤优化了,不再用这种方式了

---
 Weben_CMS专用代码生成器/Code/Generate/Web/Controllers/EntityModeQueryDrawer_Generate.cs |    7 ++++---
 Weben_CMS专用代码生成器/Code/Templete/Web/Controllers/EntityModeQueryDrawer模板.txt       |   20 +++++++++++++++++---
 2 files changed, 21 insertions(+), 6 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/Generate/Web/Controllers/EntityModeQueryDrawer_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/Web/Controllers/EntityModeQueryDrawer_Generate.cs"
index a408304..2e42723 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/Web/Controllers/EntityModeQueryDrawer_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/Web/Controllers/EntityModeQueryDrawer_Generate.cs"
@@ -35,9 +35,10 @@
             attrString += StructStrHelper.GetVueFormOptionsStrForPageAddFormAttributes_Query_Clear(newColumnNameList, param);
             str = str.Replace("$Save_PageAddFormAttributes_Query_Clear$", attrString);
 
-            attrString = "";
-            attrString += StructStrHelper.GetVueFormOptionsStrForPageAddFormAttributes_Query_Clear_HighSelect(newColumnNameList, param);
-            str = str.Replace("$Save_PageAddFormAttributes_Query_Clear_HighSelect$", attrString);
+            //楂樼骇鏌ヨ杩囨护浼樺寲浜嗭紝涓嶅啀鐢ㄨ繖绉嶆柟寮忎簡
+            //attrString = "";
+            //attrString += StructStrHelper.GetVueFormOptionsStrForPageAddFormAttributes_Query_Clear_HighSelect(newColumnNameList, param);
+            //str = str.Replace("$Save_PageAddFormAttributes_Query_Clear_HighSelect$", attrString);
 
             attrString = "";
             attrString += StructStrHelper.GetVueFormOptionsStrForCommonQueryEnumForFrom(param.ColumnNameList, param);
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 942ba5f..2969266 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"
@@ -122,9 +122,23 @@
   /** 
    * 重置公共select查询 
    */ 
-  const onResetForHighSelect = async () => { 
-    $Save_PageAddFormAttributes_Query_Clear_HighSelect$
-  } 
+  const onResetForHighSelect = () => {  
+      // 遍历所有表单字段  
+      formItems.forEach(item => {  
+        // 检查字段是否有高级查询的过滤模式配置  
+        if (item.highSelectAttrs && item.highSelectAttrs.prop) {  
+          const filterModeProp = item.highSelectAttrs.prop;  
+          const options = item.highSelectAttrs.options || [];  
+      
+          // 如果存在选项,则设置为第一个选项的值  
+          if (options.length > 0) {  
+            // 假设选项格式为 { value, label } 或类似结构  
+            const firstValue = options[0].value !== undefined ? options[0].value : options[0];  
+            formData.value[filterModeProp] = firstValue;  
+          }  
+        }  
+      });  
+  }  
   /**
    * 重置查询
    */

--
Gitblit v1.9.3