|
@@ -10,6 +10,7 @@ import type { UploadFile, UploadFiles } from 'element-plus'
|
|
|
import FileUploader from '@/components/Uploader/FileUploader.vue'
|
|
import FileUploader from '@/components/Uploader/FileUploader.vue'
|
|
|
import EditForm from './components/EditForm.vue'
|
|
import EditForm from './components/EditForm.vue'
|
|
|
import EditLLMForm from './components/EditLLMForm.vue'
|
|
import EditLLMForm from './components/EditLLMForm.vue'
|
|
|
|
|
+import EditCallingsForm from './components/EditCallingsForm.vue'
|
|
|
import SearchForm from './components/SearchForm.vue'
|
|
import SearchForm from './components/SearchForm.vue'
|
|
|
|
|
|
|
|
import type { TAgent } from '@/types/role'
|
|
import type { TAgent } from '@/types/role'
|
|
@@ -25,8 +26,9 @@ const editFormVisible = ref(false)
|
|
|
const editMode = ref<'create' | 'edit'>('create')
|
|
const editMode = ref<'create' | 'edit'>('create')
|
|
|
const currentData = ref<any>(null)
|
|
const currentData = ref<any>(null)
|
|
|
|
|
|
|
|
|
|
+const currentCloneId = ref<string>()
|
|
|
const editLLMFormVisible = ref(false)
|
|
const editLLMFormVisible = ref(false)
|
|
|
-const currentAgentId = ref<string>()
|
|
|
|
|
|
|
+const editCallingsFormVisible = ref(false)
|
|
|
|
|
|
|
|
const importedResultDialogVisible = ref(false)
|
|
const importedResultDialogVisible = ref(false)
|
|
|
const importedFile = ref<UploadFile | null>(null)
|
|
const importedFile = ref<UploadFile | null>(null)
|
|
@@ -110,10 +112,18 @@ const handleEdit = (data: TAgent) => {
|
|
|
}
|
|
}
|
|
|
const handleEditLLM = (data: TAgent) => {
|
|
const handleEditLLM = (data: TAgent) => {
|
|
|
console.log(data)
|
|
console.log(data)
|
|
|
- currentAgentId.value = data.agentId
|
|
|
|
|
|
|
+ currentData.value = data
|
|
|
|
|
+ currentCloneId.value = data.id
|
|
|
editLLMFormVisible.value = true
|
|
editLLMFormVisible.value = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const handleEditCallings = (data: TAgent) => {
|
|
|
|
|
+ console.log(data)
|
|
|
|
|
+ currentData.value = data
|
|
|
|
|
+ currentCloneId.value = data.id
|
|
|
|
|
+ editCallingsFormVisible.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
pagination.value.page = 1
|
|
pagination.value.page = 1
|
|
|
fetchData()
|
|
fetchData()
|
|
@@ -174,10 +184,11 @@ onMounted(async () => {
|
|
|
</ElTableColumn>
|
|
</ElTableColumn>
|
|
|
<ElTableColumn label="Language" prop="language" min-width="180" />
|
|
<ElTableColumn label="Language" prop="language" min-width="180" />
|
|
|
<ElTableColumn label="voiceName" prop="voiceName" min-width="240" />
|
|
<ElTableColumn label="voiceName" prop="voiceName" min-width="240" />
|
|
|
- <ElTableColumn fixed="right" label="操作" min-width="200">
|
|
|
|
|
|
|
+ <ElTableColumn fixed="right" label="操作" min-width="240">
|
|
|
<template #default="{row}">
|
|
<template #default="{row}">
|
|
|
<ElButton link type="primary" size="small" @click="handleEdit(row)">编辑</ElButton>
|
|
<ElButton link type="primary" size="small" @click="handleEdit(row)">编辑</ElButton>
|
|
|
<ElButton link type="primary" size="small" @click="handleEditLLM(row)">绑定大模型</ElButton>
|
|
<ElButton link type="primary" size="small" @click="handleEditLLM(row)">绑定大模型</ElButton>
|
|
|
|
|
+ <ElButton link type="primary" size="small" @click="handleEditCallings(row)">修改 callings</ElButton>
|
|
|
<!-- <ElPopconfirm title="确定推荐吗?" @confirm="handleRecommend(row.id, row.topFlag)">
|
|
<!-- <ElPopconfirm title="确定推荐吗?" @confirm="handleRecommend(row.id, row.topFlag)">
|
|
|
<template #reference>
|
|
<template #reference>
|
|
|
<ElButton link type="primary" size="small">
|
|
<ElButton link type="primary" size="small">
|
|
@@ -203,7 +214,8 @@ onMounted(async () => {
|
|
|
<EditForm v-model:visible="editFormVisible" :model-value="currentData" :mode="editMode" @refresh="handleRefresh"
|
|
<EditForm v-model:visible="editFormVisible" :model-value="currentData" :mode="editMode" @refresh="handleRefresh"
|
|
|
@cancel="handleFormCancel" />
|
|
@cancel="handleFormCancel" />
|
|
|
|
|
|
|
|
- <EditLLMForm v-model:visible="editLLMFormVisible" :agentId="currentAgentId" @refresh="handleRefresh"></EditLLMForm>
|
|
|
|
|
|
|
+ <EditLLMForm v-model:visible="editLLMFormVisible" :cloneId="currentCloneId ?? ''" @refresh="handleRefresh"></EditLLMForm>
|
|
|
|
|
+ <EditCallingsForm v-model:visible="editCallingsFormVisible" :model-value="currentData" :cloneId="currentCloneId ?? ''" @refresh="handleRefresh"></EditCallingsForm>
|
|
|
|
|
|
|
|
<ElDialog title="导入结果" v-model="importedResultDialogVisible" align-center
|
|
<ElDialog title="导入结果" v-model="importedResultDialogVisible" align-center
|
|
|
width="800" :z-index="2000" :close-on-click-modal="false">
|
|
width="800" :z-index="2000" :close-on-click-modal="false">
|