liudong
2024-08-24 b9ce7b914e5d38aaebc206b548adf649955fb626
agent名称修改
2个文件已修改
65 ■■■■■ 已修改文件
src/views/sessionManager/components/updataFile.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sessionManager/index.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sessionManager/components/updataFile.vue
@@ -139,31 +139,35 @@
    Message.warning('请选择文件');
    return;
  }
  uploaditemList.value = files.value.map((item)=>{
  uploaditemList.value = files.value.map((item,index)=>{
    return {
      index: index,
      name: item.name,
      size: (item.file.size/1024).toFixed(2) + 'K',
    }
  })
  onFileSelectedLoading.value = true;
  const formData = new FormData();
  for (let i = 0; i < files.value.length; i++) {
    formData.append('file', files.value[i].file);
    formData.append('conversation_id', activeSessionId.value);
    formData.append('parser_id', parser_id.value);
    formData.append('parser_config', '');
  }
  uploadWithoutKb(formData).then((res) => {
    onFileSelectedLoading.value = false;
    if (res.code == 200) {
  // onFileSelectedLoading.value = true;
  // const formData = new FormData();
  // for (let i = 0; i < files.value.length; i++) {
  //   formData.append('file', files.value[i].file);
  //   formData.append('conversation_id', activeSessionId.value);
  //   formData.append('parser_id', parser_id.value);
  //   formData.append('parser_config', '');
  // }
  // uploadWithoutKb(formData).then((res) => {
  //   onFileSelectedLoading.value = false;
  //   if (res.code == 200) {
  //     cancel();
  //     // uploaditemList.value = [];
  //     emit('selectFileCallback', uploaditemList.value);
  //     Message.success('上传成功');
  //   } else {
  //     Message.error('上传失败');
  //   }
  // });
      cancel();
      // uploaditemList.value = [];
      emit('selectFileCallback', uploaditemList.value);
      Message.success('上传成功');
    } else {
      Message.error('上传失败');
    }
  });
src/views/sessionManager/index.vue
@@ -58,9 +58,11 @@
            style="
              width: 80%;
              overflow: auto;
              height: calc(100vh - 380px);
              margin: 0px auto 20px;
            "
            :style="{
              height:uploaditemList.length > 0 ? 'calc(100vh - 480px)' : 'calc(100vh - 380px)'
            }"
          >
            <div
              class="chat-item"
@@ -219,7 +221,7 @@
                v-model="inputMsg"
                @keydown.shift.enter="handleShiftEnter"
                @keydown.enter="sendMessage"
                placeholder="输入您想了解的内容,Shift+Enter换行,Enter发送"
                :placeholder="uploaditemList.length>0?'整理这些文件的核心内容':'输入您想了解的内容,Shift+Enter换行,Enter发送'"
                allow-clear
                show-word-limit
                :disabled="chatDis"
@@ -246,12 +248,12 @@
                </a-button>
              </div>
            </div>
            <div class="uploadFileList">
            <div class="uploadFileList" v-if="uploaditemList.length > 0">
              <div
                class="files"
                v-for="(item, index) in uploaditemList"
                :key="index"
                style="position: relative; width: 200px; margin-top: 10px"
                style="position: relative; width: 200px; margin-top: 10px;margin-right: 20px"
              >
                <a-comment
                  :author="item.name"
@@ -1226,4 +1228,19 @@
  :deep(.arco-upload-list-item-operation) {
    //display: none;
  }
  .uploadFileList{
    width: 100%;
    max-height: 140px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    :deep(.arco-comment-author) {
      width: 100px;
      display: inline-block;
      overflow: hidden; /* 隐藏超出的内容 */
      text-overflow: ellipsis; /* 使用省略号来代替被隐藏的文字 */
      white-space: nowrap; /* 不换行,使内容在一行内显示 */
    }
  }
</style>