Skip to content

Commit

Permalink
perf: 【命中测试】优化提示内容(#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan-fit2cloud authored Apr 18, 2024
1 parent 0b083ee commit b719946
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Binary file added ui/src/assets/hit-test-empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions ui/src/views/hit-test/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
</div>
<el-scrollbar>
<div class="hit-test-height">
<el-empty v-if="paragraphDetail.length == 0" description="暂无数据" />
<el-empty v-if="first" :image="emptyImg" description="命中段落显示在这里" />
<el-empty v-else-if="paragraphDetail.length == 0" description="没有命中的分段" />
<el-row v-else>
<el-col
:xs="24"
Expand All @@ -43,7 +44,8 @@
>
<template #icon>
<AppAvatar class="mr-12 avatar-light" :size="22">
{{ index + 1 + '' }}</AppAvatar>
{{ index + 1 + '' }}</AppAvatar
>
</template>
<div class="active-button primary">{{ item.similarity?.toFixed(3) }}</div>
<template #footer>
Expand Down Expand Up @@ -145,6 +147,7 @@ import datasetApi from '@/api/dataset'
import applicationApi from '@/api/application'
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
import { arraySort } from '@/utils/utils'
import emptyImg from '@/assets/hit-test-empty.png'
const route = useRoute()
const {
Expand All @@ -161,6 +164,9 @@ const formInline = ref({
top_number: 5
})
// 第一次加载
const first = ref(true)
const cloneForm = ref<any>({})
const popoverVisible = ref(false)
Expand Down Expand Up @@ -215,12 +221,14 @@ function getHitTestList() {
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
questionTitle.value = inputValue.value
inputValue.value = ''
first.value = false
})
} else if (isApplication.value) {
applicationApi.getApplicationHitTest(id, obj, loading).then((res) => {
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
questionTitle.value = inputValue.value
inputValue.value = ''
first.value = false
})
}
}
Expand Down

0 comments on commit b719946

Please sign in to comment.