Skip to content

Commit 0d96f79

Browse files
wangdan-fit2cloudshaohuzhang1
authored andcommitted
feat: Multi channel recall execution details optimize style
1 parent 168f822 commit 0d96f79

File tree

5 files changed

+24
-39
lines changed

5 files changed

+24
-39
lines changed

ui/src/components/ai-chat/ExecutionDetailDialog.vue

+15-33
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@
147147
)"
148148
:key="paragraphIndex"
149149
>
150-
<ParagraphCard :data="paragraph" :index="paragraphIndex" />
150+
<ParagraphCard
151+
:data="paragraph"
152+
:content="paragraph.content"
153+
:index="paragraphIndex"
154+
/>
151155
</template>
152156
</template>
153157
<template v-else> -</template>
@@ -423,17 +427,11 @@
423427
v-for="(paragraph, paragraphIndex) in item.document_list"
424428
:key="paragraphIndex"
425429
>
426-
<CardBox shadow="never" title="" class="cursor mb-8" :showIcon="false">
427-
<template #description>
428-
<el-scrollbar max-height="150">
429-
<MdPreview
430-
ref="editorRef"
431-
editorId="preview-only"
432-
:modelValue="paragraph.page_content"
433-
/>
434-
</el-scrollbar>
435-
</template>
436-
</CardBox>
430+
<ParagraphCard
431+
:data="paragraph.metadata"
432+
:content="paragraph.page_content"
433+
:index="paragraphIndex"
434+
/>
437435
</template>
438436
</template>
439437
<template v-else> -</template>
@@ -449,27 +447,11 @@
449447
v-for="(paragraph, paragraphIndex) in item.result_list"
450448
:key="paragraphIndex"
451449
>
452-
<CardBox
453-
shadow="never"
454-
:title="`${$t('chat.executionDetails.paragraph')}${paragraphIndex + 1}`"
455-
class="paragraph-source-card cursor mb-8 paragraph-source-card-height"
456-
:showIcon="false"
457-
>
458-
<div class="active-button primary">
459-
{{ paragraph.metadata.relevance_score?.toFixed(3) }}
460-
</div>
461-
<template #description>
462-
<div class="mt-8">
463-
<el-scrollbar height="150">
464-
<MdPreview
465-
ref="editorRef"
466-
editorId="preview-only"
467-
:modelValue="paragraph.page_content"
468-
/>
469-
</el-scrollbar>
470-
</div>
471-
</template>
472-
</CardBox>
450+
<ParagraphCard
451+
:data="paragraph.metadata"
452+
:content="paragraph.page_content"
453+
:index="paragraphIndex"
454+
/>
473455
</template>
474456
</template>
475457
<template v-else> -</template>

ui/src/components/ai-chat/ParagraphSourceDialog.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<el-form-item :label="$t('chat.KnowledgeSource.referenceParagraph')">
2323
<div v-if="detail.paragraph_list.length > 0" class="w-full">
2424
<template v-for="(item, index) in detail.paragraph_list" :key="index">
25-
<ParagraphCard :data="item" :index="index" />
25+
<ParagraphCard :data="item" :content="item.content" :index="index" />
2626
</template>
2727
</div>
2828
<span v-else> - </span>
@@ -79,7 +79,6 @@ defineExpose({ open })
7979
@media only screen and (max-width: 768px) {
8080
.paragraph-source {
8181
width: 90% !important;
82-
8382
}
8483
}
8584
</style>

ui/src/components/ai-chat/component/ParagraphCard.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="active-button primary">{{ data.similarity?.toFixed(3) }}</div>
1313
<template #description>
1414
<el-scrollbar height="150">
15-
<MdPreview ref="editorRef" editorId="preview-only" :modelValue="data.content" />
15+
<MdPreview ref="editorRef" editorId="preview-only" :modelValue="content" noImgZoomIn/>
1616
</el-scrollbar>
1717
</template>
1818
<template #footer>
@@ -62,6 +62,10 @@ const props = defineProps({
6262
type: Object,
6363
default: () => {}
6464
},
65+
content: {
66+
type: String,
67+
default: ''
68+
},
6569
index: {
6670
type: Number,
6771
default: 0

ui/src/components/card-box/index.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<el-card shadow="hover" class="card-box" @mouseenter="cardEnter()" @mouseleave="cardLeave()">
33
<div class="card-header">
44
<slot name="header">
5-
<div class="title flex" :class="$slots.subTitle ? '' : 'align-center'">
5+
<div class="title flex align-center" :class="$slots.subTitle?'mt-4':''">
66
<slot name="icon">
77
<AppAvatar v-if="showIcon" class="mr-12 avatar-blue" shape="square" :size="32">
88
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
99
</AppAvatar>
1010
</slot>
11-
<div style="width: 90%;margin-top: -5px;">
11+
<div style="width: 90%;">
1212
<auto-tooltip :content="title" style="width: 65%; height: 22px">
1313
{{ title }}
1414
</auto-tooltip>

ui/src/styles/app.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ h5 {
495495
}
496496

497497
.avatar-light {
498-
background: var(--el-color-primary-light-4);
498+
background: var(--el-color-primary-light-3);
499499
}
500500

501501
.avatar-purple {

0 commit comments

Comments
 (0)