feat: add allow_download option to document form

This commit is contained in:
CaptainB 2025-08-18 14:04:21 +08:00
parent b32b06391f
commit f1c7f0f3af
4 changed files with 18 additions and 0 deletions

View File

@ -158,6 +158,9 @@ export default {
placeholder: 'Directly return segment content',
requiredMessage: 'Please enter similarity value',
},
allow_download: {
label: 'Allow download in knowledge base source',
}
},
hitHandlingMethod: {
optimization: 'Model optimization',

View File

@ -151,6 +151,9 @@ export default {
placeholder: '直接返回分段内容',
requiredMessage: '请输入相似度',
},
allow_download: {
label: '允许在知识库来源中下载',
}
},
hitHandlingMethod: {
optimization: '模型优化',

View File

@ -154,6 +154,9 @@ export default {
placeholder: '直接返回分段内容',
requiredMessage: '请输入相似度',
},
allow_download: {
label: '允許在知識庫來源下載',
}
},
hitHandlingMethod: {
optimization: '模型優化',

View File

@ -80,6 +80,11 @@
/><span>{{ $t('views.document.form.similarity.placeholder') }}</span>
</div>
</el-form-item>
<el-form-item prop="allow_download">
<el-checkbox v-model="form.allow_download">
{{ $t('views.document.form.allow_download.label') }}
</el-checkbox>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
@ -127,6 +132,7 @@ const form = ref<any>({
selector: '',
hit_handling_method: 'optimization',
directly_return_similarity: 0.9,
allow_download: false,
})
//
@ -162,6 +168,7 @@ watch(dialogVisible, (bool) => {
selector: '',
hit_handling_method: 'optimization',
directly_return_similarity: 0.9,
allow_download: false,
}
isImport.value = false
documentType.value = ''
@ -200,6 +207,7 @@ const submit = async (formEl: FormInstance | undefined) => {
const obj = {
source_url_list: form.value.source_url.split('\n'),
selector: form.value.selector,
allow_download: form.value.allow_download,
}
loadSharedApi({ type: 'document', systemType: apiType.value })
.postWebDocument(id, obj, loading)
@ -219,6 +227,7 @@ const submit = async (formEl: FormInstance | undefined) => {
...{
source_url: form.value.source_url,
selector: form.value.selector,
allow_download: form.value.allow_download,
},
},
}