From 88b1281f51f590f88ae581d2a14b877da9439250 Mon Sep 17 00:00:00 2001
From: zhangxiao <898441624@qq.com>
Date: 星期一, 12 八月 2024 14:55:37 +0800
Subject: [PATCH] fix: 只能体修改样式

---
 src/views/dmx/knowledgeLib/config.vue |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/views/dmx/knowledgeLib/config.vue b/src/views/dmx/knowledgeLib/config.vue
index f388ced..5e6af51 100644
--- a/src/views/dmx/knowledgeLib/config.vue
+++ b/src/views/dmx/knowledgeLib/config.vue
@@ -1,5 +1,5 @@
 <template>
-  <div class="main-container">
+  <div ref="scrollContainer" class="main-container">
     <div style="position: absolute;top: 0;left: 0;width: 100%;padding: 0 20px">
       <h4 style="margin-bottom: 10px"></h4>
       <div style="color: #666666;">鍦ㄨ繖閲屾洿鏂版偍鐨勭煡璇嗗簱璇︾粏淇℃伅锛屽挨鍏舵槸瑙f瀽鏂规硶銆�</div>
@@ -18,7 +18,7 @@
                 v-if="avatarShow"
                 :action="uploadAction"
                 :limit="1"
-                :url="form.avatar"
+                :url="httpUrl + form.avatar"
                 @update:fileList="updateFileList"
                 @success="handleSuccess"
               ></Upload>
@@ -96,7 +96,7 @@
             <div style="width: 100%;text-align: right">
               <a-space>
                 <a-button @click="cancelConfig">鍙栨秷</a-button>
-                <a-button type="primary" html-type="submit">淇濆瓨</a-button>
+                <a-button :loading="loading" type="primary" html-type="submit">淇濆瓨</a-button>
               </a-space>
             </div>
           </a-form-item>
@@ -160,7 +160,7 @@
 import message from "@arco-design/web-vue/es/message";
 import useLoading from "@/hooks/loading";
 const { loading,setLoading } = useLoading(true);
-
+const scrollContainer = ref();
 const props =  defineProps(['kbtenantInfo'])
 const emit =  defineEmits(['cancleConfig','saveConfig'])
 // 瑙f瀽鏂规硶鍒楄〃
@@ -230,6 +230,7 @@
 const uploadAction = '/api/v1/llm/upload'; // 鏇挎崲涓轰綘鐨勪笂浼燗PI
 const fileList = ref([]);
 const imageUrls = ref([]);
+const httpUrl = localStorage.getItem('httpUrl');
 
 const updateFileList = (newFileList) => {
   fileList.value = newFileList;
@@ -271,7 +272,7 @@
      };
    }
    try {
-    
+     setLoading(true)
     const data = await kbUpdate(parms);
     if(data.code == '0'){
       Message.success("閰嶇疆鎴愬姛");
@@ -279,10 +280,11 @@
       emit('saveConfig')
 
     }
-    // emit('upTabdateItem')
+    setLoading(false)
 
   } catch (err) {
     Message.error(err.message);
+     setLoading(false)
   }
 
 
@@ -337,7 +339,9 @@
   console.log(kbObj, 'kbObj');
   let configObj = {
     name: kbObj.name,
+    avatar: kbObj.avatar,
     pages:  kbObj.parser_config.pages,
+    chunk_token_num:  kbObj.parser_config.chunk_token_num,
     description: kbObj.description,
     language: "English",
     permission: kbObj.permission,
@@ -359,13 +363,14 @@
       use_raptor: false,
     });
   }
-  form.avatar = kbObj.avatar;
   imageUrls.value = [kbObj.avatar];
   console.log(form,'閰嶇疆椤甸潰琛ㄥ崟淇℃伅');
   avatarShow.value = false;
   setTimeout(() => {
     avatarShow.value = true;
   },100);
+  scrollContainer.value.scrollTop = 0;
+
 }
 
 defineExpose({
@@ -374,6 +379,7 @@
 
 
 onBeforeMount(()=>{
+  setLoading(false)
   queryModel({})
 })
 onMounted(()=>{
@@ -399,7 +405,7 @@
   justify-content: space-between;
   height: 100%;
   overflow: auto;
-  //background: #626aea;
+  border-radius: 8px;
   background: var(--color-bg-2);
   padding-top: 80px;
 

--
Gitblit v1.8.0