diff --git a/src/utils/tools.js b/src/utils/tools.js index 6424c5c2..64379455 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -1379,13 +1379,13 @@ export const myHighLight = { const newText = text.replace(regex, (match) => { // 将value中的value提取出来对比,string即精准搜索,fullText模糊搜索 for (const item of value) { - if (item.type === columnType.string && item.value === match) { + if ((item.type === columnType.string && item.value === el.innerHTML) || el.className.indexOf('high-location') > -1) { if (el.className.indexOf('high-light-block') > -1) { return `${match}` } else { return `${match}` } - } else if (item.type === columnType.fullText) { + } else if (item.type === columnType.fullText && item.value === match) { if (el.className.indexOf('high-light-block') > -1) { return `${match}` } else { diff --git a/src/views/entityExplorer/EntityExplorer.vue b/src/views/entityExplorer/EntityExplorer.vue index bb2850b8..18ad233b 100644 --- a/src/views/entityExplorer/EntityExplorer.vue +++ b/src/views/entityExplorer/EntityExplorer.vue @@ -424,19 +424,21 @@ export default { }, pageSize (val) { this.pageObj.pageSize = val + const keywordList = this.getKeywordListByMetaList(this.metaList) if (this.initFlag) { if (val !== 20) { - this.search({ metaList: this.metaList, q: this.q }) + this.search({ metaList: this.metaList, q: this.q, keywordList: keywordList }) } } else { - this.search({ metaList: this.metaList, q: this.q }) + this.search({ metaList: this.metaList, q: this.q, keywordList: keywordList }) } }, pageNo (val) { if (!this.initFlag) { this.pageObj.pageNo = val this.pageObj.resetPageNo = false - this.search({ metaList: this.metaList, q: this.q }) + const keywordList = this.getKeywordListByMetaList(this.metaList) + this.search({ metaList: this.metaList, q: this.q, keywordList: keywordList }) } }, // 点击上一页箭头 @@ -683,14 +685,7 @@ export default { } const parser = new Parser(columnList) const metaList = parser.parseStr(_.cloneDeep(str)).metaList - const keywordList = [] - metaList.forEach(item => { - if (item.column && item.column.type === columnType.fullText) { - keywordList.push({ type: item.column.type, value: item.column.label }) - } else if (item.column && item.column.type === columnType.string) { - keywordList.push({ type: item.column.type, value: item.value.value }) - } - }) + const keywordList = this.getKeywordListByMetaList(metaList) const keyInfo = parser.comparedEntityKey(parser.handleEntityTypeByStr(str)) if (keyInfo.isKey) { const errorList = parser.validateStr(keyInfo.key) @@ -744,6 +739,19 @@ export default { }).finally(() => { }) }, + getKeywordListByMetaList (metaList) { + if (metaList) { + const keywordList = [] + metaList.forEach(item => { + if (item.column && item.column.type === columnType.fullText) { + keywordList.push({ type: item.column.type, value: item.column.label }) + } else if (item.column && item.column.type === columnType.string) { + keywordList.push({ type: item.column.type, value: item.value.value }) + } + }) + return keywordList + } + }, getKeyword (list) { if (list) { const metaList = JSON.parse(JSON.stringify(list)) @@ -773,7 +781,6 @@ export default { } }, mounted () { - this.getEntityIndexData() let { q, listMode } = this.$route.query // 如果地址栏有listMode,即列表页,并非首页,则开始搜索 @@ -788,6 +795,9 @@ export default { if (q) { str1 = q.substring(q.indexOf('%'), q.indexOf('%') + 3) } + if (q.indexOf('+') > -1) { + q = q.replace('+', '') + } if (q && q.indexOf('%') > 0 && (str1 !== '%20' || str1 === '%25')) { q = decodeURI(q) } @@ -797,6 +807,10 @@ export default { this.$store.commit('resetScoreBase') this.queryScoreBase() } + + if (!this.showList) { + this.getEntityIndexData() + } }, watch: { timeFilter () { diff --git a/src/views/entityExplorer/entityList/Row.vue b/src/views/entityExplorer/entityList/Row.vue index 10af8e57..53c46208 100644 --- a/src/views/entityExplorer/entityList/Row.vue +++ b/src/views/entityExplorer/entityList/Row.vue @@ -35,7 +35,7 @@
{{ $t('overall.city') }} :   - {{ entityData.location ? ipLocationRegion(entityData.location) : '-' }} + {{ entityData.location ? ipLocationRegion(entityData.location) : '-' }}
@@ -176,7 +176,7 @@
- +
diff --git a/src/views/entityExplorer/entityList/detailOverview/Ip.vue b/src/views/entityExplorer/entityList/detailOverview/Ip.vue index 03cca805..467f8d63 100644 --- a/src/views/entityExplorer/entityList/detailOverview/Ip.vue +++ b/src/views/entityExplorer/entityList/detailOverview/Ip.vue @@ -10,7 +10,7 @@ - {{ ipLocationRegion(entity.location) }} + {{ ipLocationRegion(entity.location) }}
-
@@ -21,7 +21,7 @@
{{$t('entities.openPort')}}
-
{{ openPort }}
+
{{ openPort }}