优化pagetype列表页过滤栏搜索逻辑

This commit is contained in:
jingrow 2025-11-01 15:17:30 +08:00
parent 589640baa7
commit 3937bd1824

View File

@ -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])
}
}
}
})