mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
feat: 命中测试
This commit is contained in:
parent
6288edf02a
commit
3e6ff41ebe
|
|
@ -8,7 +8,7 @@
|
|||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
</slot>
|
||||
<h4 class="ellipsis-1" style="width: 100%">{{ title }}</h4>
|
||||
<h4 class="ellipsis-1" style="width: 80%">{{ title }}</h4>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<back-button :to="activeMenu"></back-button>
|
||||
<el-dropdown placement="top" trigger="click" @command="changeMenu" class="w-full" style="display: block;">
|
||||
<div class="flex-between">
|
||||
<div class="ellipsis-1">{{ currentName }}</div>
|
||||
<div class="ellipsis">{{ currentName }}</div>
|
||||
<el-button text>
|
||||
<el-icon><CaretBottom /></el-icon>
|
||||
</el-button>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
|
||||
<span class="ellipsis-1"> {{ item?.name }}</span>
|
||||
<span class="ellipsis"> {{ item?.name }}</span>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ h4 {
|
|||
超出省略号
|
||||
*/
|
||||
|
||||
.ellipsis-1 {
|
||||
.ellipsis {
|
||||
display: inline-block;
|
||||
max-width: 130px;
|
||||
text-overflow: ellipsis;
|
||||
|
|
@ -256,6 +256,13 @@ h4 {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ellipsis-1 {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.break-all {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
|
@ -375,6 +382,10 @@ h4 {
|
|||
background: var(--app-avatar-gradient-color);
|
||||
}
|
||||
|
||||
.avatar-light {
|
||||
background: var(--el-color-primary-light-4);
|
||||
}
|
||||
|
||||
.success {
|
||||
color: var(--el-color-success);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,3 +50,9 @@ export function realatedObject(list: any, val: string | number, attr: string) {
|
|||
return filterData || null
|
||||
}
|
||||
|
||||
// 排序
|
||||
export function arraySort(list: Array<string>, property: any, desc?: boolean) {
|
||||
return list.sort((a: any, b: any) => {
|
||||
return desc ? b[property] - a[property] : a[property] - b[property]
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
shape="square"
|
||||
:size="32"
|
||||
/>
|
||||
<h4 class="ellipsis-1">{{ detail?.name }}</h4>
|
||||
<h4 class="ellipsis">{{ detail?.name }}</h4>
|
||||
</div>
|
||||
|
||||
<el-row :gutter="12">
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@
|
|||
<AppAvatar class="mr-12" shape="square" :size="32">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<div class="ellipsis-1">
|
||||
<div class="ellipsis">
|
||||
{{ realatedObject(datasetList, item, 'id')?.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<el-row :gutter="12" v-loading="loading">
|
||||
<el-col :span="12" v-for="(item, index) in data" :key="index" class="mb-16">
|
||||
<CardCheckbox value-field="id" :data="item" v-model="checkList">
|
||||
<span class="ellipsis-1">
|
||||
<span class="ellipsis">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</CardCheckbox>
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
show-input
|
||||
:show-input-controls="false"
|
||||
:min="50"
|
||||
:max="1024"
|
||||
:max="4096"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-item mb-16">
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@
|
|||
:showIcon="false"
|
||||
@click="editParagraph(item)"
|
||||
>
|
||||
<template #icon>
|
||||
<AppAvatar :name="index + 1 + ''" class="mr-12 avatar-light" :size="22" />
|
||||
</template>
|
||||
<div class="active-button primary">{{ (item.similarity * 100).toFixed(2) }}%</div>
|
||||
<template #footer>
|
||||
<div class="footer-content flex-between">
|
||||
|
|
@ -140,6 +143,7 @@ import { useRoute } from 'vue-router'
|
|||
import datasetApi from '@/api/dataset'
|
||||
import applicationApi from '@/api/application'
|
||||
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
||||
import { arraySort } from '@/utils/utils'
|
||||
|
||||
const route = useRoute()
|
||||
const {
|
||||
|
|
@ -194,13 +198,13 @@ function getHitTestList() {
|
|||
}
|
||||
if (isDataset.value) {
|
||||
datasetApi.getDatasetHitTest(id, obj, loading).then((res) => {
|
||||
paragraphDetail.value = res.data
|
||||
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
|
||||
questionTitle.value = inputValue.value
|
||||
inputValue.value = ''
|
||||
})
|
||||
} else if (isApplication.value) {
|
||||
applicationApi.getApplicationHitTest(id, obj, loading).then((res) => {
|
||||
paragraphDetail.value = res.data
|
||||
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
|
||||
questionTitle.value = inputValue.value
|
||||
inputValue.value = ''
|
||||
})
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<el-input
|
||||
v-model="form.content"
|
||||
placeholder="请输入内容"
|
||||
maxlength="1024"
|
||||
maxlength="4096"
|
||||
show-word-limit
|
||||
:rows="8"
|
||||
type="textarea"
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<AppAvatar v-if="!node.isLeaf" class="mr-12" shape="square" :size="24">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<span class="ellipsis-1"> {{ data.name }}</span>
|
||||
<span class="ellipsis"> {{ data.name }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
<el-input
|
||||
v-model="form.content"
|
||||
placeholder="请输入分段内容"
|
||||
maxlength="1024"
|
||||
maxlength="4096"
|
||||
show-word-limit
|
||||
:rows="15"
|
||||
type="textarea"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
v-if="isEdit"
|
||||
v-model="form.content"
|
||||
placeholder="请输入分段内容"
|
||||
maxlength="1024"
|
||||
maxlength="4096"
|
||||
show-word-limit
|
||||
:rows="8"
|
||||
type="textarea"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<AppAvatar v-else-if="isDataset" class="mr-12" shape="square" :size="24">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<span class="ellipsis-1"> {{ row?.name }}</span>
|
||||
<span class="ellipsis"> {{ row?.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
<ul>
|
||||
<li class="flex mt-16">
|
||||
<el-text type="info">模型类型</el-text>
|
||||
<span class="ellipsis-1 ml-16"> {{ model.model_type }}</span>
|
||||
<span class="ellipsis ml-16"> {{ model.model_type }}</span>
|
||||
</li>
|
||||
<li class="flex mt-12">
|
||||
<el-text type="info">模型名称</el-text>
|
||||
<span class="ellipsis-1 ml-16"> {{ model.model_name }}</span>
|
||||
<span class="ellipsis ml-16"> {{ model.model_name }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue