zhangxiao
2024-08-29 ea65ac2badeb68a0da5c0d4a69d27a9ba630c3d0
src/views/sessionManager/components/seniorAgentSession.vue
@@ -219,17 +219,19 @@
          />
        </template>
        <template #content>
          <a-textarea
            readonly
            auto-size
            v-model="displayedText"
            :class="{ chatItemAnswer: theme === 'light' }"
            :style="{
              backgroundColor: theme === 'light' ? '#ffffff' : '#000000',
            }"
            style="border: none"
          >
          </a-textarea>
          <a-spin :loading="loading" dot style="width: 100%">
            <a-textarea
              readonly
              auto-size
              v-model="displayedText"
              :class="{ chatItemAnswer: theme === 'light' }"
              :style="{
                backgroundColor: theme === 'light' ? '#ffffff' : '#000000',
              }"
              style="border: none"
            >
            </a-textarea>
          </a-spin>
        </template>
        <template #actions>
          <div
@@ -594,6 +596,7 @@
        id: agentObj.id,
      }),
    });
    refreshScroll();
    const reader = response?.body
      ?.pipeThrough(new TextDecoderStream())
@@ -610,7 +613,11 @@
          const d = val?.data;
          if (typeof d !== 'boolean') {
            console.info('data:', d);
            streamStr.value = d.content;
            if (d?.content) {
              streamStr.value = d.content;
            } else {
              streamStr.value = d.code + d.sql;
            }
            startDisplayStr();
          }
        } catch (e) {
@@ -688,7 +695,8 @@
    conversation_id.value = session.id;
    activeSessionId.value = session.id;
    dialog_id.value = session.dialog_id;
    console.log(4554);
    uploaditemList.value = [];
    getAentId(session.dialog_id);
    from.name = session.name;
    const { code, data } = await getSessionDetailsApi(session.id);
@@ -788,10 +796,6 @@
          {
            content: sessionDetailList.value[0].content,
            role: 'assistant',
          },
          {
            content: inputMsg.value,
            role: 'user',
          },
        ];
        const res = await agentConversationSetApi({
@@ -960,7 +964,13 @@
            if (typeof d !== 'boolean') {
              console.info('data:', d);
              streamStr.value = d.content;
              if (d?.content) {
                streamStr.value = d.content;
              } else {
                streamStr.value = d.code;
              }
              startDisplayStr();
            }
          } catch (e) {
@@ -1041,6 +1051,7 @@
    if (timer) {
      clearTimeout(timer!);
    }
    const res = streamStr.value;
    // 将数组中的字符串拼接起来