refactor(app): 重构知识库列表获取方法

- 将 getKnowledgeList 方法改为异步函数- 优化数据集和代理列表的获取逻辑
- 移除冗余代码,提高代码可读性
- 为后续的 Echarts 图表数据获取做准备
This commit is contained in:
陈昱达
2025-05-14 11:12:54 +08:00
parent bee1c89cf9
commit efcfe51523

View File

@@ -391,14 +391,24 @@ export default {
})
},
getKnowledgeList() {
docManageDataset({ nameLike: this.nameLike }).then(res => {
if (res) {
this.dataset = res.content.content[0]
this.datasetList = res.content.content
this.getAgentList()
}
})
async getKnowledgeList() {
let { content } = await docManageDataset({ nameLike: this.nameLike })
if (content.content && content.length > 0) {
this.dataset = content.content[0]
this.datasetList = content.content
}
await this.getAgentList()
this.getEcharts()
// docManageDataset({ nameLike: this.nameLike }).then(res => {
// if (res) {
// this.dataset = res.content.content[0]
// this.datasetList = res.content.content
// this.getAgentList()
// }
// })
},
async getAgentList() {
const { content } = await agentList({
@@ -409,8 +419,6 @@ export default {
})
this.agent = content.content[0]
this.agentList = content.content
this.getEcharts()
},
success() {},