Merge branch 'main' of github.com:maxkb-dev/maxkb

This commit is contained in:
shaohuzhang1 2024-01-25 19:22:07 +08:00
commit 1254e5c5ff
4 changed files with 73 additions and 51 deletions

View File

@ -6,56 +6,58 @@
destroy-on-close
append-to-body
>
<el-scrollbar height="450">
<div class="p-16">
<el-form label-position="top">
<el-form-item label="用户问题">
<el-input v-model="detail.problem_text" disabled />
</el-form-item>
<el-form-item label="优化后问题">
<el-input v-model="detail.padding_problem_text" disabled />
</el-form-item>
<el-form-item label="引用分段">
<template v-for="(item, index) in detail.paragraph_list" :key="index">
<CardBox
shadow="never"
:title="item.title || '-'"
class="paragraph-source-card cursor mb-8"
:class="item.is_active ? '' : 'disabled'"
:showIcon="false"
>
<template #icon>
<AppAvatar :name="index + 1 + ''" class="mr-12 avatar-light" :size="22" />
</template>
<div class="active-button primary">{{ item.similarity?.toFixed(3) }}</div>
<template #description>
<el-scrollbar height="90">
{{ item.content }}
</el-scrollbar>
</template>
<template #footer>
<div class="footer-content flex-between">
<el-text>
<el-icon>
<Document />
</el-icon>
{{ item?.document_name }}
</el-text>
<div class="flex align-center">
<AppAvatar class="mr-8" shape="square" :size="18">
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
</AppAvatar>
<div class="paragraph-source-height">
<el-scrollbar>
<div class="p-16">
<el-form label-position="top">
<el-form-item label="用户问题">
<el-input v-model="detail.problem_text" disabled />
</el-form-item>
<el-form-item label="优化后问题">
<el-input v-model="detail.padding_problem_text" disabled />
</el-form-item>
<el-form-item label="引用分段">
<template v-for="(item, index) in detail.paragraph_list" :key="index">
<CardBox
shadow="never"
:title="item.title || '-'"
class="paragraph-source-card cursor mb-8"
:class="item.is_active ? '' : 'disabled'"
:showIcon="false"
>
<template #icon>
<AppAvatar :name="index + 1 + ''" class="mr-12 avatar-light" :size="22" />
</template>
<div class="active-button primary">{{ item.similarity?.toFixed(3) }}</div>
<template #description>
<el-scrollbar height="90">
{{ item.content }}
</el-scrollbar>
</template>
<template #footer>
<div class="footer-content flex-between">
<el-text>
<el-icon>
<Document />
</el-icon>
{{ item?.document_name }}
</el-text>
<div class="flex align-center">
<AppAvatar class="mr-8" shape="square" :size="18">
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
</AppAvatar>
<span class="ellipsis"> {{ item?.dataset_name }}</span>
<span class="ellipsis"> {{ item?.dataset_name }}</span>
</div>
</div>
</div>
</template>
</CardBox>
</template>
</el-form-item>
</el-form>
</div>
</el-scrollbar>
</template>
</CardBox>
</template>
</el-form-item>
</el-form>
</div>
</el-scrollbar>
</div>
</el-dialog>
</template>
<script setup lang="ts">
@ -88,6 +90,9 @@ defineExpose({ open })
.el-dialog__body {
padding: 8px !important;
}
.paragraph-source-height {
height: calc(100vh - 260px);
}
}
.paragraph-source-card {
height: 210px;

View File

@ -67,7 +67,7 @@
</div>
</template>
</el-dropdown-menu>
<div class="border-t" style="padding: 8px 11px; min-width: 200px">
<div class="breadcrumb__footer border-t" style="padding: 8px 11px; min-width: 200px">
<template v-if="isApplication">
<div
class="w-full text-left cursor"
@ -195,5 +195,10 @@ onMounted(() => {
color: var(--el-menu-active-color);
}
}
&__footer {
&:hover {
background-color: var(--app-text-color-light-1);
}
}
}
</style>

View File

@ -498,3 +498,12 @@ h4 {
border: 1px solid var(--el-color-primary);
}
}
// AI模型选择添加模型hover样式
.select-model {
.el-select-dropdown__footer {
&:hover {
background-color: var(--el-fill-color-light);
}
}
}

View File

@ -56,6 +56,7 @@
v-model="applicationForm.model_id"
placeholder="请选择 AI 模型"
style="width: 100%"
popper-class="select-model"
>
<el-option-group
v-for="(value, label) in modelOptions"
@ -163,7 +164,7 @@
:max="10000"
style="width: 200px"
size="small"
class="customer-slider"
class="custom-slider"
/>
<span class="ml-4">个字符</span>
</div>
@ -560,9 +561,11 @@ onMounted(() => {
background: var(--app-layout-bg-color);
}
}
.customer-slider {
.custom-slider {
:deep(.el-input-number.is-without-controls .el-input__wrapper) {
padding: 0 !important;
}
}
</style>