Skip to content

Commit 1715f9d

Browse files
wangdan-fit2cloudshaohuzhang1wangliang181230liuruibindependabot[bot]
authored
Virtualized tree@v2 (#5154)
* feat: Virtualized tree * feat: Drag and drop virtual tree * feat: Open the first level directory by default * feat: Change file name * perf: tree filter * fix: virtualized * fix: Fix the parsing error of `image_id` * fix: Fix null pointer exception (#5113) * feat: enhance request payload handling for AI messages with tool calls --bug=1068446@tapd-62980211 --user=刘瑞斌 【应用】AI对话开启思考过程并引用智能体作为技能,对话调用技能后,返回报错 https://www.tapd.cn/62980211/s/1902267 * fix: update position handling in drag-and-drop functionality * fix: update package versions for langchain-core, langchain-google-genai, langchain-aws, and pypdf * fix: update pypdf package version to 6.10.2 * fix: Fix the parameter issue of the `str.format(...)` method (#5119) * fix: Fix the parameter issue of the `str.format(...)` method * build(deps): bump langchain-openai in the pip group across 1 directory Bumps the pip group with 1 update in the / directory: [langchain-openai](https://github.com/langchain-ai/langchain). Updates `langchain-openai` from 1.1.13 to 1.1.14 - [Release notes](https://github.com/langchain-ai/langchain/releases) - [Commits](langchain-ai/langchain@langchain-openai==1.1.13...langchain-openai==1.1.14) --- updated-dependencies: - dependency-name: langchain-openai dependency-version: 1.1.14 dependency-type: direct:production dependency-group: pip ... Signed-off-by: dependabot[bot] <support@github.com> * fix: update langchain-openai package version to 1.1.14 * feat: Supports tree selector (#5122) * fix: PDF preview of XSS attack (#5123) * fix: PDF preview of XSS attack * fix: PDF preview of XSS attack * feat: Add style attribute to markdown rendering a tag (#5124) * feat: Copy and paste cross page canvas nodes (#5125) * fix: enhance image URL handling in response processing for multiple formats * fix: update default docker image tag to v2.9.0-dev * fix: Knowledge search node not real remove * fix: standardize formatting and improve error handling in model parameters validation * fix: add base_url parameter to various model classes and update initialization logic * feat: Resource dependency and resource dependent dialog view * feat: Support node disabling and enabling (#5135) * fix: enhance text_to_speech method to support additional models and handle audio data retrieval * feat: add MiniMax model provider with LLM and TTS support Add MiniMax as a new model provider supporting: - Chat LLM models: MiniMax-M2.5 and MiniMax-M2.5-highspeed (204K context) - TTS models: speech-2.8-hd and speech-2.8-turbo MiniMax LLM uses OpenAI-compatible API at api.minimax.io/v1. MiniMax TTS uses the native T2A v2 API with multiple voice options. * feat: upgrade MiniMax default model to M2.7 - Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list - Set MiniMax-M2.7 as default model - Keep all previous models as alternatives * fix: refactor voice selection and audio settings in TTS model parameters * fix: update default voice_id to Chinese (Mandarin)_Lyrical_Voice in tts.py * fix: Whether to call the model after deleting the default parameters of the model or use the old parameters (#5137) * build(deps): bump python-dotenv in the pip group across 1 directory Bumps the pip group with 1 update in the / directory: [python-dotenv](https://github.com/theskumar/python-dotenv). Updates `python-dotenv` from 1.1.1 to 1.2.2 - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](theskumar/python-dotenv@v1.1.1...v1.2.2) --- updated-dependencies: - dependency-name: python-dotenv dependency-version: 1.2.2 dependency-type: direct:production dependency-group: pip ... Signed-off-by: dependabot[bot] <support@github.com> * feat: add long term memory fields and settings to application model * fix: Fix the issues of `raise exception` (#5130) * fix: Fix the keyword for `raise exception` * 小调整 * 修正错误的缓存值。 * fix: Fix the issues for `raise exception` * 重命名变量 * 小调整。 * optimize style * fix * fix * revert * 小调整 * revert * feat: Mapping resource list * fix: Fix null pointer exception (#5136) * feat: Add regex to clean up content in long term memory extraction * fix: add copilot-instructions.md to .gitignore * perf: tree style * refactor: streamline long term memory extraction scheduling * fix: add api_base field to model credentials and update validation logic * perf: Model select item display * fix: update schedule_extract_long_term_memory function parameters * fix: clean up formatting and improve tooltip display in index.vue * perf: long-term memory translation * chore: update volcengine-python-sdk version to 5.0.24 in pyproject.toml * fix: remove popper-class from el-tooltip components in index.vue * fix: add popper-class to el-tooltip components for improved styling in index.vue * fix: update API base URL and ensure reasoning_split is set in extra_body * fix: adjust history chat record check to allow for more than one entry in _run_extract function Co-authored-by: Copilot <copilot@github.com> * fix: disable dropdown items for unpublished entries --bug=1068813@tapd-62980211 --user=刘瑞斌 【github#5146】未发布的智能体可以创建触发器,但即使智能体发布后触发器也无法触发 https://www.tapd.cn/62980211/s/1910656 * feat: Canvas pasting follows the mouse, fixing the problem of duplicate pasting of canvas pasting (#5151) * fix: virtualized tree * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: shaohuzhang1 <shaohu.zhang@fit2cloud.com> Co-authored-by: 王良 <841369634@qq.com> Co-authored-by: CaptainB <bin@fit2cloud.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Co-authored-by: wxg0103 <727495428@qq.com> Co-authored-by: zhangzhanwei <zhanwei.zhang@fit2cloud.com> Co-authored-by: octo-patch <octo-patch@users.noreply.github.com> Co-authored-by: PR Bot <pr-bot@minimaxi.com> Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 40b9c7d commit 1715f9d

15 files changed

Lines changed: 1346 additions & 11 deletions

File tree

apps/application/chat_pipeline/step/chat_step/impl/base_chat_step.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ def execute(self, message_list: List[BaseMessage],
185185
mcp_output_enable=True,
186186
**kwargs):
187187
chat_model = get_model_instance_by_model_workspace_id(model_id, workspace_id,
188-
**(model_params_setting or {})) if model_id is not None else None
188+
**(
189+
model_params_setting or {})) if model_id is not None else None
189190
if stream:
190191
return self.execute_stream(message_list, chat_id, problem_text, post_response_handler, chat_model,
191192
paragraph_list,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<svg t="1776929669814" class="icon" viewBox="0 0 1169 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4810" width="100%" height="100%"><path d="M474.173841 470.682521V847.403039c-25.441562 127.572805-194.68465 94.674371-195.416638 2.192962-0.802986-116.24 0-231.750012 0-347.113027V368.697276c0-16.740712-3.654937-29.973484-18.275685-40.428305-28.512509-21.346633-62.725921 3.728936-63.456908 34.507407-1.608972 41.305289-0.804986 81.733594-1.608973 122.453893 0 32.167446 0 63.384909 0.730988 95.478357C175.164986 722.025196 3.947932 698.5576 0 581.512614V483.5493c0-32.021449 62.725921-39.551319 59.655973 8.406855-2.046965 23.759591-0.731987 48.25117-1.535973 71.791765-0.729987 42.036277 63.530907 70.32879 78.663646 1.607972 0.730987-56.658025 0.730987-113.31605 0.730988-170.486067 0-71.644767 20.32365-129.984763 96.282343-135.39467 32.898434-2.92395 54.757058 10.819814 75.738697 34.579405 8.042862 8.407855 27.049535 35.092396 27.781522 64.115897 0 26.75754 0.729987 53.368082 0.729987 80.418616 0 53.367082-0.729987 107.028158-0.729987 160.39724 0 34.579405 0.729987 68.792816 0.729987 102.568235 0 42.841263 0 86.267516-0.729987 129.180778-0.730987 55.78104 67.111845 54.977054 78.005658-0.876985 0-65.796868 0.729987-130.78875 0.729987-196.585618 0-162.078211-0.729987-324.157422-0.729987-486.163634 0-16.814711-2.33996-63.456908 6.579886-80.417617C469.274925-48.744541 613.003452 1.625592 614.319429 97.176948c2.777952 195.781631 0 393.756225 0.730988 589.975848 0 68.062829-55.269049 53.44208-58.338996 26.830538 0-204.188487 0-409.180959 0.729987-613.07745-2.703953-51.175119-78.589648-44.229239-82.976572-7.529871-1.461975 42.109275-0.729987 84.950538-1.461975 126.987815v250.025698h0.730987l0.511992 0.292995z" fill="#D4367A" p-id="4811"></path><path d="M696.347018 467.684573v276.638239-652.848766c24.709575-128.44779 193.880664-95.038365 194.611651-2.484957 0.803986 115.437014 0 231.677014 0.803986 347.040028 0 44.303238 0 88.752473-0.730987 133.055711 0 17.545698 4.312926 29.900486 19.007673 41.159292 27.780522 20.835641 61.921935-3.654937 63.456908-34.945399 1.535974-40.501303 0.731987-81.002606 0.731987-122.527892v-94.893367c21.200635-141.315568 191.906698-117.847972 195.488637-0.803986V711.645375c0 32.166447-61.994933 39.769316-59.216981-8.334857 1.680971-24.490579 0-304.930753 0.876985-329.49433 1.461975-41.305289-63.602906-70.402789-78.663647-0.876985v169.609081c0 72.66875-20.396649 130.057762-97.013331 136.271656-72.228757 1.680971-101.253258-48.25117-103.593217-98.695302V237.250538c0-43.645249 0-86.266516 0.731987-129.107779 0.729987-55.78004-67.112845-55.78004-78.663646 0.804986v767.626792c0 16.667713 2.33996 63.383909-5.921898 80.417616-47.300186 115.363015-191.7607 64.918883-193.076678-30.559474v-90.871437c3.582938-61.190947 55.269049-46.643197 57.609009-20.762642V922.631744c2.777952 51.321117 78.663646 45.107224 82.245585 7.602869 1.534974-42.109275 1.534974-84.146552 1.534973-127.059813V467.757571h-0.219996v-0.072998z" fill="#ED6D48" p-id="4812"></path></svg>
1+
<svg t="1776929669814" class="icon" viewBox="0 0 1169 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4810" width="100%" height="100%"><path d="M474.173841 470.682521V847.403039c-25.441562 127.572805-194.68465 94.674371-195.416638 2.192962-0.802986-116.24 0-231.750012 0-347.113027V368.697276c0-16.740712-3.654937-29.973484-18.275685-40.428305-28.512509-21.346633-62.725921 3.728936-63.456908 34.507407-1.608972 41.305289-0.804986 81.733594-1.608973 122.453893 0 32.167446 0 63.384909 0.730988 95.478357C175.164986 722.025196 3.947932 698.5576 0 581.512614V483.5493c0-32.021449 62.725921-39.551319 59.655973 8.406855-2.046965 23.759591-0.731987 48.25117-1.535973 71.791765-0.729987 42.036277 63.530907 70.32879 78.663646 1.607972 0.730987-56.658025 0.730987-113.31605 0.730988-170.486067 0-71.644767 20.32365-129.984763 96.282343-135.39467 32.898434-2.92395 54.757058 10.819814 75.738697 34.579405 8.042862 8.407855 27.049535 35.092396 27.781522 64.115897 0 26.75754 0.729987 53.368082 0.729987 80.418616 0 53.367082-0.729987 107.028158-0.729987 160.39724 0 34.579405 0.729987 68.792816 0.729987 102.568235 0 42.841263 0 86.267516-0.729987 129.180778-0.730987 55.78104 67.111845 54.977054 78.005658-0.876985 0-65.796868 0.729987-130.78875 0.729987-196.585618 0-162.078211-0.729987-324.157422-0.729987-486.163634 0-16.814711-2.33996-63.456908 6.579886-80.417617C469.274925-48.744541 613.003452 1.625592 614.319429 97.176948c2.777952 195.781631 0 393.756225 0.730988 589.975848 0 68.062829-55.269049 53.44208-58.338996 26.830538 0-204.188487 0-409.180959 0.729987-613.07745-2.703953-51.175119-78.589648-44.229239-82.976572-7.529871-1.461975 42.109275-0.729987 84.950538-1.461975 126.987815v250.025698h0.730987l0.511992 0.292995z" fill="#D4367A" p-id="4811"></path><path d="M696.347018 467.684573v276.638239-652.848766c24.709575-128.44779 193.880664-95.038365 194.611651-2.484957 0.803986 115.437014 0 231.677014 0.803986 347.040028 0 44.303238 0 88.752473-0.730987 133.055711 0 17.545698 4.312926 29.900486 19.007673 41.159292 27.780522 20.835641 61.921935-3.654937 63.456908-34.945399 1.535974-40.501303 0.731987-81.002606 0.731987-122.527892v-94.893367c21.200635-141.315568 191.906698-117.847972 195.488637-0.803986V711.645375c0 32.166447-61.994933 39.769316-59.216981-8.334857 1.680971-24.490579 0-304.930753 0.876985-329.49433 1.461975-41.305289-63.602906-70.402789-78.663647-0.876985v169.609081c0 72.66875-20.396649 130.057762-97.013331 136.271656-72.228757 1.680971-101.253258-48.25117-103.593217-98.695302V237.250538c0-43.645249 0-86.266516 0.731987-129.107779 0.729987-55.78004-67.112845-55.78004-78.663646 0.804986v767.626792c0 16.667713 2.33996 63.383909-5.921898 80.417616-47.300186 115.363015-191.7607 64.918883-193.076678-30.559474v-90.871437c3.582938-61.190947 55.269049-46.643197 57.609009-20.762642V922.631744c2.777952 51.321117 78.663646 45.107224 82.245585 7.602869 1.534974-42.109275 1.534974-84.146552 1.534973-127.059813V467.757571h-0.219996v-0.072998z" fill="#ED6D48" p-id="4812"></path></svg>

ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@codemirror/lang-json": "^6.0.1",
2121
"@codemirror/lang-python": "^6.2.1",
2222
"@codemirror/theme-one-dark": "^6.1.2",
23+
"@he-tree/vue": "^2.10.5",
2324
"@logicflow/core": "^1.2.27",
2425
"@logicflow/extension": "^1.2.27",
2526
"@vavt/cm-extension": "^1.9.1",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
:class="
5858
showShared && hasPermission(EditionConst.IS_EE, 'OR')
5959
? 'tree-height-shared'
60-
: 'tree-height '
60+
: 'tree-height'
6161
"
6262
:style="treeStyle"
6363
ref="treeRef"
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<template>
2+
<el-dialog
3+
:title="title"
4+
v-model="dialogVisible"
5+
width="720"
6+
append-to-body
7+
:close-on-click-modal="false"
8+
:close-on-press-escape="false"
9+
>
10+
<el-form
11+
ref="FolderFormRef"
12+
:rules="rules"
13+
:model="folderForm"
14+
label-position="top"
15+
require-asterisk-position="right"
16+
@submit.prevent
17+
>
18+
<el-form-item :label="$t('common.name')" prop="name">
19+
<el-input
20+
v-model="folderForm.name"
21+
:placeholder="$t('components.folder.folderNamePlaceholder')"
22+
maxlength="64"
23+
show-word-limit
24+
@blur="folderForm.name = folderForm.name.trim()"
25+
/>
26+
</el-form-item>
27+
<el-form-item :label="$t('common.desc')" prop="desc">
28+
<el-input
29+
v-model="folderForm.desc"
30+
type="textarea"
31+
:placeholder="$t('common.descPlaceholder')"
32+
maxlength="128"
33+
show-word-limit
34+
:autosize="{ minRows: 3 }"
35+
@blur="folderForm.desc = folderForm.desc.trim()"
36+
/>
37+
</el-form-item>
38+
</el-form>
39+
<template #footer>
40+
<span class="dialog-footer">
41+
<el-button @click.prevent="dialogVisible = false" :loading="loading">
42+
{{ $t('common.cancel') }}
43+
</el-button>
44+
<el-button type="primary" @click="submitHandle" :disabled="loading" :loading="loading">
45+
{{ isEdit ? $t('common.confirm') : $t('common.add') }}
46+
</el-button>
47+
</span>
48+
</template>
49+
</el-dialog>
50+
</template>
51+
<script setup lang="ts">
52+
import { ref, watch, reactive } from 'vue'
53+
import folderApi from '@/api/workspace/folder'
54+
import { MsgSuccess, MsgAlert } from '@/utils/message'
55+
import { t } from '@/locales'
56+
import useStore from '@/stores'
57+
const { user, tool, knowledge, folder } = useStore()
58+
const emit = defineEmits(['refresh'])
59+
60+
const props = defineProps({
61+
title: {
62+
type: String,
63+
default: t('components.folder.addFolder'),
64+
},
65+
})
66+
67+
const FolderFormRef = ref()
68+
69+
const loading = ref(false)
70+
const dialogVisible = ref<boolean>(false)
71+
const sourceType = ref<any>('')
72+
const isEdit = ref<boolean>(false)
73+
const editId = ref<string>('')
74+
75+
const folderForm = ref<any>({
76+
name: '',
77+
desc: '',
78+
parent_id: '',
79+
})
80+
81+
const rules = reactive({
82+
name: [
83+
{
84+
required: true,
85+
message: t('components.folder.folderNamePlaceholder'),
86+
trigger: 'blur',
87+
},
88+
],
89+
})
90+
91+
watch(dialogVisible, (bool) => {
92+
if (!bool) {
93+
sourceType.value = ''
94+
folderForm.value = {
95+
name: '',
96+
desc: '',
97+
parent_id: '',
98+
}
99+
isEdit.value = false
100+
FolderFormRef.value.resetFields()
101+
}
102+
})
103+
104+
const open = (source: string, id: string, data?: any) => {
105+
sourceType.value = source
106+
if (data) {
107+
// 编辑当前id
108+
editId.value = data.id
109+
folderForm.value.name = data.name
110+
folderForm.value.desc = data.desc
111+
folderForm.value.parent_id = data.parent_id
112+
isEdit.value = true
113+
} else {
114+
// 给当前id添加子id
115+
folderForm.value.parent_id = id
116+
}
117+
dialogVisible.value = true
118+
}
119+
120+
const submitHandle = async () => {
121+
await FolderFormRef.value.validate((valid: any) => {
122+
if (valid) {
123+
if (isEdit.value) {
124+
folderApi
125+
.putFolder(editId.value, sourceType.value, folderForm.value, loading)
126+
.then((res) => {
127+
MsgSuccess(t('common.editSuccess'))
128+
emit('refresh')
129+
dialogVisible.value = false
130+
})
131+
} else {
132+
folderApi.postFolder(sourceType.value, folderForm.value, loading).then((res) => {
133+
return user.profile().then(() => {
134+
MsgSuccess(t('common.createSuccess'))
135+
folder.setCurrentFolder(res.data)
136+
folder.asyncGetFolder(sourceType.value, {}, 'workspace', loading)
137+
clearData()
138+
emit('refresh')
139+
dialogVisible.value = false
140+
})
141+
})
142+
}
143+
}
144+
})
145+
}
146+
147+
function clearData() {
148+
tool.setToolList([])
149+
knowledge.setKnowledgeList([])
150+
}
151+
152+
defineExpose({ open })
153+
</script>
154+
<style lang="scss" scoped></style>
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
<template>
2+
<el-dialog
3+
:title="$t('common.moveTo')"
4+
v-model="dialogVisible"
5+
append-to-body
6+
:close-on-click-modal="false"
7+
:close-on-press-escape="false"
8+
align-center
9+
>
10+
<folder-tree
11+
ref="treeRef"
12+
:source="source"
13+
:data="folderList"
14+
:default-expanded-keys="[currentNodeKey]"
15+
:canOperation="false"
16+
class="move-to-dialog-tree"
17+
@handleNodeClick="folderClickHandle"
18+
/>
19+
<template #footer>
20+
<span class="dialog-footer">
21+
<el-button @click.prevent="dialogVisible = false" :loading="loading">
22+
{{ $t('common.cancel') }}
23+
</el-button>
24+
<el-button
25+
type="primary"
26+
@click="submitHandle"
27+
:loading="loading"
28+
:disabled="!selectForderId || selectForderId === folder?.currentFolder?.id"
29+
>
30+
{{ $t('common.confirm') }}
31+
</el-button>
32+
</span>
33+
</template>
34+
</el-dialog>
35+
</template>
36+
<script setup lang="ts">
37+
import { ref, watch, reactive } from 'vue'
38+
import folderApi from '@/api/workspace/folder'
39+
import { MsgError, MsgSuccess } from '@/utils/message'
40+
import { t } from '@/locales'
41+
import useStore from '@/stores'
42+
import { SourceTypeEnum } from '@/enums/common'
43+
import KnowledgeApi from '@/api/knowledge/knowledge'
44+
import ApplicationApi from '@/api/application/application'
45+
import ToolApi from '@/api/tool/tool'
46+
const { folder } = useStore()
47+
const emit = defineEmits(['refresh'])
48+
49+
const props = defineProps({
50+
source: {
51+
type: String,
52+
default: '',
53+
},
54+
})
55+
56+
const treeRef = ref()
57+
const loading = ref(false)
58+
const dialogVisible = ref(false)
59+
const folderList = ref<any[]>([])
60+
const detail = ref<any>(null) // 保存交互所需信息:批量操作是id_list
61+
const selectForderId = ref<any>('')
62+
const currentNodeKey = ref<string>('')
63+
const isBatch = ref(false)
64+
65+
watch(dialogVisible, (bool) => {
66+
if (!bool) {
67+
detail.value = null
68+
selectForderId.value = ''
69+
folderList.value = []
70+
currentNodeKey.value = ''
71+
treeRef.value?.clearCurrentKey()
72+
}
73+
})
74+
75+
const isFolder = ref<boolean>(false)
76+
77+
const open = (data: any, is_folder?: any) => {
78+
detail.value = data
79+
isBatch.value = data?.id_list
80+
isFolder.value = is_folder
81+
getFolder()
82+
dialogVisible.value = true
83+
}
84+
85+
function getFolder() {
86+
const params = {}
87+
folder.asyncGetFolder(props.source, params, 'workspace', loading).then((res: any) => {
88+
folderList.value = res.data
89+
if (folderList.value?.length > 0) {
90+
currentNodeKey.value = folderList.value[0]?.id
91+
} else {
92+
currentNodeKey.value = ''
93+
}
94+
})
95+
}
96+
97+
function folderClickHandle(item: any) {
98+
selectForderId.value = item.id
99+
}
100+
101+
const submitHandle = async () => {
102+
if (selectForderId.value) {
103+
const obj = {
104+
...detail.value,
105+
folder_id: selectForderId.value,
106+
}
107+
if (isFolder.value) {
108+
const folder_obj = {
109+
...detail.value,
110+
parent_id: selectForderId.value,
111+
}
112+
folderApi
113+
.putFolder(detail.value.id, detail.value.folder_type, folder_obj, loading)
114+
.then(() => {
115+
MsgSuccess(t('common.saveSuccess'))
116+
emit('refresh')
117+
dialogVisible.value = false
118+
})
119+
} else if (props.source === SourceTypeEnum.KNOWLEDGE) {
120+
if (isBatch.value) {
121+
KnowledgeApi.putMulMoveKnowledge(obj, loading).then(() => {
122+
MsgSuccess(t('common.saveSuccess'))
123+
emit('refresh')
124+
dialogVisible.value = false
125+
})
126+
} else {
127+
if (detail.value.type === 2) {
128+
KnowledgeApi.putLarkKnowledge(detail.value.id, obj, loading).then(() => {
129+
MsgSuccess(t('common.saveSuccess'))
130+
emit('refresh', detail.value)
131+
dialogVisible.value = false
132+
})
133+
} else {
134+
KnowledgeApi.putKnowledge(detail.value.id, obj, loading).then(() => {
135+
MsgSuccess(t('common.saveSuccess'))
136+
emit('refresh', detail.value)
137+
dialogVisible.value = false
138+
})
139+
}
140+
}
141+
} else if (props.source === SourceTypeEnum.TOOL) {
142+
if (isBatch.value) {
143+
ToolApi.putMulMoveTool(obj, loading).then(() => {
144+
MsgSuccess(t('common.saveSuccess'))
145+
emit('refresh')
146+
dialogVisible.value = false
147+
})
148+
} else {
149+
ToolApi.putTool(detail.value.id, obj, loading).then(() => {
150+
MsgSuccess(t('common.saveSuccess'))
151+
emit('refresh', detail.value)
152+
dialogVisible.value = false
153+
})
154+
}
155+
} else if (props.source === SourceTypeEnum.APPLICATION) {
156+
if (isBatch.value) {
157+
ApplicationApi.putMulMoveApplication(obj, loading).then(() => {
158+
MsgSuccess(t('common.saveSuccess'))
159+
emit('refresh')
160+
dialogVisible.value = false
161+
})
162+
} else {
163+
ApplicationApi.moveApplication(detail.value.id, obj.folder_id, loading).then((res) => {
164+
MsgSuccess(t('common.saveSuccess'))
165+
emit('refresh', detail.value)
166+
dialogVisible.value = false
167+
})
168+
}
169+
}
170+
} else {
171+
MsgError(t('components.folder.requiredMessage'))
172+
}
173+
}
174+
175+
defineExpose({ open })
176+
</script>
177+
<style lang="scss" scoped>
178+
.move-to-dialog-tree {
179+
:deep(.el-input) {
180+
padding: 0 !important;
181+
margin-bottom: 8px;
182+
}
183+
:deep(.el-scrollbar) {
184+
border: 1px solid var(--el-border-color-light);
185+
border-radius: 6px;
186+
}
187+
:deep(.el-tree) {
188+
height: calc(100vh - 320px) !important;
189+
}
190+
}
191+
</style>

0 commit comments

Comments
 (0)