handleHitKnowledgeChange = async (value: any) => {
const hitKnowledgeTableFilter = this.state.hitKnowledgeTableFilter
let filterTableData: any[] = []
if (this.state.hitKnowledgeTableType.includes(value)) {
hitFilter.type = value
}
if (value === 'type') {
hitFilter.type = 'type'
}
if (this.state.hitKnowledgeTableCategorys.includes(value)) {
hitFilter.Category = value
}
if (value === 'Category') {
hitFilter.Category = 'Category'
}
if (this.state.hitKnowledgeTableCatalogs.includes(value)) {
hitFilter.Catalogs = value
}
if (value === 'Catalogs') {
hitFilter.Catalogs = 'Catalogs'
}
if (['直连人工', '非直连人工'].includes(value)) {
hitFilter.Direct = value
}
if (value === 'direct') {
hitFilter.Direct = 'direct'
}
let filterStr = 'item=> item != undefined'
if (!!hitFilter.type && hitFilter.type !== 'type') {
filterStr += `&&item.kdType==='${hitFilter.type}'`
}
else {
filterStr += '&&item.kdType!==undefined'
}
if (!!hitFilter.Category && hitFilter.Category !== 'Category') {
filterStr += `&&item.kdCategory==='${hitFilter.Category}'`
}
else {
filterStr += '&&item.kdCategory!==undefined'
}
if (!!hitFilter.Catalogs && hitFilter.Catalogs !== 'Catalogs') {
filterStr += `&&item.kdCatalog==='${hitFilter.Catalogs}'`
}
else {
filterStr += '&&item.kdCatalog!==undefined'
}
if (!!hitFilter.Direct && hitFilter.Direct !== 'direct') {
filterStr += `&&item.kdDirectManual==='${hitFilter.Direct}'`
}
else {
filterStr += '&&item.kdDirectManual!==undefined'
}
filterTableData = hitKnowledgeTableFilter.filter(eval(filterStr))
this.setState({
hitKnowledgeTable: filterTableData,
})
}