|
@@ -324,7 +324,7 @@
|
|
|
|
|
|
|
|
<!-- 入库设置弹窗 -->
|
|
<!-- 入库设置弹窗 -->
|
|
|
<el-dialog v-model="ingestDialogVisible" title="入库设置" width="400px">
|
|
<el-dialog v-model="ingestDialogVisible" title="入库设置" width="400px">
|
|
|
- <el-form :model="ingestForm" :rules="ingestRules" ref="ingestFormRef" label-width="100px">
|
|
|
|
|
|
|
+ <el-form :model="ingestForm" ref="ingestFormRef" label-width="100px">
|
|
|
<el-form-item label="切分方式" prop="kb_method">
|
|
<el-form-item label="切分方式" prop="kb_method">
|
|
|
<el-select v-model="ingestForm.kb_method" placeholder="请选择切分方式" style="width: 100%">
|
|
<el-select v-model="ingestForm.kb_method" placeholder="请选择切分方式" style="width: 100%">
|
|
|
<el-option label="按长度切分" value="length" />
|
|
<el-option label="按长度切分" value="length" />
|
|
@@ -868,7 +868,7 @@ const tempTagValue = ref<number | null>(null)
|
|
|
const cascaderKey = ref(0)
|
|
const cascaderKey = ref(0)
|
|
|
const taskForm = reactive({
|
|
const taskForm = reactive({
|
|
|
project_name: '',
|
|
project_name: '',
|
|
|
- selectedTags: [] as { id: number, name: string }[]
|
|
|
|
|
|
|
+ selectedTags: [] as { id: number, name: string, type?: string }[]
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 标签相关
|
|
// 标签相关
|
|
@@ -883,7 +883,7 @@ const handleAddTag = (val: any) => {
|
|
|
// 检查是否是标签分类(type='category')
|
|
// 检查是否是标签分类(type='category')
|
|
|
if (node.type === 'category' && node.children && node.children.length > 0) {
|
|
if (node.type === 'category' && node.children && node.children.length > 0) {
|
|
|
// 如果是标签分类,添加该分类下的所有标签项
|
|
// 如果是标签分类,添加该分类下的所有标签项
|
|
|
- node.children.forEach(child => {
|
|
|
|
|
|
|
+ node.children.forEach((child: any) => {
|
|
|
if (!taskForm.selectedTags.find(t => t.id === child.value)) {
|
|
if (!taskForm.selectedTags.find(t => t.id === child.value)) {
|
|
|
taskForm.selectedTags.push({ id: child.value, name: child.label, type: child.type })
|
|
taskForm.selectedTags.push({ id: child.value, name: child.label, type: child.type })
|
|
|
}
|
|
}
|
|
@@ -931,13 +931,13 @@ const fetchTagTree = async () => {
|
|
|
if (res.code === '000000' || res.code === 200 || res.code === 0) {
|
|
if (res.code === '000000' || res.code === 200 || res.code === 0) {
|
|
|
tagTree.value = formatTagTree(res.data)
|
|
tagTree.value = formatTagTree(res.data)
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('获取标签树失败:', error)
|
|
console.error('获取标签树失败:', error)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 格式化标签树以适应 Cascader
|
|
// 格式化标签树以适应 Cascader
|
|
|
-const formatTagTree = (data: any[]) => {
|
|
|
|
|
|
|
+const formatTagTree = (data: any[]): any[] => {
|
|
|
return data.map(node => ({
|
|
return data.map(node => ({
|
|
|
value: node.id,
|
|
value: node.id,
|
|
|
label: node.name,
|
|
label: node.name,
|
|
@@ -1146,7 +1146,7 @@ const loadDictOptions = async () => {
|
|
|
value: item.dict_value
|
|
value: item.dict_value
|
|
|
}))
|
|
}))
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('加载字典选项失败:', error)
|
|
console.error('加载字典选项失败:', error)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1230,7 +1230,7 @@ const loadKbOptions = async () => {
|
|
|
value: item.id
|
|
value: item.id
|
|
|
}))
|
|
}))
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('加载知识库选项失败', error)
|
|
console.error('加载知识库选项失败', error)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1341,7 +1341,7 @@ const confirmIngest = async () => {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
await ingestFormRef.value.validate()
|
|
await ingestFormRef.value.validate()
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1440,13 +1440,13 @@ const checkDocumentsCompleteness = async (ids: string[]) => {
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
return true
|
|
return true
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
loading.value = false // 检查完成,关闭 loading
|
|
loading.value = false // 检查完成,关闭 loading
|
|
|
return true
|
|
return true
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
loading.value = false // 出错时也关闭 loading
|
|
loading.value = false // 出错时也关闭 loading
|
|
|
console.error('检查文档完善度失败:', error)
|
|
console.error('检查文档完善度失败:', error)
|
|
|
ElMessage.error('检查文档完善度失败,请重试')
|
|
ElMessage.error('检查文档完善度失败,请重试')
|
|
@@ -1512,7 +1512,7 @@ const confirmAddTask = async () => {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
await taskFormRef.value.validate()
|
|
await taskFormRef.value.validate()
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1716,7 +1716,7 @@ const fetchDocuments = async () => {
|
|
|
stopPolling()
|
|
stopPolling()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('获取文档列表失败:', error)
|
|
console.error('获取文档列表失败:', error)
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -1763,7 +1763,7 @@ const refreshDocumentsSilently = async () => {
|
|
|
}, 5000)
|
|
}, 5000)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('静默刷新失败:', error)
|
|
console.error('静默刷新失败:', error)
|
|
|
} finally {
|
|
} finally {
|
|
|
isRefreshing.value = false
|
|
isRefreshing.value = false
|
|
@@ -1859,7 +1859,7 @@ const submitUpload = async () => {
|
|
|
if (!uploadFormRef.value) return
|
|
if (!uploadFormRef.value) return
|
|
|
try {
|
|
try {
|
|
|
await uploadFormRef.value.validate()
|
|
await uploadFormRef.value.validate()
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
submitting.value = true
|
|
submitting.value = true
|
|
@@ -1872,7 +1872,7 @@ const submitUpload = async () => {
|
|
|
// 上传后可能立即开始转换,启动轮询监控状态
|
|
// 上传后可能立即开始转换,启动轮询监控状态
|
|
|
startPolling()
|
|
startPolling()
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('上传失败:', error)
|
|
console.error('上传失败:', error)
|
|
|
} finally {
|
|
} finally {
|
|
|
submitting.value = false
|
|
submitting.value = false
|
|
@@ -1949,7 +1949,7 @@ const handleEdit = async (row: DocumentItem) => {
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(res.message || '获取文档详情失败')
|
|
ElMessage.error(res.message || '获取文档详情失败')
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('获取文档详情失败:', error)
|
|
console.error('获取文档详情失败:', error)
|
|
|
ElMessage.error('获取文档详情失败')
|
|
ElMessage.error('获取文档详情失败')
|
|
|
}
|
|
}
|
|
@@ -1959,7 +1959,7 @@ const submitEdit = async () => {
|
|
|
if (!editFormRef.value) return
|
|
if (!editFormRef.value) return
|
|
|
try {
|
|
try {
|
|
|
await editFormRef.value.validate()
|
|
await editFormRef.value.validate()
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
submitting.value = true
|
|
submitting.value = true
|
|
@@ -1983,7 +1983,7 @@ const submitEdit = async () => {
|
|
|
editDialogVisible.value = false
|
|
editDialogVisible.value = false
|
|
|
fetchDocuments()
|
|
fetchDocuments()
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('编辑失败:', error)
|
|
console.error('编辑失败:', error)
|
|
|
} finally {
|
|
} finally {
|
|
|
submitting.value = false
|
|
submitting.value = false
|
|
@@ -2076,7 +2076,7 @@ const handleConvert = async (row: DocumentItem) => {
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
// 用户取消
|
|
// 用户取消
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -2099,7 +2099,7 @@ const handleConvert = async (row: DocumentItem) => {
|
|
|
// 失败了恢复状态并刷新
|
|
// 失败了恢复状态并刷新
|
|
|
refreshDocumentsSilently()
|
|
refreshDocumentsSilently()
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
console.error('启动转换失败:', error)
|
|
console.error('启动转换失败:', error)
|
|
|
// 失败了恢复状态并刷新
|
|
// 失败了恢复状态并刷新
|
|
|
refreshDocumentsSilently()
|
|
refreshDocumentsSilently()
|