mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-25 17:22:55 +00:00
fix: Document page turn record cache and adjust the execution details to display the text
This commit is contained in:
parent
dba257049e
commit
ce0e845e6e
|
|
@ -71,7 +71,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
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 { isWorkFlow } from '@/utils/application'
|
||||
|
||||
|
|
|
|||
|
|
@ -186,10 +186,72 @@
|
|||
</div>
|
||||
</div>
|
||||
</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
|
||||
v-if="
|
||||
data.type == WorkflowType.AiChat ||
|
||||
data.type == WorkflowType.Question ||
|
||||
data.type == WorkflowType.Application ||
|
||||
data.type == WorkflowType.IntentNode
|
||||
|
|
@ -227,14 +289,6 @@
|
|||
{{ data.question || '-' }}
|
||||
</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">
|
||||
<h5 class="p-8-12">
|
||||
{{
|
||||
|
|
@ -492,7 +546,7 @@
|
|||
</template>
|
||||
<!-- 图片理解 -->
|
||||
<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">
|
||||
{{ $t('views.application.form.roleSettings.label') }}
|
||||
</h5>
|
||||
|
|
@ -500,7 +554,7 @@
|
|||
{{ data.system || '-' }}
|
||||
</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>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<template v-if="data.history_message?.length > 0">
|
||||
|
|
@ -534,7 +588,11 @@
|
|||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
{{ $t('chat.executionDetails.currentChat') }}
|
||||
{{
|
||||
isKnowLedge
|
||||
? $t('views.application.form.prompt.label')
|
||||
: $t('chat.executionDetails.currentChat')
|
||||
}}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter pre-wrap">
|
||||
<div v-if="data.image_list?.length > 0">
|
||||
|
|
@ -557,11 +615,7 @@
|
|||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
{{
|
||||
data.type == WorkflowType.Application
|
||||
? $t('common.param.outputParam')
|
||||
: $t('chat.executionDetails.answer')
|
||||
}}
|
||||
{{ $t('chat.executionDetails.answer') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<MdPreview
|
||||
|
|
@ -578,7 +632,7 @@
|
|||
</template>
|
||||
<!-- 视频理解 -->
|
||||
<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">
|
||||
{{ $t('views.application.form.roleSettings.label') }}
|
||||
</h5>
|
||||
|
|
@ -586,7 +640,7 @@
|
|||
{{ data.system || '-' }}
|
||||
</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>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<template v-if="data.history_message?.length > 0">
|
||||
|
|
@ -618,7 +672,11 @@
|
|||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
{{ $t('chat.executionDetails.currentChat') }}
|
||||
{{
|
||||
isKnowLedge
|
||||
? $t('views.application.form.prompt.label')
|
||||
: $t('chat.executionDetails.currentChat')
|
||||
}}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter pre-wrap">
|
||||
<div v-if="data.video_list?.length > 0">
|
||||
|
|
@ -641,11 +699,7 @@
|
|||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
{{
|
||||
data.type == WorkflowType.Application
|
||||
? $t('common.param.outputParam')
|
||||
: $t('chat.executionDetails.answer')
|
||||
}}
|
||||
{{ $t('chat.executionDetails.answer') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<MdPreview
|
||||
|
|
@ -680,11 +734,7 @@
|
|||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
{{
|
||||
data.type == WorkflowType.Application
|
||||
? $t('common.param.outputParam')
|
||||
: $t('chat.executionDetails.answer')
|
||||
}}
|
||||
{{ $t('chat.executionDetails.answer') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<MdPreview
|
||||
|
|
@ -718,11 +768,7 @@
|
|||
</div>
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
{{
|
||||
data.type == WorkflowType.Application
|
||||
? $t('common.param.outputParam')
|
||||
: $t('chat.executionDetails.answer')
|
||||
}}
|
||||
{{ $t('chat.executionDetails.answer') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<MdPreview
|
||||
|
|
@ -817,11 +863,7 @@
|
|||
|
||||
<div class="card-never border-r-6 mt-8">
|
||||
<h5 class="p-8-12">
|
||||
{{
|
||||
data.type == WorkflowType.Application
|
||||
? $t('common.param.outputParam')
|
||||
: $t('chat.executionDetails.answer')
|
||||
}}
|
||||
{{ $t('chat.executionDetails.answer') }}
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<MdPreview
|
||||
|
|
@ -1249,7 +1291,7 @@
|
|||
</el-card>
|
||||
</template>
|
||||
<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 DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||
import { iconComponent } from '@/workflow/icons/utils'
|
||||
|
|
@ -1259,9 +1301,17 @@ import { arraySort } from '@/utils/array'
|
|||
|
||||
import { t } from '@/locales'
|
||||
|
||||
const props = defineProps<{
|
||||
data: any
|
||||
}>()
|
||||
const props = defineProps({
|
||||
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 currentParagraph = ref(0)
|
||||
const currentWriteContent = ref(0)
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
class="flex align-center w-full custom-tree-node"
|
||||
>
|
||||
<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
|
||||
v-if="canOperation && MoreFilledPermission(node, data)"
|
||||
|
|
|
|||
|
|
@ -761,12 +761,13 @@ onBeforeRouteUpdate(() => {
|
|||
common.saveCondition(storeKey, null)
|
||||
})
|
||||
onBeforeRouteLeave((to: any) => {
|
||||
if (to.name !== 'Paragraph') {
|
||||
if (to.name !== 'ParagraphIndex') {
|
||||
common.savePage(storeKey, null)
|
||||
common.saveCondition(storeKey, null)
|
||||
} else {
|
||||
common.saveCondition(storeKey, {
|
||||
filterText: filterText.value,
|
||||
search_type: search_type.value,
|
||||
search_form: search_form.value,
|
||||
filterMethod: filterMethod.value,
|
||||
})
|
||||
}
|
||||
|
|
@ -840,7 +841,7 @@ const embeddingContentDialogRef = ref<InstanceType<typeof EmbeddingContentDialog
|
|||
const ListActionRef = ref<InstanceType<typeof ExecutionRecord>>()
|
||||
const loading = ref(false)
|
||||
let interval: any
|
||||
const filterText = ref('')
|
||||
|
||||
const filterMethod = ref<any>({})
|
||||
const orderBy = ref<string>('')
|
||||
const documentData = ref<any[]>([])
|
||||
|
|
@ -1349,8 +1350,9 @@ onMounted(() => {
|
|||
paginationConfig.value = beforePagination.value
|
||||
}
|
||||
if (beforeSearch.value) {
|
||||
filterText.value = beforeSearch.value['filterText']
|
||||
filterMethod.value = beforeSearch.value['filterMethod']
|
||||
search_type.value = beforeSearch.value['search_type']
|
||||
search_form.value = beforeSearch.value['search_form']
|
||||
}
|
||||
getList()
|
||||
// 初始化定时任务
|
||||
|
|
|
|||
|
|
@ -20,13 +20,16 @@
|
|||
:closable="false"
|
||||
/>
|
||||
</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>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onUnmounted, ref, computed, watch } from 'vue'
|
||||
|
||||
import ExecutionDetailContent from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue'
|
||||
import { arraySort } from '@/utils/array'
|
||||
import ExecutionDetailCard from '@/components/execution-detail-card/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts'
|
||||
const route = useRoute()
|
||||
|
|
|
|||
|
|
@ -117,7 +117,9 @@
|
|||
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
|
||||
/>
|
||||
</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>
|
||||
<div class="flex-between">
|
||||
<div>{{ $t('views.application.form.historyRecord.label') }}</div>
|
||||
|
|
|
|||
|
|
@ -114,7 +114,9 @@
|
|||
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-form-item
|
||||
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<div>{{ $t('views.application.form.historyRecord.label') }}</div>
|
||||
|
|
|
|||
|
|
@ -114,7 +114,9 @@
|
|||
:placeholder="`${t('workflow.UserPromptPlaceholder')}{{${t('workflow.nodes.startNode.label')}.question}}`"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-form-item
|
||||
v-if="[WorkflowMode.Application, WorkflowMode.ApplicationLoop].includes(workflowMode)"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<div>{{ $t('views.application.form.historyRecord.label') }}</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue