Skip to content

Commit a0103aa

Browse files
fix: Adjust execution details and fix some bugs.
1 parent c0f0eb4 commit a0103aa

File tree

13 files changed

+165
-100
lines changed

13 files changed

+165
-100
lines changed

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ const uploadFile = async (file: any, fileList: any) => {
568568
}
569569
filePromisionDict.value[file.uid] = false
570570
const inner = reactive(file)
571-
fileAllList.value.push(inner)
571+
// fileAllList.value.push(inner)
572572
if (!chatId_context.value) {
573573
chatId_context.value = await props.openChatId()
574574
}
@@ -1313,9 +1313,9 @@ async function saveUrl() {
13131313
// 并行处理所有 URL
13141314
await Promise.all(validUrls.map(url => processUrl(url)));
13151315
1316-
if (validFiles.length > 0) {
1317-
fileAllList.value.push(...validFiles);
1318-
}
1316+
// if (validFiles.length > 0) {
1317+
// fileAllList.value.push(...validFiles);
1318+
// }
13191319
13201320
showURLSetting.value = false;
13211321
urlForm.source_url = '';

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

Lines changed: 100 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
</el-tooltip>
295295
</h5>
296296
<div class="p-8-12 border-t-dashed lighter">
297-
<el-scrollbar height="150">
297+
<el-scrollbar height="200">
298298
<el-card
299299
shadow="never"
300300
style="--el-card-padding: 8px"
@@ -310,6 +310,7 @@
310310
style="background: none"
311311
noImgZoomIn
312312
/>
313+
313314
<template v-else> -</template>
314315
</el-card>
315316
</el-scrollbar>
@@ -892,7 +893,11 @@
892893
{{ $t('views.workflow.nodes.variableAggregationNode.Strategy') }}
893894
</h5>
894895
<div class="p-8-12 border-t-dashed lighter pre-wrap">
895-
{{ data.strategy }}
896+
{{
897+
data.strategy === 'variable_to_json'
898+
? t('views.workflow.nodes.variableAggregationNode.placeholder1')
899+
: t('views.workflow.nodes.variableAggregationNode.placeholder')
900+
}}
896901
</div>
897902
</div>
898903
<div
@@ -903,12 +908,14 @@
903908
<h5 class="p-8-12">
904909
{{ group.label + ' ' + $t('common.param.inputParam') }}
905910
</h5>
906-
<div class="p-8-12 border-t-dashed lighter">
907-
<div v-for="(f, i) in group.variable_list" :key="i" class="mb-8">
908-
<span class="color-secondary">{{ `${f.node_name}.${f.field}` }}:</span>
909-
{{ f.value }}
911+
<el-scrollbar height="200">
912+
<div class="p-8-12 border-t-dashed lighter">
913+
<div v-for="(f, i) in group.variable_list" :key="i" class="mb-8">
914+
<span class="color-secondary">{{ `${f.node_name}.${f.field}` }}:</span>
915+
{{ f.value }}
916+
</div>
910917
</div>
911-
</div>
918+
</el-scrollbar>
912919
</div>
913920
<div class="card-never border-r-6 mt-8">
914921
<h5 class="p-8-12">
@@ -1106,9 +1113,16 @@
11061113
>
11071114
{{ data.split_strategy }}
11081115
</div>
1116+
<div class="mb-8">
1117+
<span class="color-secondary"
1118+
>{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.label') }}:</span
1119+
>
1120+
{{ data.chunk_size }}
1121+
</div>
1122+
{{ data.size }}
11091123
<div class="mb-8">
11101124
<span class="color-secondary">{{ $t('common.inputContent') }}:</span>
1111-
{{ data.document_list }}
1125+
{{ data.document_list?.map((v: any) => v.name).join(',') }}
11121126
</div>
11131127
</div>
11141128
</div>
@@ -1119,72 +1133,100 @@
11191133
}})
11201134
</h5>
11211135
<div class="p-8-12 border-t-dashed lighter">
1122-
<el-radio-group v-model="currentParagraph" class="app-radio-button-group mb-8">
1123-
<template
1124-
v-for="(paragrapg, ParagraphIndex) in data.paragraph_list"
1125-
:key="ParagraphIndex"
1126-
>
1127-
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
1128-
</template>
1129-
</el-radio-group>
1130-
<template v-if="data.paragraph_list?.length > 0">
1131-
<template
1132-
v-for="(paragraph, pId) in data.paragraph_list?.[currentParagraph]?.paragraphs"
1133-
:key="pId"
1134-
>
1135-
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1136-
<template #footer>
1137-
<span class="color-secondary">
1138-
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1139-
>
1136+
<el-tabs v-model="currentParagraph" class="paragraph-tabs">
1137+
<template v-for="(item, index) in data.paragraph_list" :key="index">
1138+
<el-tab-pane :label="item.name" :name="index">
1139+
<template #label>
1140+
<div class="flex-center">
1141+
<span class="ml-4">{{ item?.name }}</span>
1142+
</div>
1143+
</template>
1144+
1145+
<template v-for="(paragraph, pId) in item?.paragraphs" :key="pId">
1146+
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1147+
<template #footer>
1148+
<span class="color-secondary">
1149+
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1150+
>
1151+
</template>
1152+
</ParagraphCard>
11401153
</template>
1141-
</ParagraphCard>
1154+
</el-tab-pane>
11421155
</template>
1143-
</template>
1144-
<template v-else> -</template>
1156+
</el-tabs>
11451157
</div>
11461158
</div>
11471159
</template>
11481160
<!-- 知识库写入 -->
11491161
<template v-if="data.type === WorkflowType.KnowledgeWriteNode">
1162+
<div class="card-never border-r-6 mt-8">
1163+
<h5 class="p-8-12">{{ $t('chat.executionDetails.writeContent') }}</h5>
1164+
<div class="p-8-12 border-t-dashed lighter">
1165+
<el-tabs v-model="currentWriteContent" class="paragraph-tabs">
1166+
<template v-for="(item, index) in data.write_content" :key="index">
1167+
<el-tab-pane :label="item.name" :name="index">
1168+
<template #label>
1169+
<div class="flex-center">
1170+
<span class="ml-4">{{ item?.name }}</span>
1171+
</div>
1172+
</template>
1173+
1174+
<template v-for="(paragraph, pId) in item?.paragraphs" :key="pId">
1175+
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1176+
<template #footer>
1177+
<span class="color-secondary">
1178+
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1179+
>
1180+
</template>
1181+
</ParagraphCard>
1182+
</template>
1183+
</el-tab-pane>
1184+
</template>
1185+
</el-tabs>
1186+
</div>
1187+
</div>
1188+
</template>
1189+
<!-- Web站点 -->
1190+
<template v-if="data.type === WorkflowType.DataSourceWebNode">
11501191
<div class="card-never border-r-6">
11511192
<h5 class="p-8-12">
11521193
{{ $t('common.param.inputParam') }}
11531194
</h5>
11541195
<div class="p-8-12 border-t-dashed lighter">
1155-
<span class="color-secondary"
1156-
>{{ $t('views.workflow.nodes.documentSplitNode.chunk_length.label') }}:</span
1157-
>
1158-
{{ data.size }}
1196+
<p class="mb-8 color-secondary">
1197+
{{ $t('views.document.form.selector.label') }}:{{ data.input_params.selector }}
1198+
</p>
1199+
<p class="mb-8 color-secondary">
1200+
{{ $t('views.document.form.source_url.label') }}:{{
1201+
data.input_params.source_url
1202+
}}
1203+
</p>
11591204
</div>
11601205
</div>
1161-
<div class="card-never border-r-6 mt-8">
1162-
<h5 class="p-8-12">{{ $t('chat.executionDetails.writeContent') }}</h5>
1206+
<div class="card-never border-r-6">
1207+
<h5 class="p-8-12">
1208+
{{ $t('common.param.outputParam') }}
1209+
</h5>
11631210
<div class="p-8-12 border-t-dashed lighter">
1164-
<el-radio-group v-model="currentWriteContent" class="app-radio-button-group mb-8">
1165-
<template
1166-
v-for="(paragrapg, ParagraphIndex) in data.write_content"
1167-
:key="ParagraphIndex"
1168-
>
1169-
<el-radio-button :label="paragrapg.name" :value="ParagraphIndex" />
1170-
</template>
1171-
</el-radio-group>
1172-
<template v-if="data.write_content?.length > 0">
1173-
<template
1174-
v-for="(paragraph, pId) in data.write_content?.[currentWriteContent]
1175-
?.paragraphs"
1176-
:key="pId"
1211+
<el-scrollbar height="200">
1212+
<el-card
1213+
shadow="never"
1214+
style="--el-card-padding: 8px"
1215+
v-for="(file_content, index) in data.output_params"
1216+
:key="index"
1217+
class="mb-8"
11771218
>
1178-
<ParagraphCard :data="paragraph" :content="paragraph.content" :index="pId">
1179-
<template #footer>
1180-
<span class="color-secondary">
1181-
{{ $t('common.character') }}:{{ paragraph.content.length }}</span
1182-
>
1183-
</template>
1184-
</ParagraphCard>
1185-
</template>
1186-
</template>
1187-
<template v-else> -</template>
1219+
<MdPreview
1220+
v-if="file_content"
1221+
ref="editorRef"
1222+
editorId="preview-only"
1223+
:modelValue="file_content"
1224+
style="background: none"
1225+
noImgZoomIn
1226+
/>
1227+
<template v-else> -</template>
1228+
</el-card>
1229+
</el-scrollbar>
11881230
</div>
11891231
</div>
11901232
</template>

ui/src/components/ai-chat/component/user-form/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</span>
1414
</div>
1515

16-
<el-scrollbar :max-height="first ? 0 : 450">
16+
<el-scrollbar :max-height="first ? '' : 450">
1717
<div class="mt-16" style="padding: 0 8px; height: calc(100% - 100px)">
1818
<DynamicsForm
1919
:key="dynamicsFormRefresh"

ui/src/stores/modules/application.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineStore } from 'pinia'
2-
import { type Ref } from 'vue'
32
const useApplicationStore = defineStore('application', {
43
state: () => ({
54
location: `${window.location.origin}${window.MaxKB.chatPrefix ? window.MaxKB.chatPrefix : window.MaxKB.prefix}/`,

ui/src/styles/component.scss

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@
180180
}
181181
}
182182

183-
184183
.import-button {
185184
.el-upload {
186185
display: block !important;
@@ -329,3 +328,31 @@
329328
border-color: var(--el-color-primary);
330329
}
331330
}
331+
332+
// 分段预览的tab样式
333+
.paragraph-tabs {
334+
.el-tabs__item {
335+
background: var(--app-text-color-light-1);
336+
margin: 4px;
337+
border-radius: 4px;
338+
padding: 5px 10px 5px 8px !important;
339+
height: auto;
340+
&:nth-child(2) {
341+
margin-left: 0;
342+
}
343+
&:last-child {
344+
margin-right: 0;
345+
}
346+
&.is-active {
347+
border: 1px solid var(--el-color-primary);
348+
background: var(--el-color-primary-light-9);
349+
color: var(--el-text-color-primary);
350+
}
351+
}
352+
.el-tabs__nav-wrap::after {
353+
display: none;
354+
}
355+
.el-tabs__active-bar {
356+
display: none;
357+
}
358+
}

ui/src/views/application/index.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,10 @@ function toChat(row: any) {
563563
aips = aips ? aips : []
564564
const apiParams = mapToUrlParams(aips) ? '?' + mapToUrlParams(aips) : ''
565565
ApplicationApi.getAccessToken(row.id, loading).then((res: any) => {
566-
window.open(application.location + res?.data?.access_token + apiParams)
566+
const newUrl = router.resolve({
567+
path: application.location + res?.data?.access_token + apiParams,
568+
}).href
569+
window.open(newUrl)
567570
})
568571
})
569572
}

ui/src/views/knowledge-workflow/component/DebugDrawer.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
direction="rtl"
77
destroy-on-close
88
:before-close="close"
9+
:close-on-click-modal="false"
10+
:close-on-press-escape="false"
911
>
1012
<div style="height: calc(100% - 57px)" v-loading="loading">
1113
<keep-alive :key="key" :include="['data_source', 'knowledge_base']">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ const publish = () => {
324324
)
325325
})
326326
.then((ok: any) => {
327-
MsgSuccess(t('views.knowledge.tip.publishSuccess'))
327+
MsgSuccess(t('views.application.tip.publishSuccess'))
328328
})
329329
.catch((res: any) => {
330330
const node = res.node

ui/src/views/knowledge/component/ParagraphPreview.vue

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,6 @@ defineProps({
4141
const activeName = ref(0)
4242
</script>
4343
<style scoped lang="scss">
44-
.paragraph-tabs {
45-
:deep(.el-tabs__item) {
46-
background: var(--app-text-color-light-1);
47-
margin: 4px;
48-
border-radius: 4px;
49-
padding: 5px 10px 5px 8px !important;
50-
height: auto;
51-
&:nth-child(2) {
52-
margin-left: 0;
53-
}
54-
&:last-child {
55-
margin-right: 0;
56-
}
57-
&.is-active {
58-
border: 1px solid var(--el-color-primary);
59-
background: var(--el-color-primary-light-9);
60-
color: var(--el-text-color-primary);
61-
}
62-
}
63-
:deep(.el-tabs__nav-wrap::after) {
64-
display: none;
65-
}
66-
:deep(.el-tabs__active-bar) {
67-
display: none;
68-
}
69-
}
7044
.paragraph-list {
7145
height: calc(100vh - 319px);
7246
}

ui/src/views/knowledge/create-component/CreateWorkflowKnowledgeDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const submitHandle = async () => {
7676
.then((res: any) => {
7777
MsgSuccess(t('common.createSuccess'))
7878
router.push({
79-
path: `/knowledge/${res.data.id}/${currentFolder.value.id || 'shared'}/4/document`,
79+
path: `/knowledge/${res.data.id}/${currentFolder.value.id || 'shared'}/workflow`,
8080
})
8181
emit('refresh')
8282
})

0 commit comments

Comments
 (0)