mirror of
https://gitee.com/fit2cloud-feizhiyun/MaxKB.git
synced 2025-12-06 19:42:41 +08:00
Merge remote-tracking branch 'origin/v2' into v2
This commit is contained in:
@@ -1196,10 +1196,10 @@
|
||||
</h5>
|
||||
<div class="p-8-12 border-t-dashed lighter">
|
||||
<p class="mb-8 color-secondary">
|
||||
{{ $t('views.document.form.selector.label') }}:{{ data.input_params.selector }}
|
||||
{{ $t('views.document.form.selector.label') }}: {{ data.input_params.selector }}
|
||||
</p>
|
||||
<p class="mb-8 color-secondary">
|
||||
{{ $t('views.document.form.source_url.label') }}:{{
|
||||
{{ $t('views.document.form.source_url.label') }}: {{
|
||||
data.input_params.source_url
|
||||
}}
|
||||
</p>
|
||||
@@ -1218,11 +1218,12 @@
|
||||
:key="index"
|
||||
class="mb-8"
|
||||
>
|
||||
<h4>{{file_content.name}}</h4>
|
||||
<MdPreview
|
||||
v-if="file_content"
|
||||
ref="editorRef"
|
||||
editorId="preview-only"
|
||||
:modelValue="file_content"
|
||||
:modelValue="file_content.content"
|
||||
style="background: none"
|
||||
noImgZoomIn
|
||||
/>
|
||||
|
||||
@@ -97,7 +97,7 @@ import applicationApi from '@/api/application/application'
|
||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { baseNodes } from '@/workflow/common/data'
|
||||
import { applicationTemplate } from '@/views/application/template'
|
||||
import { applicationTemplate } from '@/workflow/common/template'
|
||||
import { t } from '@/locales'
|
||||
import useStore from '@/stores'
|
||||
const { user } = useStore()
|
||||
|
||||
@@ -1,465 +0,0 @@
|
||||
import { baseNodes } from '@/workflow/common/data'
|
||||
export const applicationTemplate: any = {
|
||||
blank: {
|
||||
edges: [],
|
||||
nodes: baseNodes,
|
||||
},
|
||||
assistant: {
|
||||
nodes: [
|
||||
{
|
||||
id: 'base-node',
|
||||
type: 'base-node',
|
||||
x: 120,
|
||||
y: 260.30849999999987,
|
||||
properties: {
|
||||
config: {},
|
||||
height: 734.766,
|
||||
showNode: true,
|
||||
stepName: '基本信息',
|
||||
node_data: {
|
||||
desc: '模板',
|
||||
name: '知识库问答助手',
|
||||
prologue:
|
||||
'您好,我是 XXX 小助手,您可以向我提出 XXX 使用问题。\n- XXX 主要功能有什么?\n- XXX 如何收费?\n- 需要转人工服务',
|
||||
tts_type: 'BROWSER',
|
||||
},
|
||||
input_field_list: [],
|
||||
user_input_config: {
|
||||
title: '用户输入',
|
||||
},
|
||||
api_input_field_list: [],
|
||||
user_input_field_list: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'start-node',
|
||||
type: 'start-node',
|
||||
x: 120,
|
||||
y: 929.6914999999999,
|
||||
properties: {
|
||||
config: {
|
||||
fields: [
|
||||
{
|
||||
label: '用户问题',
|
||||
value: 'question',
|
||||
},
|
||||
],
|
||||
globalFields: [
|
||||
{
|
||||
label: '当前时间',
|
||||
value: 'time',
|
||||
},
|
||||
{
|
||||
label: '历史聊天记录',
|
||||
value: 'history_context',
|
||||
},
|
||||
{
|
||||
label: '对话 ID',
|
||||
value: 'chat_id',
|
||||
},
|
||||
],
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
label: '用户问题',
|
||||
value: 'question',
|
||||
},
|
||||
],
|
||||
height: 364,
|
||||
showNode: true,
|
||||
stepName: '开始',
|
||||
globalFields: [
|
||||
{
|
||||
label: '当前时间',
|
||||
value: 'time',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'fd0324fc-f5e4-4fa6-a2d9-cb251b467605',
|
||||
type: 'search-knowledge-node',
|
||||
x: 710,
|
||||
y: 929.6914999999999,
|
||||
properties: {
|
||||
config: {
|
||||
fields: [
|
||||
{
|
||||
label: '检索结果的分段列表',
|
||||
value: 'paragraph_list',
|
||||
},
|
||||
{
|
||||
label: '满足直接回答的分段列表',
|
||||
value: 'is_hit_handling_method_list',
|
||||
},
|
||||
{
|
||||
label: '检索结果',
|
||||
value: 'data',
|
||||
},
|
||||
{
|
||||
label: '满足直接回答的分段内容',
|
||||
value: 'directly_return',
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 794,
|
||||
showNode: true,
|
||||
stepName: '知识库检索',
|
||||
condition: 'AND',
|
||||
node_data: {
|
||||
knowledge_id_list: [],
|
||||
knowledge_setting: {
|
||||
top_n: 3,
|
||||
similarity: 0.6,
|
||||
search_mode: 'embedding',
|
||||
max_paragraph_char_number: 5000,
|
||||
},
|
||||
question_reference_address: ['start-node', 'question'],
|
||||
all_knowledge_id_list: [],
|
||||
knowledge_list: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '420a6e4f-44ff-4847-bb81-0923630846b5',
|
||||
type: 'condition-node',
|
||||
x: 1300,
|
||||
y: 929.6914999999999,
|
||||
properties: {
|
||||
width: 600,
|
||||
config: {
|
||||
fields: [
|
||||
{
|
||||
label: '分支名称',
|
||||
value: 'branch_name',
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 544.148,
|
||||
showNode: true,
|
||||
stepName: '判断器',
|
||||
condition: 'AND',
|
||||
node_data: {
|
||||
branch: [
|
||||
{
|
||||
id: '7887',
|
||||
type: 'IF',
|
||||
condition: 'and',
|
||||
conditions: [
|
||||
{
|
||||
field: ['fd0324fc-f5e4-4fa6-a2d9-cb251b467605', 'is_hit_handling_method_list'],
|
||||
value: 1,
|
||||
compare: 'is_not_null',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '6847',
|
||||
type: 'ELSE IF 1',
|
||||
condition: 'and',
|
||||
conditions: [
|
||||
{
|
||||
field: ['fd0324fc-f5e4-4fa6-a2d9-cb251b467605', 'paragraph_list'],
|
||||
value: 1,
|
||||
compare: 'is_not_null',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '2794',
|
||||
type: 'ELSE',
|
||||
condition: 'and',
|
||||
conditions: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
branch_condition_list: [
|
||||
{
|
||||
index: 0,
|
||||
height: 121.383,
|
||||
id: '7887',
|
||||
},
|
||||
{
|
||||
index: 1,
|
||||
height: 121.383,
|
||||
id: '6847',
|
||||
},
|
||||
{
|
||||
index: 2,
|
||||
height: 44,
|
||||
id: '2794',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '36a440a9-5b00-4d82-b13a-8e7819112918',
|
||||
type: 'reply-node',
|
||||
x: 1890,
|
||||
y: 120,
|
||||
properties: {
|
||||
config: {
|
||||
fields: [
|
||||
{
|
||||
label: '内容',
|
||||
value: 'answer',
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 386,
|
||||
showNode: true,
|
||||
stepName: '指定回复',
|
||||
condition: 'AND',
|
||||
node_data: {
|
||||
fields: ['fd0324fc-f5e4-4fa6-a2d9-cb251b467605', 'directly_return'],
|
||||
content: '',
|
||||
is_result: true,
|
||||
reply_type: 'referencing',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'f7c3b4a2-cb80-4e47-b050-7fef0315daaf',
|
||||
type: 'ai-chat-node',
|
||||
x: 1890,
|
||||
y: 929.6914999999999,
|
||||
properties: {
|
||||
config: {
|
||||
fields: [
|
||||
{
|
||||
label: 'AI 回答内容',
|
||||
value: 'answer',
|
||||
},
|
||||
{
|
||||
label: '思考过程',
|
||||
value: 'reasoning_content',
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 993.383,
|
||||
showNode: true,
|
||||
stepName: 'AI 对话',
|
||||
condition: 'AND',
|
||||
node_data: {
|
||||
prompt: '已知信息:\n{{知识库检索.data}}\n问题:\n{{开始.question}}',
|
||||
system: '',
|
||||
model_id: '',
|
||||
is_result: true,
|
||||
max_tokens: null,
|
||||
temperature: null,
|
||||
dialogue_type: 'WORKFLOW',
|
||||
model_setting: {
|
||||
reasoning_content_end: '</think>',
|
||||
reasoning_content_start: '<think>',
|
||||
reasoning_content_enable: false,
|
||||
},
|
||||
dialogue_number: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '04dd6c1e-95f9-4757-bb3e-134d503fce54',
|
||||
type: 'reply-node',
|
||||
x: 1890,
|
||||
y: 1798.383,
|
||||
properties: {
|
||||
config: {
|
||||
fields: [
|
||||
{
|
||||
label: '内容',
|
||||
value: 'answer',
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 504,
|
||||
showNode: true,
|
||||
stepName: '指定回复1',
|
||||
condition: 'AND',
|
||||
node_data: {
|
||||
fields: [],
|
||||
content: '抱歉,没有在知识库查询到相关内容,请提供更详细的信息。',
|
||||
is_result: true,
|
||||
reply_type: 'content',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
id: '73f8992c-65ef-409a-a151-378d0927f2aa',
|
||||
type: 'app-edge',
|
||||
sourceNodeId: 'start-node',
|
||||
targetNodeId: 'fd0324fc-f5e4-4fa6-a2d9-cb251b467605',
|
||||
startPoint: {
|
||||
x: 280,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
endPoint: {
|
||||
x: 550,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
properties: {},
|
||||
pointsList: [
|
||||
{
|
||||
x: 280,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
{
|
||||
x: 390,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
{
|
||||
x: 440,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
{
|
||||
x: 550,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
],
|
||||
sourceAnchorId: 'start-node_right',
|
||||
targetAnchorId: 'fd0324fc-f5e4-4fa6-a2d9-cb251b467605_left',
|
||||
},
|
||||
{
|
||||
id: '6a8d23d9-5179-424e-80c2-f08d37cdb8d4',
|
||||
type: 'app-edge',
|
||||
sourceNodeId: 'fd0324fc-f5e4-4fa6-a2d9-cb251b467605',
|
||||
targetNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5',
|
||||
startPoint: {
|
||||
x: 870,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
endPoint: {
|
||||
x: 1010,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
properties: {},
|
||||
pointsList: [
|
||||
{
|
||||
x: 870,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
{
|
||||
x: 980,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
{
|
||||
x: 900,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
{
|
||||
x: 1010,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
],
|
||||
sourceAnchorId: 'fd0324fc-f5e4-4fa6-a2d9-cb251b467605_right',
|
||||
targetAnchorId: '420a6e4f-44ff-4847-bb81-0923630846b5_left',
|
||||
},
|
||||
{
|
||||
id: '56006748-d9fe-491b-a14b-04fd568cac08',
|
||||
type: 'app-edge',
|
||||
sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5',
|
||||
targetNodeId: '36a440a9-5b00-4d82-b13a-8e7819112918',
|
||||
startPoint: {
|
||||
x: 1590,
|
||||
y: 793.3089999999999,
|
||||
},
|
||||
endPoint: {
|
||||
x: 1730,
|
||||
y: 120,
|
||||
},
|
||||
properties: {},
|
||||
pointsList: [
|
||||
{
|
||||
x: 1590,
|
||||
y: 793.3089999999999,
|
||||
},
|
||||
{
|
||||
x: 1700,
|
||||
y: 793.3089999999999,
|
||||
},
|
||||
{
|
||||
x: 1620,
|
||||
y: 120,
|
||||
},
|
||||
{
|
||||
x: 1730,
|
||||
y: 120,
|
||||
},
|
||||
],
|
||||
sourceAnchorId: '420a6e4f-44ff-4847-bb81-0923630846b5_7887_right',
|
||||
targetAnchorId: '36a440a9-5b00-4d82-b13a-8e7819112918_left',
|
||||
},
|
||||
{
|
||||
id: '9bc8721b-07aa-4730-9347-910ed64e26b9',
|
||||
type: 'app-edge',
|
||||
sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5',
|
||||
targetNodeId: 'f7c3b4a2-cb80-4e47-b050-7fef0315daaf',
|
||||
startPoint: {
|
||||
x: 1590,
|
||||
y: 922.6919999999999,
|
||||
},
|
||||
endPoint: {
|
||||
x: 1730,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
properties: {},
|
||||
pointsList: [
|
||||
{
|
||||
x: 1590,
|
||||
y: 922.6919999999999,
|
||||
},
|
||||
{
|
||||
x: 1700,
|
||||
y: 922.6919999999999,
|
||||
},
|
||||
{
|
||||
x: 1620,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
{
|
||||
x: 1730,
|
||||
y: 929.6914999999999,
|
||||
},
|
||||
],
|
||||
sourceAnchorId: '420a6e4f-44ff-4847-bb81-0923630846b5_6847_right',
|
||||
targetAnchorId: 'f7c3b4a2-cb80-4e47-b050-7fef0315daaf_left',
|
||||
},
|
||||
{
|
||||
id: 'c276a5b6-ec29-4ab9-b911-a0a929ff193f',
|
||||
type: 'app-edge',
|
||||
sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5',
|
||||
targetNodeId: '04dd6c1e-95f9-4757-bb3e-134d503fce54',
|
||||
startPoint: {
|
||||
x: 1590,
|
||||
y: 1013.3834999999998,
|
||||
},
|
||||
endPoint: {
|
||||
x: 1730,
|
||||
y: 1798.383,
|
||||
},
|
||||
properties: {},
|
||||
pointsList: [
|
||||
{
|
||||
x: 1590,
|
||||
y: 1013.3834999999998,
|
||||
},
|
||||
{
|
||||
x: 1700,
|
||||
y: 1013.3834999999998,
|
||||
},
|
||||
{
|
||||
x: 1620,
|
||||
y: 1798.383,
|
||||
},
|
||||
{
|
||||
x: 1730,
|
||||
y: 1798.383,
|
||||
},
|
||||
],
|
||||
sourceAnchorId: '420a6e4f-44ff-4847-bb81-0923630846b5_2794_right',
|
||||
targetAnchorId: '04dd6c1e-95f9-4757-bb3e-134d503fce54_left',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -7,14 +7,14 @@
|
||||
<!-- 执行结果 -->
|
||||
<el-alert
|
||||
v-if="state == 'SUCCESS'"
|
||||
:title="$t('common.success')"
|
||||
:title="$t('common.status.success')"
|
||||
type="success"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert
|
||||
v-if="state == 'FAILURE'"
|
||||
:title="$t('common.fail')"
|
||||
:title="$t('common.status.fail')"
|
||||
type="error"
|
||||
show-icon
|
||||
:closable="false"
|
||||
|
||||
@@ -554,12 +554,14 @@ const get_route = () => {
|
||||
}
|
||||
|
||||
const toImportDoc = () => {
|
||||
router.push({
|
||||
const newUrl = router.resolve({
|
||||
path: `/knowledge/import/workflow/${folderId}`,
|
||||
query: {
|
||||
id: id,
|
||||
},
|
||||
})
|
||||
}).href
|
||||
|
||||
window.open(newUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<h4 class="title-decoration-1 mb-16">
|
||||
{{ $t('common.info') }}
|
||||
</h4>
|
||||
<BaseForm ref="BaseFormRef" :data="detail" :apiType="apiType"/>
|
||||
<BaseForm ref="BaseFormRef" :data="detail" :apiType="apiType" />
|
||||
|
||||
<el-form
|
||||
ref="webFormRef"
|
||||
@@ -26,12 +26,12 @@
|
||||
>
|
||||
<div class="flex align-center">
|
||||
<el-avatar class="mr-8 avatar-blue" shape="square" :size="32">
|
||||
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt=""/>
|
||||
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<div>{{ $t('views.knowledge.knowledgeType.generalKnowledge') }}</div>
|
||||
<el-text type="info"
|
||||
>{{ $t('views.knowledge.knowledgeType.generalInfo') }}
|
||||
>{{ $t('views.knowledge.knowledgeType.generalInfo') }}
|
||||
</el-text>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,7 +44,7 @@
|
||||
>
|
||||
<div class="flex align-center">
|
||||
<el-avatar class="mr-8 avatar-purple" shape="square" :size="32">
|
||||
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt=""/>
|
||||
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<div>{{ $t('views.knowledge.knowledgeType.webKnowledge') }}</div>
|
||||
@@ -61,15 +61,20 @@
|
||||
v-if="detail?.type === 2"
|
||||
>
|
||||
<div class="flex align-center">
|
||||
<el-avatar shape="square" :size="32" style="background: none">
|
||||
<img src="@/assets/knowledge/logo_lark.svg" style="width: 100%" alt=""/>
|
||||
<el-avatar
|
||||
class="mr-8"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img src="@/assets/knowledge/logo_lark.svg" style="width: 100%" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<p>
|
||||
<el-text>{{ $t('views.knowledge.knowledgeType.larkKnowledge') }}</el-text>
|
||||
</p>
|
||||
<el-text type="info"
|
||||
>{{ $t('views.knowledge.knowledgeType.larkInfo') }}
|
||||
>{{ $t('views.knowledge.knowledgeType.larkInfo') }}
|
||||
</el-text>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,12 +86,14 @@
|
||||
v-if="detail?.type === 4"
|
||||
>
|
||||
<div class="flex align-center">
|
||||
<el-avatar class="avatar-purple mt-4" shape="square" :size="32">
|
||||
<el-avatar class="mr-8 avatar-purple" shape="square" :size="32">
|
||||
<img src="@/assets/knowledge/logo_workflow.svg" style="width: 60%" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<p>
|
||||
<el-text>{{ $t('views.knowledge.knowledgeType.workflowKnowledge') }}</el-text>
|
||||
<el-text>{{
|
||||
$t('views.knowledge.knowledgeType.workflowKnowledge')
|
||||
}}</el-text>
|
||||
</p>
|
||||
<el-text type="info">
|
||||
{{ $t('views.knowledge.knowledgeType.workflowInfo') }}
|
||||
@@ -161,7 +168,7 @@
|
||||
<template #label>
|
||||
<div class="flex align-center">
|
||||
<span class="mr-4"
|
||||
>{{ $t('views.knowledge.form.file_size_limit.label') }}
|
||||
>{{ $t('views.knowledge.form.file_size_limit.label') }}
|
||||
</span>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
@@ -190,8 +197,7 @@
|
||||
v-if="!route.path.includes('share/') && permissionPrecise.edit(id)"
|
||||
>
|
||||
{{ $t('common.save') }}
|
||||
</el-button
|
||||
>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
@@ -200,18 +206,18 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {ref, onMounted, reactive, computed} from 'vue'
|
||||
import {useRoute} from 'vue-router'
|
||||
import { ref, onMounted, reactive, computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import BaseForm from '@/views/knowledge/component/BaseForm.vue'
|
||||
import {MsgSuccess, MsgConfirm} from '@/utils/message'
|
||||
import {t} from '@/locales'
|
||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||
import { t } from '@/locales'
|
||||
import permissionMap from '@/permission'
|
||||
|
||||
import {loadSharedApi} from '@/utils/dynamics-api/shared-api'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||
|
||||
const route = useRoute()
|
||||
const {
|
||||
params: {id, folderId},
|
||||
params: { id, folderId },
|
||||
} = route as any
|
||||
|
||||
const apiType = computed(() => {
|
||||
@@ -286,16 +292,16 @@ async function submit() {
|
||||
const obj =
|
||||
detail.value.type === 1 || detail.value.type === 2
|
||||
? {
|
||||
meta: form.value,
|
||||
file_count_limit: form.value.file_count_limit,
|
||||
file_size_limit: form.value.file_size_limit,
|
||||
...BaseFormRef.value.form,
|
||||
}
|
||||
meta: form.value,
|
||||
file_count_limit: form.value.file_count_limit,
|
||||
file_size_limit: form.value.file_size_limit,
|
||||
...BaseFormRef.value.form,
|
||||
}
|
||||
: {
|
||||
file_count_limit: form.value.file_count_limit,
|
||||
file_size_limit: form.value.file_size_limit,
|
||||
...BaseFormRef.value.form,
|
||||
}
|
||||
file_count_limit: form.value.file_count_limit,
|
||||
file_size_limit: form.value.file_size_limit,
|
||||
...BaseFormRef.value.form,
|
||||
}
|
||||
|
||||
if (cloneModelId.value !== BaseFormRef.value.form.embedding_model_id) {
|
||||
MsgConfirm(t('common.tip'), t('views.knowledge.tip.updateModeMessage'), {
|
||||
@@ -303,20 +309,20 @@ async function submit() {
|
||||
})
|
||||
.then(() => {
|
||||
if (detail.value.type === 2) {
|
||||
loadSharedApi({type: 'knowledge', systemType: apiType.value})
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
.putLarkKnowledge(id, obj, loading)
|
||||
.then(() => {
|
||||
loadSharedApi({type: 'knowledge', systemType: apiType.value})
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
.putReEmbeddingKnowledge(id)
|
||||
.then(() => {
|
||||
MsgSuccess(t('common.saveSuccess'))
|
||||
})
|
||||
})
|
||||
} else {
|
||||
loadSharedApi({type: 'knowledge', systemType: apiType.value})
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
.putKnowledge(id, obj, loading)
|
||||
.then(() => {
|
||||
loadSharedApi({type: 'knowledge', systemType: apiType.value})
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
.putReEmbeddingKnowledge(id)
|
||||
.then(() => {
|
||||
MsgSuccess(t('common.saveSuccess'))
|
||||
@@ -324,17 +330,16 @@ async function submit() {
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
if (detail.value.type === 2) {
|
||||
loadSharedApi({type: 'knowledge', systemType: apiType.value})
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
.putLarkKnowledge(id, obj, loading)
|
||||
.then(() => {
|
||||
MsgSuccess(t('common.saveSuccess'))
|
||||
})
|
||||
} else {
|
||||
loadSharedApi({type: 'knowledge', systemType: apiType.value})
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
.putKnowledge(id, obj, loading)
|
||||
.then(() => {
|
||||
MsgSuccess(t('common.saveSuccess'))
|
||||
@@ -347,7 +352,7 @@ async function submit() {
|
||||
}
|
||||
|
||||
function getDetail() {
|
||||
loadSharedApi({type: 'knowledge', isShared: isShared.value, systemType: apiType.value})
|
||||
loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value })
|
||||
.getKnowledgeDetail(id, loading)
|
||||
.then((res: any) => {
|
||||
detail.value = res.data
|
||||
|
||||
@@ -28,6 +28,7 @@ import { useRouter, useRoute } from 'vue-router'
|
||||
import BaseForm from '@/views/knowledge/component/BaseForm.vue'
|
||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||
import { knowledgeTemplate } from '@/workflow/common/template'
|
||||
import { t } from '@/locales'
|
||||
import useStore from '@/stores'
|
||||
const emit = defineEmits(['refresh'])
|
||||
@@ -50,6 +51,8 @@ const loading = ref(false)
|
||||
const dialogVisible = ref<boolean>(false)
|
||||
const currentFolder = ref<any>(null)
|
||||
|
||||
const workflowDefault = ref(knowledgeTemplate.default)
|
||||
|
||||
watch(dialogVisible, (bool) => {
|
||||
if (!bool) {
|
||||
currentFolder.value = null
|
||||
@@ -65,6 +68,7 @@ const submitHandle = async () => {
|
||||
if (await BaseFormRef.value?.validate()) {
|
||||
const obj = {
|
||||
folder_id: currentFolder.value?.id,
|
||||
work_flow: workflowDefault.value,
|
||||
...BaseFormRef.value.form,
|
||||
}
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
|
||||
1167
ui/src/workflow/common/template.ts
Normal file
1167
ui/src/workflow/common/template.ts
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user