From f5851974b861a20182c06d6f891fd427b1414209 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 20 5月 2025 15:21:19 +0800
Subject: [PATCH] 优化
---
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx | 69 +++++-----------------------------
1 files changed, 11 insertions(+), 58 deletions(-)
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx
index a745033..beddd1a 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx
+++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx
@@ -20,8 +20,8 @@
FILTER_MODE_OPTIONS_NUM,
FILTER_MODE_OPTIONS_BOOL
} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions';
-// 寮曞叆鍏叡琛ㄥ崟宸ュ叿鏂囦欢
-import { collectFormDataForHighQuery,onResetForHighSelect,onResetForHighQuery } from '@/utils/myformUtils';
+// 寮曞叆鍏叡琛ㄥ崟宸ュ叿鏂囦欢
+import { collectFormDataForHighQuery,onResetForHighSelect,onResetForHighQuery } from '@/utils/myformUtils';
import {
BOOLEAN_OPTIONS
} from '@/utils/commonOptionConstants';
@@ -748,30 +748,11 @@
const check = isEqual(initiateData.value, data)
return check
}
-// /**
-// * 鑾峰彇琛ㄥ崟鏁版嵁 - 浼樺寲鐗�
-// */
-// const commonGetFormData = () => {
-// const data = {};
-
-// // 閬嶅巻琛ㄥ崟閰嶇疆鏀堕泦鏁版嵁
-// formItems.forEach(item => {
-// // 鏀堕泦鍩虹瀛楁
-// data[item.prop] = formData.value[item.prop] || '';
-
-// // 鏀堕泦杩囨护妯″紡瀛楁
-// if (item.highSelectAttrs && item.highSelectAttrs.prop) {
-// const filterModeProp = item.highSelectAttrs.prop;
-// data[filterModeProp] = formData.value[filterModeProp] || '';
-// }
-// });
-
-// return data;
-// }
+
const onClose = (done: () => void) => {
if (visible.value) {
visible.value = false
- const data =collectFormDataForHighQuery(formItems,formData);
+ const data =collectFormDataForHighQuery(formItems,formData);
ctx.emit('close', data)
}
}
@@ -779,48 +760,20 @@
* 纭鏌ヨ
*/
const onConfirmQuery = async () => {
- const data =collectFormDataForHighQuery(formItems,formData);
+ const data =collectFormDataForHighQuery(formItems,formData);
ctx.emit('confirmQuery', data)
}
- // /**
- // * 閲嶇疆鍏叡select鏌ヨ
- // */
- // 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;
- // }
- // }
- // });
- // }
/**
* 閲嶇疆鏌ヨ - 浼樺寲鐗�
*/
const onReset = async () => {
- // // 1. 娓呯┖鎵�鏈夊熀纭�瀛楁锛堜笉鍖呭惈杩囨护妯″紡瀛楁锛�
- // const baseFields = formItems.reduce((acc, item) => {
- // acc[item.prop] = '';
- // return acc;
- // }, {});
+ // 1. 娓呯┖鎵�鏈夊熀纭�瀛楁锛堜笉鍖呭惈杩囨护妯″紡瀛楁锛�,搴旂敤鍩虹瀛楁鍒濆鍊�
+ onResetForHighQuery(formItems,formData);
- // // 2. 搴旂敤鍩虹瀛楁鍒濆鍊�
- // formData.value = { ...baseFields };
-
- onResetForHighQuery(formItems,formData);
+ // 2. 浣跨敤鍘熸湁鏂规硶閲嶇疆杩囨护妯″紡瀛楁
+ onResetForHighSelect(formItems,formData);
- // 3. 浣跨敤鍘熸湁鏂规硶閲嶇疆杩囨护妯″紡瀛楁
- onResetForHighSelect(formItems,formData); // 淇濈暀鍘熸湁鏂规硶璋冪敤
-
- // 4. 鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢
+ // 3. 鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢
ctx.emit('restQuery');
}
@@ -855,7 +808,7 @@
}
commonQueryEnumForFrom()
- onResetForHighSelect(formItems,formData);//閲嶇疆鍏叡select鏌ヨ
+ onResetForHighSelect(formItems,formData);//閲嶇疆鍏叡select鏌ヨ
/**
* 寮圭獥鎵撳紑鑾峰彇璇︽儏
*/
--
Gitblit v1.9.3