fix: 修复实体搜索框如下问题:1.模糊搜索与精准搜索并列时报错,以及搜索value包含and导致搜索异常;2.tag模式清除搜索条件后,转text模式又恢复;3.tag模式下has右括号是全角;4.点击左侧tag条件时,搜索语句应是has;5.tag模式下,多个条件且其中一个为全文检索时,全文检索在请求参数中丢失。
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
<span v-if="!meta.column.isEditing && meta.operator.value !== 'has'" @click="columnClick(meta)">{{meta.column.label}}</span>
|
||||
<!--操作符是has时,has需前置-->
|
||||
<span v-else class="condition__operator">{{ meta.operator.value.toUpperCase() }}</span>
|
||||
<span v-else class="condition__operator">{{ meta.operator.value }}</span>
|
||||
</div>
|
||||
<!-- 已选操作符显示 -->
|
||||
<div class="condition__operator" @click="operatorClick(meta)" v-if="meta.operator.show && meta.operator.value !== 'has'">{{meta.operator.value}}</div>
|
||||
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
<span v-else @click="valueClick(meta)">{{meta.value.label}}</span>
|
||||
</div>
|
||||
<div v-if="meta.operator.show && meta.operator.value === 'has'">)</div>
|
||||
<div class="condition__value" v-if="meta.operator.show && meta.operator.value === 'has'">)</div>
|
||||
|
||||
<!-- 操作符选择器 -->
|
||||
<div class="condition__operation-select" v-if="meta.operator.show && meta.operator.isEditing">
|
||||
@@ -446,6 +446,9 @@ export default {
|
||||
},
|
||||
cleanMetaList () {
|
||||
this.metaList = []
|
||||
const routeQuery = this.$route.query
|
||||
delete routeQuery.q
|
||||
this.reloadUrl(routeQuery, 'cleanOldParams')
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
@@ -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