diff --git a/ui/src/views/application/component/AddDatasetDialog.vue b/ui/src/views/application/component/AddDatasetDialog.vue index 0e905922a..41cd2bea8 100644 --- a/ui/src/views/application/component/AddDatasetDialog.vue +++ b/ui/src/views/application/component/AddDatasetDialog.vue @@ -14,7 +14,7 @@

{{ $t('views.application.applicationForm.dialogues.addDataset') }}

-
+
{{ $t('views.application.applicationForm.dialogues.refresh') }} @@ -22,9 +22,18 @@
- - 所选知识库必须使用相同的 Embedding 模型 - +
+ + 所选知识库必须使用相同的 Embedding 模型 + + +
@@ -76,17 +85,28 @@ const emit = defineEmits(['addData', 'refresh']) const dialogVisible = ref(false) const checkList = ref([]) const currentEmbedding = ref('') +const searchValue = ref('') +const searchDate = ref([]) const filterData = computed(() => { return currentEmbedding.value - ? props.data.filter((v) => v.embedding_mode_id === currentEmbedding.value) - : props.data + ? searchDate.value.filter((v) => v.embedding_mode_id === currentEmbedding.value) + : searchDate.value }) watch(dialogVisible, (bool) => { if (!bool) { checkList.value = [] currentEmbedding.value = '' + searchValue.value = '' + } +}) + +watch(searchValue, (val) => { + if (val) { + searchDate.value = props.data.filter((v) => v.name.includes(val)) + } else { + searchDate.value = props.data } }) @@ -105,6 +125,7 @@ function clearCheck() { } const open = (checked: any) => { + searchDate.value = props.data checkList.value = checked if (checkList.value.length > 0) { currentEmbedding.value = props.data.filter( @@ -137,9 +158,7 @@ defineExpose({ open }) .el-dialog__footer { padding: 8px 24px 24px 24px; } - .el-dialog__header.show-close { - padding-right: 34px; - } + .el-dialog__headerbtn { top: 13px; }