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

59 lines
1.7 KiB
Vue
Raw Normal View History

2024-07-01 01:45:59 +00:00
<template>
<CardBox
shadow="never"
:title="data.title || '-'"
class="paragraph-source-card cursor mb-8 paragraph-source-card-height"
:class="data.is_active ? '' : 'disabled'"
:showIcon="false"
>
<template #icon>
<AppAvatar class="mr-12 avatar-light" :size="22"> {{ index + 1 + '' }}</AppAvatar>
</template>
<div class="active-button primary">{{ data.similarity?.toFixed(3) }}</div>
<template #description>
<el-scrollbar height="150">
<MdPreview ref="editorRef" editorId="preview-only" :modelValue="data.content" />
</el-scrollbar>
</template>
<template #footer>
<div class="footer-content flex-between">
2024-10-29 10:53:02 +00:00
<el-text class="flex align-center" style="width: 70%">
2024-10-25 10:51:05 +00:00
<el-icon class="mr-4">
2024-07-01 01:45:59 +00:00
<Document />
</el-icon>
2024-10-30 03:08:25 +00:00
<span class="ellipsis" :title="data?.document_name?.trim()"> {{ data?.document_name.trim() }}</span>
2024-07-01 01:45:59 +00:00
</el-text>
2024-07-15 10:08:02 +00:00
<div class="flex align-center" style="line-height: 32px">
<AppAvatar class="mr-8 avatar-blue" shape="square" :size="18">
2024-07-01 01:45:59 +00:00
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
</AppAvatar>
2024-10-30 03:08:25 +00:00
<span class="ellipsis" :title="data?.dataset_name"> {{ data?.dataset_name }}</span>
2024-07-01 01:45:59 +00:00
</div>
</div>
</template>
</CardBox>
</template>
<script setup lang="ts">
const props = defineProps({
data: {
type: Object,
default: () => {}
},
index: {
type: Number,
default: 0
}
})
</script>
<style lang="scss" scoped>
.paragraph-source-card-height {
height: 260px;
}
@media only screen and (max-width: 768px) {
.paragraph-source-card-height {
2024-07-15 10:08:02 +00:00
height: 285px;
}
2024-07-01 01:45:59 +00:00
}
</style>