CN-1400 fix: 调整知识库智能学习启停功能
This commit is contained in:
@@ -391,17 +391,18 @@ export default {
|
|||||||
switchLearning () {
|
switchLearning () {
|
||||||
const hint = this.aiTaggingList.find(d => d.knowledgeId === this.switchKnowledgeId)
|
const hint = this.aiTaggingList.find(d => d.knowledgeId === this.switchKnowledgeId)
|
||||||
const toStatus = hint.status === 0 ? 1 : 0
|
const toStatus = hint.status === 0 ? 1 : 0
|
||||||
axios.patch(api.knowledgeBaseEnable, { list: [{ knowledgeId: this.switchKnowledgeId, status: toStatus }] }).then(res => {
|
const url = toStatus === 0 ? api.knowledgeBaseLearningStop : api.knowledgeBaseLearningStart
|
||||||
|
axios.post(`${url}?knowledgeId=${hint.knowledgeId}`).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
hint.status = toStatus
|
hint.status = toStatus
|
||||||
this.$message.success(this.$t('tip.success'))
|
this.$message.success(this.$t('tip.success'))
|
||||||
} else {
|
} else {
|
||||||
console.error(res.message)
|
console.error(res.message)
|
||||||
this.errorMsgHandler(res)
|
this.$message.error(this.errorMsgHandler(res))
|
||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.showConfirmSwitch = false
|
this.showConfirmSwitch = false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ export const api = {
|
|||||||
knowledgeBase: apiVersion + '/knowledgeBase',
|
knowledgeBase: apiVersion + '/knowledgeBase',
|
||||||
knowledgeBaseList: apiVersion + '/knowledgeBase/list',
|
knowledgeBaseList: apiVersion + '/knowledgeBase/list',
|
||||||
knowledgeBaseEnable: apiVersion + '/knowledgeBase/status',
|
knowledgeBaseEnable: apiVersion + '/knowledgeBase/status',
|
||||||
|
knowledgeBaseLearningStart: apiVersion + '/knowledgeBase/intelligence-learning/start',
|
||||||
|
knowledgeBaseLearningStop: apiVersion + '/knowledgeBase/intelligence-learning/stop',
|
||||||
knowledgeBaseStatistics: apiVersion + '/knowledgeBase/statistics',
|
knowledgeBaseStatistics: apiVersion + '/knowledgeBase/statistics',
|
||||||
updateKnowledgeUrl: apiVersion + '/knowledgeBase/items/batch',
|
updateKnowledgeUrl: apiVersion + '/knowledgeBase/items/batch',
|
||||||
knowledgeBaseLog: apiVersion + '/knowledgeBase/audit/log',
|
knowledgeBaseLog: apiVersion + '/knowledgeBase/audit/log',
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ export default {
|
|||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.filterData[this.pageType][0].data = []
|
this.filterData[this.pageType][0].data = []
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 初始化顶部大柱状图 */
|
/** 初始化顶部大柱状图 */
|
||||||
@@ -376,7 +376,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@@ -415,7 +415,7 @@ export default {
|
|||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.filterData[this.pageType][1].data = []
|
this.filterData[this.pageType][1].data = []
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initEventTypeData (params) {
|
initEventTypeData (params) {
|
||||||
@@ -450,7 +450,7 @@ export default {
|
|||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.filterData[this.pageType][2].data = []
|
this.filterData[this.pageType][2].data = []
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 第二个饼图和左侧filter的eventType */
|
/** 第二个饼图和左侧filter的eventType */
|
||||||
@@ -486,7 +486,7 @@ export default {
|
|||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.filterData[this.pageType][2].data = []
|
this.filterData[this.pageType][2].data = []
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 横向柱状图和左侧filter的offenderIp */
|
/** 横向柱状图和左侧filter的offenderIp */
|
||||||
@@ -530,7 +530,7 @@ export default {
|
|||||||
this.filterData[this.pageType][4].data = []
|
this.filterData[this.pageType][4].data = []
|
||||||
this.filterData[this.pageType][4].showMore = false
|
this.filterData[this.pageType][4].showMore = false
|
||||||
this.filterData[this.pageType][4].showIndex = 9
|
this.filterData[this.pageType][4].showIndex = 9
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ export default {
|
|||||||
this.filterData[this.pageType][3].data = []
|
this.filterData[this.pageType][3].data = []
|
||||||
this.filterData[this.pageType][3].showMore = false
|
this.filterData[this.pageType][3].showMore = false
|
||||||
this.filterData[this.pageType][3].showIndex = 9
|
this.filterData[this.pageType][3].showIndex = 9
|
||||||
this.errorMsgHandler(e)
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initActiveEntity (params) {
|
initActiveEntity (params) {
|
||||||
|
|||||||
Reference in New Issue
Block a user