feat: download document
This commit is contained in:
parent
68f26d63d7
commit
33a2a683e1
@ -14,6 +14,7 @@ export default {
|
|||||||
cancelVectorization: 'Cancel Vectorization',
|
cancelVectorization: 'Cancel Vectorization',
|
||||||
cancelGenerate: 'Cancel Generation',
|
cancelGenerate: 'Cancel Generation',
|
||||||
export: 'Export to',
|
export: 'Export to',
|
||||||
|
download: 'Download',
|
||||||
},
|
},
|
||||||
tip: {
|
tip: {
|
||||||
saveMessage: 'Current changes have not been saved. Confirm exit?',
|
saveMessage: 'Current changes have not been saved. Confirm exit?',
|
||||||
|
|||||||
@ -4,16 +4,17 @@ export default {
|
|||||||
syncDocument: '同步文档',
|
syncDocument: '同步文档',
|
||||||
selected: '已选',
|
selected: '已选',
|
||||||
items: '项',
|
items: '项',
|
||||||
migrateDocument:'文档迁移到',
|
migrateDocument: '文档迁移到',
|
||||||
searchBar: {
|
searchBar: {
|
||||||
placeholder: '按 文档名称 搜索'
|
placeholder: '按 文档名称 搜索',
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
migration: '迁移',
|
migration: '迁移',
|
||||||
cancelGenerateQuestion: '取消生成问题',
|
cancelGenerateQuestion: '取消生成问题',
|
||||||
cancelVectorization: '取消向量化',
|
cancelVectorization: '取消向量化',
|
||||||
cancelGenerate: '取消生成',
|
cancelGenerate: '取消生成',
|
||||||
export: '导出'
|
export: '导出',
|
||||||
|
download: '下载原文档',
|
||||||
},
|
},
|
||||||
tip: {
|
tip: {
|
||||||
saveMessage: '当前的更改尚未保存,确认退出吗?',
|
saveMessage: '当前的更改尚未保存,确认退出吗?',
|
||||||
@ -22,7 +23,7 @@ export default {
|
|||||||
vectorizationSuccess: '批量向量化成功',
|
vectorizationSuccess: '批量向量化成功',
|
||||||
nameMessage: '文件名称不能为空!',
|
nameMessage: '文件名称不能为空!',
|
||||||
importMessage: '导入成功',
|
importMessage: '导入成功',
|
||||||
migrationSuccess: '迁移成功'
|
migrationSuccess: '迁移成功',
|
||||||
},
|
},
|
||||||
upload: {
|
upload: {
|
||||||
selectFile: '选择文件',
|
selectFile: '选择文件',
|
||||||
@ -35,71 +36,71 @@ export default {
|
|||||||
errorMessage3: '文件不能为空',
|
errorMessage3: '文件不能为空',
|
||||||
errorMessage4: '每次最多上传50个文件',
|
errorMessage4: '每次最多上传50个文件',
|
||||||
template: '模版',
|
template: '模版',
|
||||||
download: '下载'
|
download: '下载',
|
||||||
},
|
},
|
||||||
|
|
||||||
fileType: {
|
fileType: {
|
||||||
txt: {
|
txt: {
|
||||||
label: '文本文件',
|
label: '文本文件',
|
||||||
tip1: '1、文件上传前,建议规范文件的分段标识',
|
tip1: '1、文件上传前,建议规范文件的分段标识',
|
||||||
tip2: '2、每次最多上传 50 个文件,每个文件不超过 100MB'
|
tip2: '2、每次最多上传 50 个文件,每个文件不超过 100MB',
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
label: '表格',
|
label: '表格',
|
||||||
tip1: '1、点击下载对应模版并完善信息:',
|
tip1: '1、点击下载对应模版并完善信息:',
|
||||||
tip2: '2、第一行必须是列标题,且列标题必须是有意义的术语,表中每条记录将作为一个分段',
|
tip2: '2、第一行必须是列标题,且列标题必须是有意义的术语,表中每条记录将作为一个分段',
|
||||||
tip3: '3、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称',
|
tip3: '3、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称',
|
||||||
tip4: '4、每次最多上传 50 个文件,每个文件不超过 100MB'
|
tip4: '4、每次最多上传 50 个文件,每个文件不超过 100MB',
|
||||||
},
|
},
|
||||||
QA: {
|
QA: {
|
||||||
label: 'QA 问答对',
|
label: 'QA 问答对',
|
||||||
tip1: '1、点击下载对应模版并完善信息',
|
tip1: '1、点击下载对应模版并完善信息',
|
||||||
tip2: '2、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称',
|
tip2: '2、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称',
|
||||||
tip3: '3、每次最多上传 50 个文件,每个文件不超过 100MB'
|
tip3: '3、每次最多上传 50 个文件,每个文件不超过 100MB',
|
||||||
},
|
},
|
||||||
lark: {}
|
lark: {},
|
||||||
},
|
},
|
||||||
setRules: {
|
setRules: {
|
||||||
title: {
|
title: {
|
||||||
setting: '设置分段规则',
|
setting: '设置分段规则',
|
||||||
preview: '分段预览'
|
preview: '分段预览',
|
||||||
},
|
},
|
||||||
intelligent: {
|
intelligent: {
|
||||||
label: '智能分段(推荐)',
|
label: '智能分段(推荐)',
|
||||||
text: '不了解如何设置分段规则推荐使用智能分段'
|
text: '不了解如何设置分段规则推荐使用智能分段',
|
||||||
},
|
},
|
||||||
advanced: {
|
advanced: {
|
||||||
label: '高级分段',
|
label: '高级分段',
|
||||||
text: '用户可根据文档规范自行设置分段标识符、分段长度以及清洗规则'
|
text: '用户可根据文档规范自行设置分段标识符、分段长度以及清洗规则',
|
||||||
},
|
},
|
||||||
patterns: {
|
patterns: {
|
||||||
label: '分段标识',
|
label: '分段标识',
|
||||||
tooltip: '按照所选符号先后顺序做递归分割,分割结果超出分段长度将截取至分段长度。',
|
tooltip: '按照所选符号先后顺序做递归分割,分割结果超出分段长度将截取至分段长度。',
|
||||||
placeholder: '请选择'
|
placeholder: '请选择',
|
||||||
},
|
},
|
||||||
limit: {
|
limit: {
|
||||||
label: '分段长度'
|
label: '分段长度',
|
||||||
},
|
},
|
||||||
with_filter: {
|
with_filter: {
|
||||||
label: '自动清洗',
|
label: '自动清洗',
|
||||||
text: '去掉重复多余符号空格、空行、制表符'
|
text: '去掉重复多余符号空格、空行、制表符',
|
||||||
},
|
},
|
||||||
checkedConnect: {
|
checkedConnect: {
|
||||||
label: '导入时添加分段标题为关联问题(适用于标题为问题的问答对)'
|
label: '导入时添加分段标题为关联问题(适用于标题为问题的问答对)',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
prev: '上一步',
|
prev: '上一步',
|
||||||
next: '下一步',
|
next: '下一步',
|
||||||
import: '开始导入',
|
import: '开始导入',
|
||||||
preview: '生成预览'
|
preview: '生成预览',
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
name: '文件名称',
|
name: '文件名称',
|
||||||
char_length: '字符数',
|
char_length: '字符数',
|
||||||
paragraph: '分段',
|
paragraph: '分段',
|
||||||
all: '全部',
|
all: '全部',
|
||||||
updateTime: '更新时间'
|
updateTime: '更新时间',
|
||||||
},
|
},
|
||||||
fileStatus: {
|
fileStatus: {
|
||||||
label: '文件状态',
|
label: '文件状态',
|
||||||
@ -110,19 +111,19 @@ export default {
|
|||||||
GENERATE: '生成中',
|
GENERATE: '生成中',
|
||||||
SYNC: '同步中',
|
SYNC: '同步中',
|
||||||
REVOKE: '取消中',
|
REVOKE: '取消中',
|
||||||
finish: '完成'
|
finish: '完成',
|
||||||
},
|
},
|
||||||
enableStatus: {
|
enableStatus: {
|
||||||
label: '启用状态',
|
label: '启用状态',
|
||||||
enable: '开启',
|
enable: '开启',
|
||||||
close: '关闭'
|
close: '关闭',
|
||||||
},
|
},
|
||||||
sync: {
|
sync: {
|
||||||
label: '同步',
|
label: '同步',
|
||||||
confirmTitle: '确认同步文档?',
|
confirmTitle: '确认同步文档?',
|
||||||
confirmMessage1: '同步将删除已有数据重新获取新数据,请谨慎操作。',
|
confirmMessage1: '同步将删除已有数据重新获取新数据,请谨慎操作。',
|
||||||
confirmMessage2: '无法同步,请先去设置文档 URL地址',
|
confirmMessage2: '无法同步,请先去设置文档 URL地址',
|
||||||
successMessage: '同步文档成功'
|
successMessage: '同步文档成功',
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
confirmTitle1: '是否批量删除',
|
confirmTitle1: '是否批量删除',
|
||||||
@ -131,31 +132,31 @@ export default {
|
|||||||
successMessage: '批量删除成功',
|
successMessage: '批量删除成功',
|
||||||
confirmTitle3: '是否删除文档:',
|
confirmTitle3: '是否删除文档:',
|
||||||
confirmMessage1: '此文档下的',
|
confirmMessage1: '此文档下的',
|
||||||
confirmMessage2: '个分段都会被删除,请谨慎操作。'
|
confirmMessage2: '个分段都会被删除,请谨慎操作。',
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
source_url: {
|
source_url: {
|
||||||
label: '文档地址',
|
label: '文档地址',
|
||||||
placeholder: '请输入文档地址,一行一个,地址不正确文档会导入失败。',
|
placeholder: '请输入文档地址,一行一个,地址不正确文档会导入失败。',
|
||||||
requiredMessage: '请输入文档地址'
|
requiredMessage: '请输入文档地址',
|
||||||
},
|
},
|
||||||
selector: {
|
selector: {
|
||||||
label: '选择器',
|
label: '选择器',
|
||||||
placeholder: '默认为 body,可输入 .classname/#idname/tagname'
|
placeholder: '默认为 body,可输入 .classname/#idname/tagname',
|
||||||
},
|
},
|
||||||
hit_handling_method: {
|
hit_handling_method: {
|
||||||
label: '命中处理方式',
|
label: '命中处理方式',
|
||||||
tooltip: '用户提问时,命中文档下的分段时按照设置的方式进行处理。'
|
tooltip: '用户提问时,命中文档下的分段时按照设置的方式进行处理。',
|
||||||
},
|
},
|
||||||
similarity: {
|
similarity: {
|
||||||
label: '相似度高于',
|
label: '相似度高于',
|
||||||
placeholder: '直接返回分段内容',
|
placeholder: '直接返回分段内容',
|
||||||
requiredMessage: '请输入相似度'
|
requiredMessage: '请输入相似度',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
hitHandlingMethod: {
|
hitHandlingMethod: {
|
||||||
optimization: '模型优化',
|
optimization: '模型优化',
|
||||||
directly_return: '直接回答'
|
directly_return: '直接回答',
|
||||||
},
|
},
|
||||||
generateQuestion: {
|
generateQuestion: {
|
||||||
title: '生成问题',
|
title: '生成问题',
|
||||||
@ -165,13 +166,13 @@ export default {
|
|||||||
tip3: '标签中,系统会自动关联标签中的问题;',
|
tip3: '标签中,系统会自动关联标签中的问题;',
|
||||||
tip4: '生成效果依赖于所选模型和提示词,用户可自行调整至最佳效果。',
|
tip4: '生成效果依赖于所选模型和提示词,用户可自行调整至最佳效果。',
|
||||||
prompt1: `内容:{data}\n\n请总结上面的内容,并根据内容总结生成 5 个问题。\n回答要求:\n- 请只输出问题;\n- 请将每个问题放置`,
|
prompt1: `内容:{data}\n\n请总结上面的内容,并根据内容总结生成 5 个问题。\n回答要求:\n- 请只输出问题;\n- 请将每个问题放置`,
|
||||||
prompt2: `标签中。`
|
prompt2: `标签中。`,
|
||||||
},
|
},
|
||||||
feishu: {
|
feishu: {
|
||||||
selectDocument: '选择文档',
|
selectDocument: '选择文档',
|
||||||
tip1: '支持文档和表格类型,包含TXT、Markdown、PDF、DOCX、HTML、XLS、XLSX、CSV、ZIP格式;',
|
tip1: '支持文档和表格类型,包含TXT、Markdown、PDF、DOCX、HTML、XLS、XLSX、CSV、ZIP格式;',
|
||||||
tip2: '系统不存储原始文档,导入文档前,建议规范文档的分段标识。',
|
tip2: '系统不存储原始文档,导入文档前,建议规范文档的分段标识。',
|
||||||
allCheck: '全选',
|
allCheck: '全选',
|
||||||
errorMessage1: '请选择文档'
|
errorMessage1: '请选择文档',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ export default {
|
|||||||
cancelVectorization: '取消向量化',
|
cancelVectorization: '取消向量化',
|
||||||
cancelGenerate: '取消生成',
|
cancelGenerate: '取消生成',
|
||||||
export: '匯出',
|
export: '匯出',
|
||||||
|
download: '下載原文件',
|
||||||
},
|
},
|
||||||
tip: {
|
tip: {
|
||||||
saveMessage: '當前的更改尚未保存,確認退出嗎?',
|
saveMessage: '當前的更改尚未保存,確認退出嗎?',
|
||||||
|
|||||||
@ -82,7 +82,6 @@
|
|||||||
v-if="knowledgeDetail?.type === 2 && permissionPrecise.doc_sync(id)"
|
v-if="knowledgeDetail?.type === 2 && permissionPrecise.doc_sync(id)"
|
||||||
>{{ $t('views.document.syncDocument') }}
|
>{{ $t('views.document.syncDocument') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
divided
|
divided
|
||||||
@click="deleteMulDocument"
|
@click="deleteMulDocument"
|
||||||
@ -445,6 +444,9 @@
|
|||||||
<AppIcon iconName="app-export"></AppIcon>
|
<AppIcon iconName="app-export"></AppIcon>
|
||||||
{{ $t('views.document.setting.export') }} Zip
|
{{ $t('views.document.setting.export') }} Zip
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="Download" @click.stop="downloadDocument(row)">
|
||||||
|
{{ $t('views.document.setting.download') }}
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
@click.stop="deleteDocument(row)"
|
@click.stop="deleteDocument(row)"
|
||||||
@ -938,6 +940,14 @@ function batchRefresh() {
|
|||||||
embeddingContentDialogRef.value?.open(embeddingBatchDocument)
|
embeddingContentDialogRef.value?.open(embeddingBatchDocument)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function downloadDocument(row: any) {
|
||||||
|
loadSharedApi({ type: 'document', systemType: apiType.value })
|
||||||
|
.getDownloadSourceFile(id, row.id)
|
||||||
|
.then(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function deleteDocument(row: any) {
|
function deleteDocument(row: any) {
|
||||||
MsgConfirm(
|
MsgConfirm(
|
||||||
`${t('views.document.delete.confirmTitle3')} ${row.name} ?`,
|
`${t('views.document.delete.confirmTitle3')} ${row.name} ?`,
|
||||||
@ -1073,7 +1083,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
getList()
|
getList()
|
||||||
// 初始化定时任务
|
// 初始化定时任务
|
||||||
// initInterval()
|
initInterval()
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user