CN-1016 Filter与查找条件组合操作调试及问题修改

This commit is contained in:
hyx
2023-06-04 21:18:41 +08:00
parent 65487f47f6
commit 6a2764ade4
3 changed files with 55 additions and 57 deletions

View File

@@ -343,6 +343,8 @@ export default {
}, },
search (params) { search (params) {
this.pageObj.pageNo = 1 this.pageObj.pageNo = 1
delete this.searchLabel.category
delete this.searchLabel.source
this.getTableData(params) this.getTableData(params)
}, },
getTimeString () { getTimeString () {

View File

@@ -6,6 +6,7 @@
<div class="knowledge-base__content" > <div class="knowledge-base__content" >
<div class="left-filter" style=""> <div class="left-filter" style="">
<knowledge-filter ref="knowledgeFilter" <knowledge-filter ref="knowledgeFilter"
:keyWord="keyWord"
@reload="reload" @reload="reload"
@clearList="clearList"></knowledge-filter> @clearList="clearList"></knowledge-filter>
</div> </div>
@@ -166,10 +167,11 @@ export default {
methods: { methods: {
onSearch () { onSearch () {
const params = { const params = {
q: this.keyWord name: this.keyWord
} }
this.clearList() this.clearList()
this.search(params) this.search(params)
this.$refs.knowledgeFilter.reloadFilter(params)
}, },
handleClose () { handleClose () {
this.showConfirmDialog = false this.showConfirmDialog = false
@@ -299,6 +301,10 @@ export default {
this.isSelectedStatus = false this.isSelectedStatus = false
this.batchDeleteObjs = [] this.batchDeleteObjs = []
this.secondBatchDeleteObjs = [] this.secondBatchDeleteObjs = []
params = {
...params,
name: this.keyWord
}
this.getTableData(params, isAll, isClearType) this.getTableData(params, isAll, isClearType)
}, },
clearList () { clearList () {

View File

@@ -37,6 +37,7 @@ import { knowledgeCategoryValue, knowledgeSourceValue } from '@/utils/constants'
export default { export default {
name: 'KnowledgeFilter', name: 'KnowledgeFilter',
props: { props: {
keyWord: String
}, },
data () { data () {
return { return {
@@ -61,8 +62,7 @@ export default {
children: 'children', children: 'children',
label: 'label' label: 'label'
}, },
allTableData: [], allTableData: []
allCount: 0
} }
}, },
watch: { watch: {
@@ -76,6 +76,7 @@ export default {
}, },
handleCheckedItemChange (data, checkinfo, index) { handleCheckedItemChange (data, checkinfo, index) {
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => {
let typeCheckedNodes = this.$refs.knowledgeTree0.getCheckedNodes() let typeCheckedNodes = this.$refs.knowledgeTree0.getCheckedNodes()
const typeHalfCheckedNodes = checkinfo.halfCheckedNodes const typeHalfCheckedNodes = checkinfo.halfCheckedNodes
typeCheckedNodes = typeCheckedNodes.concat(typeHalfCheckedNodes) typeCheckedNodes = typeCheckedNodes.concat(typeHalfCheckedNodes)
@@ -83,6 +84,10 @@ export default {
const typeCheckedLen = typeCheckedNodes.length const typeCheckedLen = typeCheckedNodes.length
const statusCheckedLen = statusCheckedNodes.length const statusCheckedLen = statusCheckedNodes.length
let params = {} let params = {}
let allSourceNum = 0
this.filterData[0].data.forEach(item => {
allSourceNum = allSourceNum + item.children.length
})
if (typeCheckedLen === 0 || statusCheckedLen === 0) { if (typeCheckedLen === 0 || statusCheckedLen === 0) {
this.$emit('clearList') this.$emit('clearList')
} else { } else {
@@ -95,10 +100,12 @@ export default {
sources.push(val.value) sources.push(val.value)
} }
}) })
if (!(categorys.length === this.filterData[0].data.length && sources.length === allSourceNum)) {
params = { params = {
category: categorys.toString(), category: categorys.toString(),
source: sources.toString() source: sources.toString()
} }
}
if (statusCheckedLen === 1) { if (statusCheckedLen === 1) {
params = { params = {
...params, ...params,
@@ -107,6 +114,7 @@ export default {
} }
this.$emit('reload', params, true) this.$emit('reload', params, true)
} }
}, 200)
}) })
}, },
getAllTableData (params) { getAllTableData (params) {
@@ -126,16 +134,12 @@ export default {
}) })
}, },
initAllData () { initAllData () {
this.allCount = this.allTableData.length
let webSketchCount = 0 let webSketchCount = 0
let fqdnCategoryCount = 0 let fqdnCategoryCount = 0
let iocMalwareCount = 0 let iocMalwareCount = 0
let iocDarkwebCount = 0 let iocDarkwebCount = 0
let ipLocationCount = 0 let ipLocationCount = 0
let asnCount = 0 let asnCount = 0
const fqdnWhoCount = 0
const fqdnIcpCount = 0
const appCategoryCount = 0
let aiTaggingCount = 0 let aiTaggingCount = 0
let psiphon3Count = 0 let psiphon3Count = 0
@@ -212,25 +216,7 @@ export default {
value: knowledgeSourceValue.asn, value: knowledgeSourceValue.asn,
count: asnCount, count: asnCount,
type: 1 type: 1
}/*, { }
id: 16,
label: 'FQDN Who',
value: 'cn_fqdn_who_isBuiltIn',
count:fqdnWhoCount,
children: []
},{
id: 17,
label: 'FQDN Icp',
value: 'cn_fqdn_icp_built_in',
count:fqdnIcpCount,
children: []
},{
id: 18,
label: 'APP Category',
value: 'cn_app_category_built_indad',
count:appCategoryCount,
children: []
} */
] ]
}, },
{ {
@@ -294,12 +280,16 @@ export default {
{ id: 2, label: 'disable', value: 0, count: disableCount, type: 0 } { id: 2, label: 'disable', value: 0, count: disableCount, type: 0 }
] ]
}, },
reloadFilter () { reloadFilter (params) {
this.getAllTableData() this.getAllTableData(params)
} }
}, },
mounted () { mounted () {
this.getAllTableData() let params = {}
params = {
name: this.keyWord
}
this.getAllTableData(params)
}, },
computed: { computed: {
} }