Skip to content

Commit db06441

Browse files
fix: Document page turn record cache and adjust the execution details to display the text
1 parent fd7c13b commit db06441

File tree

8 files changed

+118
-57
lines changed

8 files changed

+118
-57
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</template>
7272
<script setup lang="ts">
7373
import { ref, computed } from 'vue'
74-
import ExecutionDetailCard from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue'
74+
import ExecutionDetailCard from '@/components/execution-detail-card/index.vue'
7575
import { arraySort } from '@/utils/array'
7676
import { isWorkFlow } from '@/utils/application'
7777

ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue renamed to ui/src/components/execution-detail-card/index.vue

Lines changed: 95 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,72 @@
186186
</div>
187187
</div>
188188
</template>
189-
<!-- AI 对话 / 问题优化 / 意图识别-->
189+
<!-- AI 对话 -->
190+
<template v-if="data.type == WorkflowType.AiChat">
191+
<div class="card-never border-r-6">
192+
<h5 class="p-8-12">
193+
{{ $t('views.application.form.roleSettings.label') }}
194+
</h5>
195+
<div class="p-8-12 border-t-dashed lighter">
196+
{{ data.system || '-' }}
197+
</div>
198+
</div>
199+
<div class="card-never border-r-6 mt-8" v-if="!isKnowLedge">
200+
<h5 class="p-8-12">{{ $t('chat.history') }}</h5>
201+
<div class="p-8-12 border-t-dashed lighter">
202+
<template v-if="data.history_message?.length > 0">
203+
<p
204+
class="mt-4 mb-4"
205+
v-for="(history, historyIndex) in data.history_message"
206+
:key="historyIndex"
207+
>
208+
<span class="color-secondary mr-4">{{ history.role }}:</span
209+
><span>{{ history.content }}</span>
210+
</p>
211+
</template>
212+
<template v-else> -</template>
213+
</div>
214+
</div>
215+
<div class="card-never border-r-6 mt-8">
216+
<h5 class="p-8-12">
217+
{{
218+
isKnowLedge
219+
? $t('views.application.form.prompt.label')
220+
: $t('chat.executionDetails.currentChat')
221+
}}
222+
</h5>
223+
<div class="p-8-12 border-t-dashed lighter pre-wrap">
224+
{{ data.question || '-' }}
225+
</div>
226+
</div>
227+
<div class="card-never border-r-6 mt-8">
228+
<h5 class="p-8-12">
229+
{{ $t('workflow.nodes.aiChatNode.think') }}
230+
</h5>
231+
<div class="p-8-12 border-t-dashed lighter pre-wrap">
232+
{{ data.reasoning_content || '-' }}
233+
</div>
234+
</div>
235+
<div class="card-never border-r-6 mt-8">
236+
<h5 class="p-8-12">
237+
{{ $t('chat.executionDetails.answer') }}
238+
</h5>
239+
<div class="p-8-12 border-t-dashed lighter">
240+
<MdPreview
241+
v-if="data.answer"
242+
ref="editorRef"
243+
editorId="preview-only"
244+
:modelValue="data.answer"
245+
style="background: none"
246+
noImgZoomIn
247+
/>
248+
<template v-else> -</template>
249+
</div>
250+
</div>
251+
</template>
252+
<!-- 问题优化 / 意图识别-->
190253
<template
191254
v-if="
192-
data.type == WorkflowType.AiChat ||
193255
data.type == WorkflowType.Question ||
194256
data.type == WorkflowType.Application ||
195257
data.type == WorkflowType.IntentNode
@@ -227,14 +289,6 @@
227289
{{ data.question || '-' }}
228290
</div>
229291
</div>
230-
<div class="card-never border-r-6 mt-8" v-if="data.type == WorkflowType.AiChat">
231-
<h5 class="p-8-12">
232-
{{ $t('workflow.nodes.aiChatNode.think') }}
233-
</h5>
234-
<div class="p-8-12 border-t-dashed lighter pre-wrap">
235-
{{ data.reasoning_content || '-' }}
236-
</div>
237-
</div>
238292
<div class="card-never border-r-6 mt-8">
239293
<h5 class="p-8-12">
240294
{{
@@ -492,15 +546,15 @@
492546
</template>
493547
<!-- 图片理解 -->
494548
<template v-if="data.type == WorkflowType.ImageUnderstandNode">
495-
<div class="card-never border-r-6" v-if="data.type !== WorkflowType.Application">
549+
<div class="card-never border-r-6">
496550
<h5 class="p-8-12">
497551
{{ $t('views.application.form.roleSettings.label') }}
498552
</h5>
499553
<div class="p-8-12 border-t-dashed lighter">
500554
{{ data.system || '-' }}
501555
</div>
502556
</div>
503-
<div class="card-never border-r-6 mt-8" v-if="data.type !== WorkflowType.Application">
557+
<div class="card-never border-r-6 mt-8" v-if="!isKnowLedge">
504558
<h5 class="p-8-12">{{ $t('chat.history') }}</h5>
505559
<div class="p-8-12 border-t-dashed lighter">
506560
<template v-if="data.history_message?.length > 0">
@@ -534,7 +588,11 @@
534588
</div>
535589
<div class="card-never border-r-6 mt-8">
536590
<h5 class="p-8-12">
537-
{{ $t('chat.executionDetails.currentChat') }}
591+
{{
592+
isKnowLedge
593+
? $t('views.application.form.prompt.label')
594+
: $t('chat.executionDetails.currentChat')
595+
}}
538596
</h5>
539597
<div class="p-8-12 border-t-dashed lighter pre-wrap">
540598
<div v-if="data.image_list?.length > 0">
@@ -557,11 +615,7 @@
557615
</div>
558616
<div class="card-never border-r-6 mt-8">
559617
<h5 class="p-8-12">
560-
{{
561-
data.type == WorkflowType.Application
562-
? $t('common.param.outputParam')
563-
: $t('chat.executionDetails.answer')
564-
}}
618+
{{ $t('chat.executionDetails.answer') }}
565619
</h5>
566620
<div class="p-8-12 border-t-dashed lighter">
567621
<MdPreview
@@ -578,15 +632,15 @@
578632
</template>
579633
<!-- 视频理解 -->
580634
<template v-if="data.type == WorkflowType.VideoUnderstandNode">
581-
<div class="card-never border-r-6" v-if="data.type !== WorkflowType.Application">
635+
<div class="card-never border-r-6">
582636
<h5 class="p-8-12">
583637
{{ $t('views.application.form.roleSettings.label') }}
584638
</h5>
585639
<div class="p-8-12 border-t-dashed lighter">
586640
{{ data.system || '-' }}
587641
</div>
588642
</div>
589-
<div class="card-never border-r-6 mt-8" v-if="data.type !== WorkflowType.Application">
643+
<div class="card-never border-r-6 mt-8" v-if="!isKnowLedge">
590644
<h5 class="p-8-12">{{ $t('chat.history') }}</h5>
591645
<div class="p-8-12 border-t-dashed lighter">
592646
<template v-if="data.history_message?.length > 0">
@@ -618,7 +672,11 @@
618672
</div>
619673
<div class="card-never border-r-6 mt-8">
620674
<h5 class="p-8-12">
621-
{{ $t('chat.executionDetails.currentChat') }}
675+
{{
676+
isKnowLedge
677+
? $t('views.application.form.prompt.label')
678+
: $t('chat.executionDetails.currentChat')
679+
}}
622680
</h5>
623681
<div class="p-8-12 border-t-dashed lighter pre-wrap">
624682
<div v-if="data.video_list?.length > 0">
@@ -641,11 +699,7 @@
641699
</div>
642700
<div class="card-never border-r-6 mt-8">
643701
<h5 class="p-8-12">
644-
{{
645-
data.type == WorkflowType.Application
646-
? $t('common.param.outputParam')
647-
: $t('chat.executionDetails.answer')
648-
}}
702+
{{ $t('chat.executionDetails.answer') }}
649703
</h5>
650704
<div class="p-8-12 border-t-dashed lighter">
651705
<MdPreview
@@ -680,11 +734,7 @@
680734
</div>
681735
<div class="card-never border-r-6 mt-8">
682736
<h5 class="p-8-12">
683-
{{
684-
data.type == WorkflowType.Application
685-
? $t('common.param.outputParam')
686-
: $t('chat.executionDetails.answer')
687-
}}
737+
{{ $t('chat.executionDetails.answer') }}
688738
</h5>
689739
<div class="p-8-12 border-t-dashed lighter">
690740
<MdPreview
@@ -718,11 +768,7 @@
718768
</div>
719769
<div class="card-never border-r-6 mt-8">
720770
<h5 class="p-8-12">
721-
{{
722-
data.type == WorkflowType.Application
723-
? $t('common.param.outputParam')
724-
: $t('chat.executionDetails.answer')
725-
}}
771+
{{ $t('chat.executionDetails.answer') }}
726772
</h5>
727773
<div class="p-8-12 border-t-dashed lighter">
728774
<MdPreview
@@ -817,11 +863,7 @@
817863

818864
<div class="card-never border-r-6 mt-8">
819865
<h5 class="p-8-12">
820-
{{
821-
data.type == WorkflowType.Application
822-
? $t('common.param.outputParam')
823-
: $t('chat.executionDetails.answer')
824-
}}
866+
{{ $t('chat.executionDetails.answer') }}
825867
</h5>
826868
<div class="p-8-12 border-t-dashed lighter">
827869
<MdPreview
@@ -1249,7 +1291,7 @@
12491291
</el-card>
12501292
</template>
12511293
<script setup lang="ts">
1252-
import { ref, computed } from 'vue'
1294+
import { ref, computed, type PropType } from 'vue'
12531295
import ParagraphCard from '@/components/ai-chat/component/knowledge-source-component/ParagraphCard.vue'
12541296
import DynamicsForm from '@/components/dynamics-form/index.vue'
12551297
import { iconComponent } from '@/workflow/icons/utils'
@@ -1259,9 +1301,17 @@ import { arraySort } from '@/utils/array'
12591301
12601302
import { t } from '@/locales'
12611303
1262-
const props = defineProps<{
1263-
data: any
1264-
}>()
1304+
const props = defineProps({
1305+
data: {
1306+
type: Object as PropType<any>,
1307+
default: null,
1308+
},
1309+
type: {
1310+
type: String as PropType<'application' | 'knowledge'>,
1311+
default: 'application',
1312+
},
1313+
})
1314+
const isKnowLedge = computed(() => props.type === 'knowledge')
12651315
const currentLoopNode = ref(0)
12661316
const currentParagraph = ref(0)
12671317
const currentWriteContent = ref(0)

ui/src/components/folder-tree/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
class="flex align-center w-full custom-tree-node"
5656
>
5757
<AppIcon iconName="app-folder" style="font-size: 20px"></AppIcon>
58-
<span class="tree-label ml-8" :title="node.label">{{ i18n_name(node.label) }}</span>
58+
<span class="tree-label ml-8 " :title="node.label">{{ i18n_name(node.label) }}</span>
5959

6060
<div
6161
v-if="canOperation && MoreFilledPermission(node, data)"

ui/src/views/document/index.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,12 +761,13 @@ onBeforeRouteUpdate(() => {
761761
common.saveCondition(storeKey, null)
762762
})
763763
onBeforeRouteLeave((to: any) => {
764-
if (to.name !== 'Paragraph') {
764+
if (to.name !== 'ParagraphIndex') {
765765
common.savePage(storeKey, null)
766766
common.saveCondition(storeKey, null)
767767
} else {
768768
common.saveCondition(storeKey, {
769-
filterText: filterText.value,
769+
search_type: search_type.value,
770+
search_form: search_form.value,
770771
filterMethod: filterMethod.value,
771772
})
772773
}
@@ -840,7 +841,7 @@ const embeddingContentDialogRef = ref<InstanceType<typeof EmbeddingContentDialog
840841
const ListActionRef = ref<InstanceType<typeof ExecutionRecord>>()
841842
const loading = ref(false)
842843
let interval: any
843-
const filterText = ref('')
844+
844845
const filterMethod = ref<any>({})
845846
const orderBy = ref<string>('')
846847
const documentData = ref<any[]>([])
@@ -1349,8 +1350,9 @@ onMounted(() => {
13491350
paginationConfig.value = beforePagination.value
13501351
}
13511352
if (beforeSearch.value) {
1352-
filterText.value = beforeSearch.value['filterText']
13531353
filterMethod.value = beforeSearch.value['filterMethod']
1354+
search_type.value = beforeSearch.value['search_type']
1355+
search_form.value = beforeSearch.value['search_form']
13541356
}
13551357
getList()
13561358
// 初始化定时任务

ui/src/views/knowledge-workflow/component/action/Result.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
:closable="false"
2121
/>
2222
</div>
23-
<ExecutionDetailContent :detail="detail" app-type="WORK_FLOW"></ExecutionDetailContent>
23+
<!-- <ExecutionDetailContent :detail="detail" app-type="WORK_FLOW"></ExecutionDetailContent> -->
24+
<template v-for="(item, index) in arraySort(detail ?? [], 'index')" :key="index">
25+
<ExecutionDetailCard :data="item" type="knowledge"> </ExecutionDetailCard>
26+
</template>
2427
</div>
2528
</template>
2629
<script setup lang="ts">
2730
import { onUnmounted, ref, computed, watch } from 'vue'
28-
29-
import ExecutionDetailContent from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue'
31+
import { arraySort } from '@/utils/array'
32+
import ExecutionDetailCard from '@/components/execution-detail-card/index.vue'
3033
import { useRoute } from 'vue-router'
3134
import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts'
3235
const route = useRoute()

ui/src/workflow/nodes/ai-chat-node/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@
117117
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
118118
/>
119119
</el-form-item>
120-
<el-form-item :label="$t('views.application.form.historyRecord.label')">
120+
<el-form-item
121+
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
122+
>
121123
<template #label>
122124
<div class="flex-between">
123125
<div>{{ $t('views.application.form.historyRecord.label') }}</div>

ui/src/workflow/nodes/image-understand/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@
114114
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
115115
/>
116116
</el-form-item>
117-
<el-form-item>
117+
<el-form-item
118+
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
119+
>
118120
<template #label>
119121
<div class="flex-between">
120122
<div>{{ $t('views.application.form.historyRecord.label') }}</div>

ui/src/workflow/nodes/video-understand/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@
114114
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
115115
/>
116116
</el-form-item>
117-
<el-form-item>
117+
<el-form-item
118+
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
119+
>
118120
<template #label>
119121
<div class="flex-between">
120122
<div>{{ $t('views.application.form.historyRecord.label') }}</div>

0 commit comments

Comments
 (0)