liudong
2024-08-24 b9ce7b914e5d38aaebc206b548adf649955fb626
src/views/sessionManager/index.vue
@@ -1,5 +1,5 @@
<template>
  <div class="container" ref="container">
  <div class="container" id="container">
    <!--    <AddSession-->
    <!--      :modalObj="modalObj"-->
    <!--      @addSession="addSession"-->
@@ -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"
@@ -234,7 +236,7 @@
                }"
              />
              <div style="width: 100%;display: flex;justify-content: space-between">
                <updataFile :sessionId="activeSessionId" @selectFileCallback="selectFileCallback"></updataFile>
                <updataFile ref="fileInput" :sessionId="activeSessionId" @selectFileCallback="selectFileCallback"></updataFile>
                <a-button
                  :disabled="chatDis"
                  @click="sentClick"
@@ -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"
@@ -425,7 +427,6 @@
  const files = ref([]);
  const file = ref('');
  const fileInput = ref(null);
  const container = ref(null);
  const chatDataMeg = reactive({});
  const visible = ref(false);
  let toStop = false;
@@ -536,6 +537,7 @@
  };
  const selectFileCallback = (data) => {
    console.log(data, 'selectFileCallback');
    uploaditemList.value = data;
  };
@@ -860,6 +862,11 @@
    createSession('');
  });
  onMounted(() => {
    let container = document.getElementById('container');
    container.addEventListener('click', () => {
      fileInput.value.cancel();
    })
    EventBus.on('newChat', () => {
      agentType.value = '1';
      createSession('');
@@ -1221,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>