From 63cf7c9a0038e0caa7370fba897fefcc62b960a7 Mon Sep 17 00:00:00 2001
From: cshaptx4869 <994774638@qq.com>
Date: Fri, 7 Jun 2024 16:31:29 +0800
Subject: [PATCH] =?UTF-8?q?feat(PageSearch):=20:sparkles:=20=E8=A1=A8?=
=?UTF-8?q?=E5=8D=95=E9=A1=B9=E6=94=AF=E6=8C=81tips=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/PageSearch/index.vue | 44 +++++++++++++++++++++--------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/src/components/PageSearch/index.vue b/src/components/PageSearch/index.vue
index f2f6e55b..fd11d6b7 100644
--- a/src/components/PageSearch/index.vue
+++ b/src/components/PageSearch/index.vue
@@ -12,6 +12,22 @@
:label="item.label"
:prop="item.prop"
>
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
{
- if (item.attrs?.join) {
- return inputTagMap[item.prop].data.join(item.attrs.join);
- } else {
- return inputTagMap[item.prop].data;
- }
+ queryParams[item.prop] = computed({
+ get() {
+ return typeof item.attrs?.join === "string"
+ ? inputTagMap[item.prop].data.join(item.attrs.join)
+ : inputTagMap[item.prop].data;
+ },
+ set(value) {
+ // resetFields时会被调用
+ inputTagMap[item.prop].data =
+ typeof item.attrs?.join === "string"
+ ? value.split(item.attrs.join).filter((item: any) => item !== "")
+ : value;
+ },
});
} else {
queryParams[item.prop] = item.initialValue ?? "";
@@ -196,9 +221,6 @@ for (const item of formItems) {
// 重置操作
function handleReset() {
queryFormRef.value?.resetFields();
- for (const key in inputTagMap) {
- inputTagMap[key].data = [];
- }
emit("resetClick", queryParams);
}
// 查询操作