fix: import add warning

--bug=1054090 --user=王孝刚 【知识库】飞书知识库-导入文档-未选择导入文件时,导入有提示信息 https://www.tapd.cn/57709429/s/1678039
This commit is contained in:
wxg0103 2025-03-28 15:45:08 +08:00 committed by wxg
parent 3fe47e0fb3
commit cc2789f37f
4 changed files with 17 additions and 8 deletions

View File

@ -173,6 +173,7 @@ export default {
selectDocument: 'Select Document',
tip1: 'Only documents and tables are supported. Documents will be segmented based on titles, and tables will be converted to Markdown format before segmentation.',
tip2: 'The system does not store the original document. Before importing the document, it is recommended to standardize the document segmentation markers.',
allCheck: 'Select All'
allCheck: 'Select All',
errorMessage1: 'Please select a document'
}
}

View File

@ -170,6 +170,7 @@ export default {
selectDocument: '选择文档',
tip1: '仅支持文档和表格类型文档会根据标题分段表格会转为Markdown格式后再分段。',
tip2: '系统不存储原始文档,导入文档前,建议规范文档的分段标识。',
allCheck: '全选'
allCheck: '全选',
errorMessage1: '请选择文档'
}
}

View File

@ -12,7 +12,7 @@ export default {
cancelGenerateQuestion: '取消生成問題',
cancelVectorization: '取消向量化',
cancelGenerate: '取消生成',
export: '匯出',
export: '匯出'
},
tip: {
saveMessage: '當前的更改尚未保存,確認退出嗎?',
@ -149,7 +149,7 @@ export default {
label: '相似度高于',
placeholder: '直接返回分段内容',
requiredMessage: '请输入相似度'
},
}
},
hitHandlingMethod: {
optimization: '模型優化',
@ -163,12 +163,13 @@ export default {
tip3: '標籤中,系統會自動關聯標籤中的問題;',
tip4: '生成效果取決於所選模型和提示詞,用戶可自行調整至最佳效果。',
prompt1: `內容:{data}\n\n請總結上面的內容並根據內容總結生成 5 個問題。\n回答要求\n - 請只輸出問題;\n - 請將每個問題放置在`,
prompt2: `標籤中。`,
prompt2: `標籤中。`
},
feishu: {
selectDocument: '選擇文檔',
tip1: '僅支持文檔和表格類型文檔會根據標題分段表格會轉為Markdown格式後再分段。',
tip2: '系統不存儲原始文檔,導入文檔前,建議規範文檔的分段標識。',
allCheck: '全選'
allCheck: '全選',
errorMessage1: '請選擇文檔'
}
}

View File

@ -41,7 +41,7 @@
@change="handleAllCheckChange"
/>
</div>
<div style="height:calc(100vh - 430px)">
<div style="height: calc(100vh - 430px)">
<el-scrollbar>
<el-tree
:props="props"
@ -94,7 +94,7 @@
<script setup lang="ts">
import { ref, reactive, computed, onUnmounted } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { MsgConfirm, MsgSuccess } from '@/utils/message'
import { MsgConfirm, MsgSuccess, MsgWarning } from '@/utils/message'
import { getImgUrl } from '@/utils/utils'
import { t } from '@/locales'
import type Node from 'element-plus/es/components/tree/src/model/node'
@ -186,6 +186,12 @@ function submit() {
type: node.type
}
})
if (newList.length === 0) {
disabled.value = false
MsgWarning(t('views.document.feishu.errorMessage1'))
loading.value = false
return
}
dataset
.importLarkDocument(datasetId, newList, loading)
.then((res) => {