Skip to content

Commit eb8dbdb

Browse files
fix: Optimize copywriting
1 parent e4c8a25 commit eb8dbdb

File tree

7 files changed

+55
-24
lines changed

7 files changed

+55
-24
lines changed

ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@
402402
<template
403403
v-if="data.type === WorkflowType.ToolLib || data.type === WorkflowType.ToolLibCustom"
404404
>
405-
<div class="card-never border-r-6 mt-8">
405+
<div class="card-never border-r-6 mt-8" v-if="data.index != 0">
406406
<h5 class="p-8-12">{{ $t('chat.executionDetails.input') }}</h5>
407407
<div class="p-8-12 border-t-dashed lighter pre-wrap">
408408
{{ data.params || '-' }}
@@ -1162,7 +1162,11 @@
11621162
<!-- 知识库写入 -->
11631163
<template v-if="data.type === WorkflowType.KnowledgeWriteNode">
11641164
<div class="card-never border-r-6 mt-8">
1165-
<h5 class="p-8-12">{{ $t('chat.executionDetails.writeContent') }}</h5>
1165+
<h5 class="p-8-12">
1166+
{{ $t('chat.executionDetails.writeContent') }}({{
1167+
$t('chat.executionDetails.documentSplitTip')
1168+
}})
1169+
</h5>
11661170
<div class="p-8-12 border-t-dashed lighter">
11671171
<el-tabs v-model="currentWriteContent" class="paragraph-tabs">
11681172
<template v-for="(item, index) in data.write_content" :key="index">
@@ -1199,9 +1203,8 @@
11991203
{{ $t('views.document.form.selector.label') }}: {{ data.input_params.selector }}
12001204
</p>
12011205
<p class="mb-8 color-secondary">
1202-
{{ $t('views.document.form.source_url.label') }}: {{
1203-
data.input_params.source_url
1204-
}}
1206+
{{ $t('views.document.form.source_url.label') }}:
1207+
{{ data.input_params.source_url }}
12051208
</p>
12061209
</div>
12071210
</div>
@@ -1218,7 +1221,7 @@
12181221
:key="index"
12191222
class="mb-8"
12201223
>
1221-
<h4>{{file_content.name}}</h4>
1224+
<h4>{{ file_content.name }}</h4>
12221225
<MdPreview
12231226
v-if="file_content"
12241227
ref="editorRef"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export default {
2626
fileLimitCountTip1: 'Maximum upload per time',
2727
fileLimitCountTip2: 'files',
2828
fileLimitSizeTip1: 'each file must not exceed',
29+
toImportDocConfirm:
30+
'The workflow of the current knowledge base is not published, and documents cannot be imported. Please publish the workflow first.',
2931
},
3032
upload: {
3133
selectFile: 'Select File',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
fileLimitCountTip1: '每次最多上传',
2727
fileLimitCountTip2: '个文件',
2828
fileLimitSizeTip1: '每个文件不超过',
29+
toImportDocConfirm: '当前知识库的工作流未发布,无法导入文档,请先发布工作流。',
2930
},
3031
upload: {
3132
selectFile: '选择文件',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default {
2525
fileLimitCountTip1: '每次最多上傳',
2626
fileLimitCountTip2: '個文件',
2727
fileLimitSizeTip1: '每個文件不超過',
28+
toImportDocConfirm: '當前知識庫的工作流未發布,無法導入文檔,請先發布工作流。',
2829
},
2930
upload: {
3031
selectFile: '選擇文件',

ui/src/views/document/index.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,9 @@
3939
>{{ $t('views.document.importDocument') }}
4040
</el-button>
4141
<el-button
42-
v-if="knowledgeDetail?.type === 4 && permissionPrecise.doc_create(id)&&knowledgeDetail.is_publish"
42+
v-if="knowledgeDetail?.type === 4 && permissionPrecise.doc_create(id)"
4343
type="primary"
44-
@click="
45-
router.push({
46-
path: `/knowledge/import/workflow/${folderId}`,
47-
query: {
48-
id: id,
49-
},
50-
})
51-
"
44+
@click="toImportWorkflow"
5245
>{{ $t('views.document.importDocument') }}
5346
</el-button>
5447
<el-button
@@ -860,6 +853,25 @@ const title = ref('')
860853
861854
const selectKnowledgeDialogRef = ref()
862855
856+
const toImportWorkflow = () => {
857+
if (knowledgeDetail.value.is_publish) {
858+
router.push({
859+
path: `/knowledge/import/workflow/${folderId}`,
860+
query: {
861+
id: id,
862+
},
863+
})
864+
} else {
865+
MsgConfirm(t('common.tip'), t('views.document.tip.toImportDocConfirm'), {
866+
cancelButtonText: t('common.close'),
867+
showConfirmButton: false,
868+
type: 'warning',
869+
})
870+
.then(() => {})
871+
.catch(() => {})
872+
}
873+
}
874+
863875
const exportDocument = (document: any) => {
864876
loadSharedApi({ type: 'document', systemType: apiType.value })
865877
.exportDocument(document.name, document.knowledge_id, document.id, loading)

ui/src/views/knowledge-workflow/index.vue

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,24 @@ const get_route = () => {
554554
}
555555
556556
const toImportDoc = () => {
557-
const newUrl = router.resolve({
558-
path: `/knowledge/import/workflow/${folderId}`,
559-
query: {
560-
id: id,
561-
},
562-
}).href
563-
564-
window.open(newUrl)
557+
if (detail.value.is_publish) {
558+
const newUrl = router.resolve({
559+
path: `/knowledge/import/workflow/${folderId}`,
560+
query: {
561+
id: id,
562+
},
563+
}).href
564+
565+
window.open(newUrl)
566+
} else {
567+
MsgConfirm(t('common.tip'), t('views.document.tip.toImportDocConfirm'), {
568+
cancelButtonText: t('common.close'),
569+
showConfirmButton: false,
570+
type: 'warning',
571+
})
572+
.then(() => {})
573+
.catch(() => {})
574+
}
565575
}
566576
567577
/**

ui/src/views/paragraph/component/ProblemComponent.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
:label="item.content"
3535
:value="item.id"
3636
>
37-
{{ item.content }}
37+
<span class="ellipsis" :title="item.content" style="max-width: 255px" >
38+
{{ item.content }}
39+
</span>
3840
</el-option>
3941
</el-select>
4042
<template v-for="(item, index) in problemList" :key="index">

0 commit comments

Comments
 (0)