Skip to content

Commit 10edeb5

Browse files
fix: chat space
1 parent 3ac5c05 commit 10edeb5

File tree

1 file changed

+53
-51
lines changed
  • ui/src/components/ai-chat/component/answer-content

1 file changed

+53
-51
lines changed

ui/src/components/ai-chat/component/answer-content/index.vue

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,61 @@
11
<template>
22
<div class="item-content lighter">
3-
<template v-for="(answer_text, index) in answer_text_list" :key="index">
4-
<div class="avatar mr-8" v-if="showAvatar">
5-
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
6-
<LogoIcon v-else height="28px" width="28px" />
7-
</div>
8-
<div
9-
class="content"
10-
@mouseup="openControl"
11-
:style="{
12-
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0',
13-
}"
14-
>
15-
<el-card shadow="always" class="border-r-8" style="--el-card-padding: 6px 16px">
16-
<MdRenderer
17-
v-if="
18-
(chatRecord.write_ed === undefined || chatRecord.write_ed === true) &&
19-
answer_text.length == 0
20-
"
21-
:source="$t('chat.tip.answerMessage')"
22-
></MdRenderer>
23-
<template v-else-if="answer_text.length > 0">
3+
<el-space :fill="true" wrap>
4+
<div v-for="(answer_text, index) in answer_text_list" :key="index">
5+
<div class="avatar mr-8" v-if="showAvatar">
6+
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
7+
<LogoIcon v-else height="28px" width="28px" />
8+
</div>
9+
<div
10+
class="content"
11+
@mouseup="openControl"
12+
:style="{
13+
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0',
14+
}"
15+
>
16+
<el-card shadow="always" class="border-r-8" style="--el-card-padding: 6px 16px">
2417
<MdRenderer
25-
v-for="(answer, index) in answer_text"
26-
:key="index"
27-
:chat_record_id="answer.chat_record_id"
28-
:child_node="answer.child_node"
29-
:runtime_node_id="answer.runtime_node_id"
30-
:reasoning_content="answer.reasoning_content"
31-
:disabled="loading || type == 'log'"
32-
:source="answer.content"
33-
:send-message="chatMessage"
18+
v-if="
19+
(chatRecord.write_ed === undefined || chatRecord.write_ed === true) &&
20+
answer_text.length == 0
21+
"
22+
:source="$t('chat.tip.answerMessage')"
3423
></MdRenderer>
35-
</template>
36-
<p v-else-if="chatRecord.is_stop" shadow="always" style="margin: 0.5rem 0">
37-
{{ $t('chat.tip.stopAnswer') }}
38-
</p>
39-
<p v-else shadow="always" style="margin: 0.5rem 0">
40-
{{ $t('chat.tip.answerLoading') }} <span class="dotting"></span>
41-
</p>
42-
<!-- 知识来源 -->
43-
<KnowledgeSourceComponent
44-
:data="chatRecord"
45-
:application="application"
46-
:type="type"
47-
:appType="application.type"
48-
:executionIsRightPanel="props.executionIsRightPanel"
49-
@open-execution-detail="emit('openExecutionDetail')"
50-
@openParagraph="emit('openParagraph')"
51-
@openParagraphDocument="(val: string) => emit('openParagraphDocument', val)"
52-
v-if="showSource(chatRecord) && index === chatRecord.answer_text_list.length - 1"
53-
/>
54-
</el-card>
24+
<template v-else-if="answer_text.length > 0">
25+
<MdRenderer
26+
v-for="(answer, index) in answer_text"
27+
:key="index"
28+
:chat_record_id="answer.chat_record_id"
29+
:child_node="answer.child_node"
30+
:runtime_node_id="answer.runtime_node_id"
31+
:reasoning_content="answer.reasoning_content"
32+
:disabled="loading || type == 'log'"
33+
:source="answer.content"
34+
:send-message="chatMessage"
35+
></MdRenderer>
36+
</template>
37+
<p v-else-if="chatRecord.is_stop" shadow="always" style="margin: 0.5rem 0">
38+
{{ $t('chat.tip.stopAnswer') }}
39+
</p>
40+
<p v-else shadow="always" style="margin: 0.5rem 0">
41+
{{ $t('chat.tip.answerLoading') }} <span class="dotting"></span>
42+
</p>
43+
<!-- 知识来源 -->
44+
<KnowledgeSourceComponent
45+
:data="chatRecord"
46+
:application="application"
47+
:type="type"
48+
:appType="application.type"
49+
:executionIsRightPanel="props.executionIsRightPanel"
50+
@open-execution-detail="emit('openExecutionDetail')"
51+
@openParagraph="emit('openParagraph')"
52+
@openParagraphDocument="(val: string) => emit('openParagraphDocument', val)"
53+
v-if="showSource(chatRecord) && index === chatRecord.answer_text_list.length - 1"
54+
/>
55+
</el-card>
56+
</div>
5557
</div>
56-
</template>
58+
</el-space>
5759
<div
5860
class="content"
5961
:style="{

0 commit comments

Comments
 (0)