mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-09 02:46:50 +08:00
feat(agent): 优化智能代理工作流页面
- 移除 BackButton 组件中的 mb10 类 - 添加智能代理详情获取和编辑功能 - 在路由中增加 agentId 参数
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-button
|
||||
size="medium"
|
||||
class="hover-button mb10"
|
||||
class="hover-button"
|
||||
@click="$router.history.go(-1)"
|
||||
icon="el-icon-arrow-left"
|
||||
>返回</el-button
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import { DIFY_URL } from '@/config/base-url'
|
||||
import { agentAdd, agentDetail, agentEdit } from '@/api/intelligent-agent/list'
|
||||
export default {
|
||||
name: 'workflow',
|
||||
props: {
|
||||
@@ -10,6 +11,10 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
agentDetail: {},
|
||||
|
||||
editName: '',
|
||||
editValue: '',
|
||||
isLoading: true,
|
||||
worker: {
|
||||
instance: void 0
|
||||
@@ -111,17 +116,52 @@ export default {
|
||||
])
|
||||
// 隐藏 loading
|
||||
this.isLoading = false
|
||||
},
|
||||
|
||||
async getQuery() {
|
||||
const { content } = await agentDetail(this.$route.query.id)
|
||||
this.agentDetail = content.content
|
||||
this.editValue = this.agentDetail.appName
|
||||
},
|
||||
saveUS() {
|
||||
// 更新表单之后重新获取列表,然后退出 dialog
|
||||
agentEdit({ ...this.agentDetail, appName: this.editValue }).then(res => {
|
||||
if (res) {
|
||||
this.$message.success('修改成功')
|
||||
this.editName = false
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {}
|
||||
mounted() {
|
||||
this.getQuery()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="render-container">
|
||||
<div>
|
||||
<div class="flex align-items-c mb10" style="gap: 20px">
|
||||
<BackButton></BackButton>
|
||||
<span class="fs14 fw600 "> {{ $route.query.name }}</span>
|
||||
<span class="fs14 fw600 " v-if="!editName"> {{ editValue }}</span>
|
||||
<el-input size="small" style="width: 300px" v-else v-model="editValue" />
|
||||
|
||||
<el-icon
|
||||
v-if="!editName"
|
||||
class="el-icon-edit fs12"
|
||||
@click.native="editName = !editName"
|
||||
></el-icon>
|
||||
<div v-else>
|
||||
<el-button size="medium" type="primary" @click="saveUS">保存</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="
|
||||
editName = !editName
|
||||
editValue = $route.query.name
|
||||
"
|
||||
>取消</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-loading="isLoading"
|
||||
|
||||
@@ -171,7 +171,8 @@ export default {
|
||||
this.$router.push({
|
||||
path: `/agent/${this.agentConfig.agent.thirdAppId}/workflow`,
|
||||
query: {
|
||||
name: agent.appName
|
||||
name: agent.appName,
|
||||
id: this.agentConfig.agent.id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user