Skip to content

Commit b719946

Browse files
perf: 【命中测试】优化提示内容(#112)
1 parent 0b083ee commit b719946

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ui/src/assets/hit-test-empty.png

4.71 KB
Loading

ui/src/views/hit-test/index.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
</div>
2121
<el-scrollbar>
2222
<div class="hit-test-height">
23-
<el-empty v-if="paragraphDetail.length == 0" description="暂无数据" />
23+
<el-empty v-if="first" :image="emptyImg" description="命中段落显示在这里" />
24+
<el-empty v-else-if="paragraphDetail.length == 0" description="没有命中的分段" />
2425
<el-row v-else>
2526
<el-col
2627
:xs="24"
@@ -43,7 +44,8 @@
4344
>
4445
<template #icon>
4546
<AppAvatar class="mr-12 avatar-light" :size="22">
46-
{{ index + 1 + '' }}</AppAvatar>
47+
{{ index + 1 + '' }}</AppAvatar
48+
>
4749
</template>
4850
<div class="active-button primary">{{ item.similarity?.toFixed(3) }}</div>
4951
<template #footer>
@@ -145,6 +147,7 @@ import datasetApi from '@/api/dataset'
145147
import applicationApi from '@/api/application'
146148
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
147149
import { arraySort } from '@/utils/utils'
150+
import emptyImg from '@/assets/hit-test-empty.png'
148151
149152
const route = useRoute()
150153
const {
@@ -161,6 +164,9 @@ const formInline = ref({
161164
top_number: 5
162165
})
163166
167+
// 第一次加载
168+
const first = ref(true)
169+
164170
const cloneForm = ref<any>({})
165171
166172
const popoverVisible = ref(false)
@@ -215,12 +221,14 @@ function getHitTestList() {
215221
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
216222
questionTitle.value = inputValue.value
217223
inputValue.value = ''
224+
first.value = false
218225
})
219226
} else if (isApplication.value) {
220227
applicationApi.getApplicationHitTest(id, obj, loading).then((res) => {
221228
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
222229
questionTitle.value = inputValue.value
223230
inputValue.value = ''
231+
first.value = false
224232
})
225233
}
226234
}

0 commit comments

Comments
 (0)