fix: 修复实体搜索框如下问题:1.模糊搜索与精准搜索并列时报错,以及搜索value包含and导致搜索异常;2.tag模式清除搜索条件后,转text模式又恢复;3.tag模式下has右括号是全角;4.点击左侧tag条件时,搜索语句应是has;5.tag模式下,多个条件且其中一个为全文检索时,全文检索在请求参数中丢失。
This commit is contained in:
@@ -3,6 +3,7 @@ import Token, { types } from './token'
|
||||
import ParserError, { errorTypes, errorDesc } from '@/components/advancedSearch/meta/error'
|
||||
import _ from 'lodash'
|
||||
import { columnList } from '@/utils/static-data'
|
||||
import { getEntityTypeByValue } from '@/utils/tools'
|
||||
|
||||
const strReg = {
|
||||
all: /^[\da-zA-Z\s.'><!=-_(),%]$/,
|
||||
@@ -789,6 +790,16 @@ export function handleOperatorSpace (operator) {
|
||||
* @returns {string|*}
|
||||
*/
|
||||
export function handleMetaListToStr (metaList) {
|
||||
// 将模糊搜索的值,转换为对应类型,如1.1.1.1,则添加操作符,类型等,以便于后面的操作
|
||||
metaList.forEach(item => {
|
||||
if (item.column.type === 'fullText') {
|
||||
item.operator.value = '='
|
||||
item.value.value = item.column.label
|
||||
item.value.label = item.column.label
|
||||
item.column.label = getEntityTypeByValue(item.column.label)
|
||||
item.column.type = 'string'
|
||||
}
|
||||
})
|
||||
// 长度为1时,即模糊搜索,例如搜索框值为1.1.1.1,则直接返回1.1.1.1
|
||||
// 如果为IP='1.1.1.1'的情况,则从metaList拼接成IP='1.1.1.1'返回出去
|
||||
if (metaList && metaList.length === 1) {
|
||||
|
||||
Reference in New Issue
Block a user