mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-07 01:46:48 +08:00
(intactorelligent-agent): 优化智能代理组件的表单提交逻辑
- 提取公共 APIref调用逻辑,减少重复代码- 添加 API 调用成功
This commit is contained in:
@@ -25,12 +25,15 @@ export default {
|
||||
* 提交表单
|
||||
*/
|
||||
async handleSubmit() {
|
||||
let api = this.dialog.type === 'edit' ? agentEdit : agentAdd
|
||||
|
||||
// 更新表单之后重新获取列表,然后退出 dialog
|
||||
;(await this.dialog.type) === 'edit'
|
||||
? agentEdit(this.dialog.agent)
|
||||
: agentAdd(this.dialog.agent)
|
||||
this.fetchAgentList()
|
||||
this.dialog.visible = false
|
||||
api(this.dialog.agent).then(res => {
|
||||
if (res) {
|
||||
this.fetchAgentList()
|
||||
this.dialog.visible = false
|
||||
}
|
||||
})
|
||||
},
|
||||
validateForm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
|
||||
Reference in New Issue
Block a user