CN-1238: 实体查询语法逻辑

This commit is contained in:
刘洪洪
2023-08-18 09:32:58 +08:00
parent 08b0c1fd1f
commit 6267851a2d
12 changed files with 201 additions and 48 deletions

View File

@@ -168,7 +168,13 @@ import { getNowTime, getSecond } from '@/utils/date-util'
import { ref } from 'vue'
import _ from 'lodash'
import Loading from '@/components/common/Loading'
import { overwriteUrl, urlParamsHandler, numberWithCommas, comparedEntityKey } from '@/utils/tools'
import {
overwriteUrl,
urlParamsHandler,
numberWithCommas,
comparedEntityKey,
handleEntityTypeByStr
} from '@/utils/tools'
import Parser from '@/components/advancedSearch/meta/parser'
import { handleErrorTip } from '@/components/advancedSearch/meta/error'
import { columnList } from '@/utils/static-data'
@@ -863,7 +869,7 @@ export default {
}
}
const parser = new Parser(columnList)
const keyInfo = comparedEntityKey(str)
const keyInfo = comparedEntityKey(handleEntityTypeByStr(str))
if (keyInfo.isKey) {
const errorList = parser.validateStr(keyInfo.key)
if (_.isEmpty(errorList)) {
@@ -872,7 +878,7 @@ export default {
this.$message.error(handleErrorTip(errorList[0]))
}
} else {
this.$message.error(this.$t('tip.invalidQueryField') + keyInfo.key)
this.$message.error(this.$t('tip.invalidQueryField') + ' ' + keyInfo.key)
}
} else {
this.search({ q: '', str: '', metaList: [] })

View File

@@ -30,7 +30,7 @@
</div>
<div class="basic-info__item">
<i class="cn-icon cn-icon-position"></i>
<span class="row-item-label">{{ $t('overall.region') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-label">{{ $t('overall.city') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.location ? ipLocationRegion(entityData.location) : '-' }}</span>
</div>
<div class="basic-info__item">

View File

@@ -74,11 +74,11 @@ export default {
{
value: 'AND',
label: 'AND'
},
{
value: 'OR',
label: 'OR'
}
// {
// value: 'OR',
// label: 'OR'
// }
],
showHistory: false,
history: []