yinbangzhong
2024-08-19 9650fe79e821c69c04bbc27ee32767f7c718a288
src/views/sessionManager/index.vue
@@ -152,6 +152,7 @@
                <a-upload
                  ref="uploadRef"
                  :file-list="uploadList"
                  :disabled="loading1"
                  multiple
                  :custom-request="customRequest"
                          style="font-size: 24px;">
@@ -244,6 +245,7 @@
const dialogId = ref("");
const chatDis = ref(false);
const loading = ref(false);
const loading1= ref(false);
const agentType = ref("1");
const agentTitle = ref("未命名会话");
let chatObj = reactive({});
@@ -281,6 +283,7 @@
};
// 上传文件
const customRequest = async(option) => {
  loading1.value=true;
  const {onProgress, onError, onSuccess, fileItem, name} = option
  const { code, data } = await getSessionDetailsApi(activeSessionId.value);
@@ -289,13 +292,13 @@
    if (fileItem.file) {
      const formData = new FormData();
      formData.append('file', fileItem.file);
      formData.append('conversation_id', data.dialog_id);
      formData.append('conversation_id', data.id);
      uploadWithoutKb(formData).then((res) => {
        console.log(res);
        uploadList.value = [];
        if (res.code == 0) {
        if (res.code == 200) {
          console.log(res);
          loading1.value=false;
        }
      });
    }