From 3937bd1824ad4d89ebeb85e0ecdf12d8d7ffabc6 Mon Sep 17 00:00:00 2001 From: jingrow Date: Sat, 1 Nov 2025 15:17:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96pagetype=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E8=BF=87=E6=BB=A4=E6=A0=8F=E6=90=9C=E7=B4=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/core/pagetype/GenericListPage.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/jingrow/frontend/src/core/pagetype/GenericListPage.vue b/apps/jingrow/frontend/src/core/pagetype/GenericListPage.vue index 71b1c69..40c39f0 100644 --- a/apps/jingrow/frontend/src/core/pagetype/GenericListPage.vue +++ b/apps/jingrow/frontend/src/core/pagetype/GenericListPage.vue @@ -574,8 +574,20 @@ async function loadData() { // 多选字段使用 in 操作符 filterConditions.push([fieldName, 'in', value]) } else { - // 单选字段使用 = 操作符 - filterConditions.push([fieldName, '=', value]) + // 根据字段类型选择操作符 + const fieldMeta = metaFields.value.find(f => f.fieldname === fieldName) + const fieldType = fieldMeta?.fieldtype || '' + + // 文本类型字段使用 like 操作符进行模糊搜索 + const isTextLikeField = ['Data', 'Text', 'Long Text', 'Comment', 'Link'].includes(fieldType) + + if (isTextLikeField && typeof value === 'string') { + // 使用 like 操作符,值前后添加 % 通配符 + filterConditions.push([fieldName, 'like', `%${value}%`]) + } else { + // 其他类型字段使用精确匹配 + filterConditions.push([fieldName, '=', value]) + } } } })