fix: Document page turn record cache and adjust the execution details to display the text

This commit is contained in:
wangdan-fit2cloud 2025-12-16 15:51:44 +08:00 committed by shaohuzhang1
parent dba257049e
commit ce0e845e6e
8 changed files with 118 additions and 57 deletions

View File

@ -71,7 +71,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import ExecutionDetailCard from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue' import ExecutionDetailCard from '@/components/execution-detail-card/index.vue'
import { arraySort } from '@/utils/array' import { arraySort } from '@/utils/array'
import { isWorkFlow } from '@/utils/application' import { isWorkFlow } from '@/utils/application'

View File

@ -186,10 +186,72 @@
</div> </div>
</div> </div>
</template> </template>
<!-- AI 对话 / 问题优化 / 意图识别--> <!-- AI 对话 -->
<template v-if="data.type == WorkflowType.AiChat">
<div class="card-never border-r-6">
<h5 class="p-8-12">
{{ $t('views.application.form.roleSettings.label') }}
</h5>
<div class="p-8-12 border-t-dashed lighter">
{{ data.system || '-' }}
</div>
</div>
<div class="card-never border-r-6 mt-8" v-if="!isKnowLedge">
<h5 class="p-8-12">{{ $t('chat.history') }}</h5>
<div class="p-8-12 border-t-dashed lighter">
<template v-if="data.history_message?.length > 0">
<p
class="mt-4 mb-4"
v-for="(history, historyIndex) in data.history_message"
:key="historyIndex"
>
<span class="color-secondary mr-4">{{ history.role }}:</span
><span>{{ history.content }}</span>
</p>
</template>
<template v-else> -</template>
</div>
</div>
<div class="card-never border-r-6 mt-8">
<h5 class="p-8-12">
{{
isKnowLedge
? $t('views.application.form.prompt.label')
: $t('chat.executionDetails.currentChat')
}}
</h5>
<div class="p-8-12 border-t-dashed lighter pre-wrap">
{{ data.question || '-' }}
</div>
</div>
<div class="card-never border-r-6 mt-8">
<h5 class="p-8-12">
{{ $t('workflow.nodes.aiChatNode.think') }}
</h5>
<div class="p-8-12 border-t-dashed lighter pre-wrap">
{{ data.reasoning_content || '-' }}
</div>
</div>
<div class="card-never border-r-6 mt-8">
<h5 class="p-8-12">
{{ $t('chat.executionDetails.answer') }}
</h5>
<div class="p-8-12 border-t-dashed lighter">
<MdPreview
v-if="data.answer"
ref="editorRef"
editorId="preview-only"
:modelValue="data.answer"
style="background: none"
noImgZoomIn
/>
<template v-else> -</template>
</div>
</div>
</template>
<!-- 问题优化 / 意图识别-->
<template <template
v-if=" v-if="
data.type == WorkflowType.AiChat ||
data.type == WorkflowType.Question || data.type == WorkflowType.Question ||
data.type == WorkflowType.Application || data.type == WorkflowType.Application ||
data.type == WorkflowType.IntentNode data.type == WorkflowType.IntentNode
@ -227,14 +289,6 @@
{{ data.question || '-' }} {{ data.question || '-' }}
</div> </div>
</div> </div>
<div class="card-never border-r-6 mt-8" v-if="data.type == WorkflowType.AiChat">
<h5 class="p-8-12">
{{ $t('workflow.nodes.aiChatNode.think') }}
</h5>
<div class="p-8-12 border-t-dashed lighter pre-wrap">
{{ data.reasoning_content || '-' }}
</div>
</div>
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ {{
@ -492,7 +546,7 @@
</template> </template>
<!-- 图片理解 --> <!-- 图片理解 -->
<template v-if="data.type == WorkflowType.ImageUnderstandNode"> <template v-if="data.type == WorkflowType.ImageUnderstandNode">
<div class="card-never border-r-6" v-if="data.type !== WorkflowType.Application"> <div class="card-never border-r-6">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ $t('views.application.form.roleSettings.label') }} {{ $t('views.application.form.roleSettings.label') }}
</h5> </h5>
@ -500,7 +554,7 @@
{{ data.system || '-' }} {{ data.system || '-' }}
</div> </div>
</div> </div>
<div class="card-never border-r-6 mt-8" v-if="data.type !== WorkflowType.Application"> <div class="card-never border-r-6 mt-8" v-if="!isKnowLedge">
<h5 class="p-8-12">{{ $t('chat.history') }}</h5> <h5 class="p-8-12">{{ $t('chat.history') }}</h5>
<div class="p-8-12 border-t-dashed lighter"> <div class="p-8-12 border-t-dashed lighter">
<template v-if="data.history_message?.length > 0"> <template v-if="data.history_message?.length > 0">
@ -534,7 +588,11 @@
</div> </div>
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ $t('chat.executionDetails.currentChat') }} {{
isKnowLedge
? $t('views.application.form.prompt.label')
: $t('chat.executionDetails.currentChat')
}}
</h5> </h5>
<div class="p-8-12 border-t-dashed lighter pre-wrap"> <div class="p-8-12 border-t-dashed lighter pre-wrap">
<div v-if="data.image_list?.length > 0"> <div v-if="data.image_list?.length > 0">
@ -557,11 +615,7 @@
</div> </div>
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ {{ $t('chat.executionDetails.answer') }}
data.type == WorkflowType.Application
? $t('common.param.outputParam')
: $t('chat.executionDetails.answer')
}}
</h5> </h5>
<div class="p-8-12 border-t-dashed lighter"> <div class="p-8-12 border-t-dashed lighter">
<MdPreview <MdPreview
@ -578,7 +632,7 @@
</template> </template>
<!-- 视频理解 --> <!-- 视频理解 -->
<template v-if="data.type == WorkflowType.VideoUnderstandNode"> <template v-if="data.type == WorkflowType.VideoUnderstandNode">
<div class="card-never border-r-6" v-if="data.type !== WorkflowType.Application"> <div class="card-never border-r-6">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ $t('views.application.form.roleSettings.label') }} {{ $t('views.application.form.roleSettings.label') }}
</h5> </h5>
@ -586,7 +640,7 @@
{{ data.system || '-' }} {{ data.system || '-' }}
</div> </div>
</div> </div>
<div class="card-never border-r-6 mt-8" v-if="data.type !== WorkflowType.Application"> <div class="card-never border-r-6 mt-8" v-if="!isKnowLedge">
<h5 class="p-8-12">{{ $t('chat.history') }}</h5> <h5 class="p-8-12">{{ $t('chat.history') }}</h5>
<div class="p-8-12 border-t-dashed lighter"> <div class="p-8-12 border-t-dashed lighter">
<template v-if="data.history_message?.length > 0"> <template v-if="data.history_message?.length > 0">
@ -618,7 +672,11 @@
</div> </div>
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ $t('chat.executionDetails.currentChat') }} {{
isKnowLedge
? $t('views.application.form.prompt.label')
: $t('chat.executionDetails.currentChat')
}}
</h5> </h5>
<div class="p-8-12 border-t-dashed lighter pre-wrap"> <div class="p-8-12 border-t-dashed lighter pre-wrap">
<div v-if="data.video_list?.length > 0"> <div v-if="data.video_list?.length > 0">
@ -641,11 +699,7 @@
</div> </div>
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ {{ $t('chat.executionDetails.answer') }}
data.type == WorkflowType.Application
? $t('common.param.outputParam')
: $t('chat.executionDetails.answer')
}}
</h5> </h5>
<div class="p-8-12 border-t-dashed lighter"> <div class="p-8-12 border-t-dashed lighter">
<MdPreview <MdPreview
@ -680,11 +734,7 @@
</div> </div>
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ {{ $t('chat.executionDetails.answer') }}
data.type == WorkflowType.Application
? $t('common.param.outputParam')
: $t('chat.executionDetails.answer')
}}
</h5> </h5>
<div class="p-8-12 border-t-dashed lighter"> <div class="p-8-12 border-t-dashed lighter">
<MdPreview <MdPreview
@ -718,11 +768,7 @@
</div> </div>
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ {{ $t('chat.executionDetails.answer') }}
data.type == WorkflowType.Application
? $t('common.param.outputParam')
: $t('chat.executionDetails.answer')
}}
</h5> </h5>
<div class="p-8-12 border-t-dashed lighter"> <div class="p-8-12 border-t-dashed lighter">
<MdPreview <MdPreview
@ -817,11 +863,7 @@
<div class="card-never border-r-6 mt-8"> <div class="card-never border-r-6 mt-8">
<h5 class="p-8-12"> <h5 class="p-8-12">
{{ {{ $t('chat.executionDetails.answer') }}
data.type == WorkflowType.Application
? $t('common.param.outputParam')
: $t('chat.executionDetails.answer')
}}
</h5> </h5>
<div class="p-8-12 border-t-dashed lighter"> <div class="p-8-12 border-t-dashed lighter">
<MdPreview <MdPreview
@ -1249,7 +1291,7 @@
</el-card> </el-card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue' import { ref, computed, type PropType } from 'vue'
import ParagraphCard from '@/components/ai-chat/component/knowledge-source-component/ParagraphCard.vue' import ParagraphCard from '@/components/ai-chat/component/knowledge-source-component/ParagraphCard.vue'
import DynamicsForm from '@/components/dynamics-form/index.vue' import DynamicsForm from '@/components/dynamics-form/index.vue'
import { iconComponent } from '@/workflow/icons/utils' import { iconComponent } from '@/workflow/icons/utils'
@ -1259,9 +1301,17 @@ import { arraySort } from '@/utils/array'
import { t } from '@/locales' import { t } from '@/locales'
const props = defineProps<{ const props = defineProps({
data: any data: {
}>() type: Object as PropType<any>,
default: null,
},
type: {
type: String as PropType<'application' | 'knowledge'>,
default: 'application',
},
})
const isKnowLedge = computed(() => props.type === 'knowledge')
const currentLoopNode = ref(0) const currentLoopNode = ref(0)
const currentParagraph = ref(0) const currentParagraph = ref(0)
const currentWriteContent = ref(0) const currentWriteContent = ref(0)

View File

@ -55,7 +55,7 @@
class="flex align-center w-full custom-tree-node" class="flex align-center w-full custom-tree-node"
> >
<AppIcon iconName="app-folder" style="font-size: 20px"></AppIcon> <AppIcon iconName="app-folder" style="font-size: 20px"></AppIcon>
<span class="tree-label ml-8" :title="node.label">{{ i18n_name(node.label) }}</span> <span class="tree-label ml-8 " :title="node.label">{{ i18n_name(node.label) }}</span>
<div <div
v-if="canOperation && MoreFilledPermission(node, data)" v-if="canOperation && MoreFilledPermission(node, data)"

View File

@ -761,12 +761,13 @@ onBeforeRouteUpdate(() => {
common.saveCondition(storeKey, null) common.saveCondition(storeKey, null)
}) })
onBeforeRouteLeave((to: any) => { onBeforeRouteLeave((to: any) => {
if (to.name !== 'Paragraph') { if (to.name !== 'ParagraphIndex') {
common.savePage(storeKey, null) common.savePage(storeKey, null)
common.saveCondition(storeKey, null) common.saveCondition(storeKey, null)
} else { } else {
common.saveCondition(storeKey, { common.saveCondition(storeKey, {
filterText: filterText.value, search_type: search_type.value,
search_form: search_form.value,
filterMethod: filterMethod.value, filterMethod: filterMethod.value,
}) })
} }
@ -840,7 +841,7 @@ const embeddingContentDialogRef = ref<InstanceType<typeof EmbeddingContentDialog
const ListActionRef = ref<InstanceType<typeof ExecutionRecord>>() const ListActionRef = ref<InstanceType<typeof ExecutionRecord>>()
const loading = ref(false) const loading = ref(false)
let interval: any let interval: any
const filterText = ref('')
const filterMethod = ref<any>({}) const filterMethod = ref<any>({})
const orderBy = ref<string>('') const orderBy = ref<string>('')
const documentData = ref<any[]>([]) const documentData = ref<any[]>([])
@ -1349,8 +1350,9 @@ onMounted(() => {
paginationConfig.value = beforePagination.value paginationConfig.value = beforePagination.value
} }
if (beforeSearch.value) { if (beforeSearch.value) {
filterText.value = beforeSearch.value['filterText']
filterMethod.value = beforeSearch.value['filterMethod'] filterMethod.value = beforeSearch.value['filterMethod']
search_type.value = beforeSearch.value['search_type']
search_form.value = beforeSearch.value['search_form']
} }
getList() getList()
// //

View File

@ -20,13 +20,16 @@
:closable="false" :closable="false"
/> />
</div> </div>
<ExecutionDetailContent :detail="detail" app-type="WORK_FLOW"></ExecutionDetailContent> <!-- <ExecutionDetailContent :detail="detail" app-type="WORK_FLOW"></ExecutionDetailContent> -->
<template v-for="(item, index) in arraySort(detail ?? [], 'index')" :key="index">
<ExecutionDetailCard :data="item" type="knowledge"> </ExecutionDetailCard>
</template>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onUnmounted, ref, computed, watch } from 'vue' import { onUnmounted, ref, computed, watch } from 'vue'
import { arraySort } from '@/utils/array'
import ExecutionDetailContent from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue' import ExecutionDetailCard from '@/components/execution-detail-card/index.vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts' import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts'
const route = useRoute() const route = useRoute()

View File

@ -117,7 +117,9 @@
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`" :placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('views.application.form.historyRecord.label')"> <el-form-item
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
>
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<div>{{ $t('views.application.form.historyRecord.label') }}</div> <div>{{ $t('views.application.form.historyRecord.label') }}</div>

View File

@ -114,7 +114,9 @@
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`" :placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
>
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<div>{{ $t('views.application.form.historyRecord.label') }}</div> <div>{{ $t('views.application.form.historyRecord.label') }}</div>

View File

@ -114,7 +114,9 @@
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`" :placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
>
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<div>{{ $t('views.application.form.historyRecord.label') }}</div> <div>{{ $t('views.application.form.historyRecord.label') }}</div>