From bb46e7c37ddbdf44e4a7b729b608b39a3561f1e4 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 20 5月 2025 11:46:40 +0800
Subject: [PATCH] 高级查询过滤优化了,不再用这种方式了
---
Weben_CMS专用代码生成器/Code/Generate/Web/Controllers/EntityModeQueryDrawer_Generate.cs | 8 ++++----
Weben_CMS专用代码生成器/Code/Templete/Web/Controllers/EntityModeQueryDrawer模板.txt | 29 +++++++++++++++++++----------
2 files changed, 23 insertions(+), 14 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 2e42723..1d735eb 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"
@@ -30,10 +30,10 @@
attrString += StructStrHelper.GetVueFormOptionsStrForSave_PageAddFormAttributes_Query(newColumnNameList, param);
str = str.Replace("$Save_PageAddFormAttributes_Query$", attrString);
-
- attrString = "";
- attrString += StructStrHelper.GetVueFormOptionsStrForPageAddFormAttributes_Query_Clear(newColumnNameList, param);
- str = str.Replace("$Save_PageAddFormAttributes_Query_Clear$", attrString);
+ //楂樼骇鏌ヨ杩囨护浼樺寲浜嗭紝涓嶅啀鐢ㄨ繖绉嶆柟寮忎簡
+ //attrString = "";
+ //attrString += StructStrHelper.GetVueFormOptionsStrForPageAddFormAttributes_Query_Clear(newColumnNameList, param);
+ //str = str.Replace("$Save_PageAddFormAttributes_Query_Clear$", attrString);
//楂樼骇鏌ヨ杩囨护浼樺寲浜嗭紝涓嶅啀鐢ㄨ繖绉嶆柟寮忎簡
//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/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 2969266..e874b09 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"
@@ -139,16 +139,25 @@
}
});
}
- /**
- * 重置查询
- */
- const onReset = async () => {
- formData.value = {}
- onResetForHighSelect();//重置公共select查询
- $Save_PageAddFormAttributes_Query_Clear$
- //向父组件发送自定义事件
- ctx.emit('restQuery');
- }
+ /**
+ * 重置查询 - 优化版
+ */
+ const onReset = async () => {
+ // 1. 清空所有基础字段(不包含过滤模式字段)
+ const baseFields = formItems.reduce((acc, item) => {
+ acc[item.prop] = '';
+ return acc;
+ }, {});
+
+ // 2. 应用基础字段初始值
+ formData.value = { ...baseFields };
+
+ // 3. 使用原有方法重置过滤模式字段
+ onResetForHighSelect(); // 保留原有方法调用
+
+ // 4. 向父组件发送自定义事件
+ ctx.emit('restQuery');
+ }
const updateCheckData = () => {
initiateData.value = {
--
Gitblit v1.9.3