Skip to content

Commit cc2789f

Browse files
committed
fix: import add warning
--bug=1054090 --user=王孝刚 【知识库】飞书知识库-导入文档-未选择导入文件时,导入有提示信息 https://www.tapd.cn/57709429/s/1678039
1 parent 3fe47e0 commit cc2789f

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

ui/src/locales/lang/en-US/views/document.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export default {
173173
selectDocument: 'Select Document',
174174
tip1: 'Only documents and tables are supported. Documents will be segmented based on titles, and tables will be converted to Markdown format before segmentation.',
175175
tip2: 'The system does not store the original document. Before importing the document, it is recommended to standardize the document segmentation markers.',
176-
allCheck: 'Select All'
176+
allCheck: 'Select All',
177+
errorMessage1: 'Please select a document'
177178
}
178179
}

ui/src/locales/lang/zh-CN/views/document.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ export default {
170170
selectDocument: '选择文档',
171171
tip1: '仅支持文档和表格类型,文档会根据标题分段,表格会转为Markdown格式后再分段。',
172172
tip2: '系统不存储原始文档,导入文档前,建议规范文档的分段标识。',
173-
allCheck: '全选'
173+
allCheck: '全选',
174+
errorMessage1: '请选择文档'
174175
}
175176
}

ui/src/locales/lang/zh-Hant/views/document.ts

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

ui/src/views/dataset/ImportDocumentDataset.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@change="handleAllCheckChange"
4242
/>
4343
</div>
44-
<div style="height:calc(100vh - 430px)">
44+
<div style="height: calc(100vh - 430px)">
4545
<el-scrollbar>
4646
<el-tree
4747
:props="props"
@@ -94,7 +94,7 @@
9494
<script setup lang="ts">
9595
import { ref, reactive, computed, onUnmounted } from 'vue'
9696
import { useRouter, useRoute } from 'vue-router'
97-
import { MsgConfirm, MsgSuccess } from '@/utils/message'
97+
import { MsgConfirm, MsgSuccess, MsgWarning } from '@/utils/message'
9898
import { getImgUrl } from '@/utils/utils'
9999
import { t } from '@/locales'
100100
import type Node from 'element-plus/es/components/tree/src/model/node'
@@ -186,6 +186,12 @@ function submit() {
186186
type: node.type
187187
}
188188
})
189+
if (newList.length === 0) {
190+
disabled.value = false
191+
MsgWarning(t('views.document.feishu.errorMessage1'))
192+
loading.value = false
193+
return
194+
}
189195
dataset
190196
.importLarkDocument(datasetId, newList, loading)
191197
.then((res) => {

0 commit comments

Comments
 (0)