From a53981aea70d2247120954a96f9f462c6bad936b Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期一, 12 八月 2024 16:52:54 +0800
Subject: [PATCH] 修改智能体的bug问题

---
 src/views/dmx/IntelligentAgent/components/agentConfig.vue |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/src/views/dmx/IntelligentAgent/components/agentConfig.vue b/src/views/dmx/IntelligentAgent/components/agentConfig.vue
index bdebaa6..2c6c42f 100644
--- a/src/views/dmx/IntelligentAgent/components/agentConfig.vue
+++ b/src/views/dmx/IntelligentAgent/components/agentConfig.vue
@@ -49,6 +49,7 @@
                 <a-form-item label="鏅鸿兘浣撳浘鏍�">
                   <a-space direction="vertical" :style="{ width: '100%' }">
                     <Upload
+                      v-if="avatarShow"
                       :action="uploadAction"
                       :limit="1"
                       :url="form.icon ? httpUrl + form.icon : ''"
@@ -162,8 +163,8 @@
                   :data="form.prompt_config.parameters"
                   style="width: 100%"
                 >
-                  <template #key="{ record, rowIndex }">
-                    <a-input v-model="record.key" placeholder="" />
+                  <template #name="{ record, rowIndex }">
+                    <a-input v-model="record.name" placeholder="" />
 <!--                    <a-input v-model="form.prompt_config.parameters[rowIndex].key" />-->
                   </template>
                   <template #optional="{ record }">
@@ -259,7 +260,7 @@
 </template>
 
 <script lang="ts" setup>
-import { onMounted, onBeforeMount, reactive, ref, nextTick, onUnmounted } from "vue";
+import { onMounted, onBeforeMount, reactive, ref, nextTick, onUnmounted, onBeforeUnmount } from "vue";
 import { kbdocumentupload, queryKbList, queryModelList } from "@/api/kbList";
 import useLoading from "@/hooks/loading";
 import { Message } from "@arco-design/web-vue";
@@ -289,6 +290,7 @@
     parameters: [
       {
         index: 0,
+        name: "knowledge",
         key: "knowledge",
         optional: false
       }
@@ -315,7 +317,7 @@
 let frequency_penalty = ref(true);
 let max_tokens = ref(true);
 const httpUrl = localStorage.getItem('httpUrl');
-let avatarShow = ref(false);
+let avatarShow = ref(true);
 
 const height = ref('calc(500px)');
 const props = defineProps(['typeAngint', 'formData']);
@@ -323,8 +325,8 @@
 const columns = [
   {
     title: '鍏抽敭瀛�',
-    dataIndex: 'key',
-    slotName: 'key',
+    dataIndex: 'name',
+    slotName: 'name',
   },
   {
     title: '鍙��',
@@ -431,7 +433,6 @@
       avatarShow.value = true;
     },100);
   })
-
 };
 
 
@@ -455,6 +456,15 @@
     if(formNew.rerank_id){
       delete formNew.top_k;
     }
+
+    formNew.prompt_config.parameters = form.prompt_config.parameters.map(item => {
+      return {
+        ...item,
+        key: item.name
+      }
+    })
+
+    console.log(formNew,'formNew');
 
     if (props.typeAngint == 'edit') {
       formNew.dialog_id = form.id;
@@ -498,6 +508,7 @@
   form.prompt_config.parameters.push({
     index: form.prompt_config.parameters.length,
     key: "",
+    name: "",
     optional: true
   });
   nextTick(() => {
@@ -514,7 +525,6 @@
 
 function handleTabChange(key) {
   // 澶勭悊鏍囩鏀瑰彉浜嬩欢
-  console.log('Changed to tab:', key);
   activeKey.value=key;
 }
 
@@ -558,7 +568,7 @@
 onMounted(() => {});
 
 
-onUnmounted(()=>{
+onBeforeUnmount(()=>{
 
 })
 

--
Gitblit v1.8.0