Skip to content

Commit c23e18d

Browse files
authored
fix: Cannot add in advanced orchestration application workflow (#3515)
1 parent f370840 commit c23e18d

File tree

1 file changed

+54
-53
lines changed

1 file changed

+54
-53
lines changed

ui/src/views/application-workflow/component/DropdownMenu.vue

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@
1919
<template v-for="(node, index) in filter_menu_nodes" :key="index">
2020
<el-text type="info" size="small" class="color-secondary ml-12">{{
2121
node.label
22-
}}</el-text>
22+
}}</el-text>
2323
<div class="flex-wrap mt-8">
2424
<template v-for="(item, index) in node.list" :key="index">
2525
<el-popover placement="right" :width="280">
2626
<template #reference>
27-
<div class="list-item flex align-center border border-r-6 mb-12 p-8-12 cursor ml-12"
28-
style="width: 39%" @click.stop="clickNodes(item)" @mousedown.stop="onmousedown(item)">
27+
<div
28+
class="list-item flex align-center border border-r-6 mb-12 p-8-12 cursor ml-12"
29+
style="width: 39%"
30+
@click.stop="clickNodes(item)"
31+
@mousedown.stop="onmousedown(item)"
32+
>
2933
<component
3034
:is="iconComponent(`${item.type}-icon`)"
3135
class="mr-8"
@@ -45,7 +49,7 @@
4549
</div>
4650
<el-text type="info" size="small" class="color-secondary lighter">{{
4751
item.text
48-
}}</el-text>
52+
}}</el-text>
4953
</template>
5054
</el-popover>
5155
</template>
@@ -64,33 +68,58 @@
6468
<el-collapse-item name="shared" :icon="CaretRight">
6569
<template #title>
6670
<div class="flex align-center">
67-
<AppIcon iconName="app-shared-active" style="font-size: 20px" class="color-primary"></AppIcon>
71+
<AppIcon
72+
iconName="app-shared-active"
73+
style="font-size: 20px"
74+
class="color-primary"
75+
></AppIcon>
6876
<span class="ml-8 lighter">{{ $t('views.shared.shared_tool') }}</span>
6977
</div>
7078
</template>
71-
<NodeContent :list="sharedToolList" @clickNodes="(val: any) => clickNodes(toolLibNode, val, 'tool')"
72-
@onmousedown="(val: any) => onmousedown(toolLibNode, val, 'tool')" />
79+
<NodeContent
80+
:list="sharedToolList"
81+
@clickNodes="(val: any) => clickNodes(toolLibNode, val, 'tool')"
82+
@onmousedown="(val: any) => onmousedown(toolLibNode, val, 'tool')"
83+
/>
7384
</el-collapse-item>
7485
</el-collapse>
7586

76-
<el-tree :data="toolTreeData" node-key="id"
77-
:props="{ children: 'children', isLeaf: 'isLeaf', class: getNodeClass }" lazy :load="loadNode">
87+
<el-tree
88+
:data="toolTreeData"
89+
node-key="id"
90+
:props="{ children: 'children', isLeaf: 'isLeaf', class: getNodeClass }"
91+
lazy
92+
:load="loadNode"
93+
>
7894
<template #default="{ data, node }">
79-
<NodeContent v-if="!data._fake" :data="data" :node="node"
95+
<NodeContent
96+
v-if="!data._fake"
97+
:data="data"
98+
:node="node"
8099
@clickNodes="(val: any) => clickNodes(toolLibNode, val, 'tool')"
81-
@onmousedown="(val: any) => onmousedown(toolLibNode, val, 'tool')" />
100+
@onmousedown="(val: any) => onmousedown(toolLibNode, val, 'tool')"
101+
/>
82102
</template>
83103
</el-tree>
84104
</el-scrollbar>
85105
</el-tab-pane>
86106
<el-tab-pane :label="$t('views.application.title')" name="application">
87107
<el-scrollbar height="400">
88-
<el-tree :data="applicationTreeData" node-key="id"
89-
:props="{ children: 'children', isLeaf: 'isLeaf', class: getNodeClass }" lazy :load="loadNode">
108+
<el-tree
109+
:data="applicationTreeData"
110+
node-key="id"
111+
:props="{ children: 'children', isLeaf: 'isLeaf', class: getNodeClass }"
112+
lazy
113+
:load="loadNode"
114+
>
90115
<template #default="{ data, node }">
91-
<NodeContent v-if="!data._fake" :data="data" :node="node"
116+
<NodeContent
117+
v-if="!data._fake"
118+
:data="data"
119+
:node="node"
92120
@clickNodes="(val: any) => clickNodes(applicationNode, val, 'application')"
93-
@onmousedown="(val: any) => onmousedown(applicationNode, val, 'application')" />
121+
@onmousedown="(val: any) => onmousedown(applicationNode, val, 'application')"
122+
/>
94123
</template>
95124
</el-tree>
96125
</el-scrollbar>
@@ -110,7 +139,7 @@ import { SourceTypeEnum } from '@/enums/common'
110139
import sharedWorkspaceApi from '@/api/shared-workspace'
111140
import { CaretRight } from '@element-plus/icons-vue'
112141
import ApplicationApi from '@/api/application/application'
113-
const {user} = useStore()
142+
const { user } = useStore()
114143
const search_text = ref<string>('')
115144
const props = defineProps({
116145
show: {
@@ -161,29 +190,10 @@ function clickNodes(item: any, data?: any, type?: string) {
161190
}
162191
}
163192
if (type == 'application') {
164-
if (isWorkFlow(data.type)) {
165-
const nodeData = data.work_flow.nodes[0].properties.node_data
166-
const fileUploadSetting = nodeData.file_upload_setting
167-
item['properties']['node_data'] = {
168-
name: data.name,
169-
icon: data.icon,
170-
application_id: data.id,
171-
api_input_field_list: data.work_flow.nodes[0].properties.api_input_field_list,
172-
user_input_field_list: data.work_flow.nodes[0].properties.user_input_field_list,
173-
...(!fileUploadSetting
174-
? {}
175-
: {
176-
...(fileUploadSetting.document ? { document_list: [] } : {}),
177-
...(fileUploadSetting.image ? { image_list: [] } : {}),
178-
...(fileUploadSetting.audio ? { audio_list: [] } : {}),
179-
}),
180-
}
181-
} else {
182-
item['properties']['node_data'] = {
183-
name: data.name,
184-
icon: data.icon,
185-
application_id: data.id,
186-
}
193+
item['properties']['node_data'] = {
194+
name: data.name,
195+
icon: data.icon,
196+
application_id: data.id,
187197
}
188198
}
189199
}
@@ -213,15 +223,6 @@ function onmousedown(item: any, data?: any, type?: string) {
213223
name: data.name,
214224
icon: data.icon,
215225
application_id: data.id,
216-
api_input_field_list: data.work_flow.nodes[0].properties.api_input_field_list,
217-
user_input_field_list: data.work_flow.nodes[0].properties.user_input_field_list,
218-
...(!fileUploadSetting
219-
? {}
220-
: {
221-
...(fileUploadSetting.document ? { document_list: [] } : {}),
222-
...(fileUploadSetting.image ? { image_list: [] } : {}),
223-
...(fileUploadSetting.audio ? { audio_list: [] } : {}),
224-
}),
225226
}
226227
} else {
227228
item['properties']['node_data'] = {
@@ -250,10 +251,10 @@ const loadNode = async (node: any, resolve: (children: any[]) => void) => {
250251
folders = res.data?.folders
251252
} else {
252253
const res = await ApplicationApi.getAllApplication({ folder_id: node.data.id })
253-
node.data.cardList = res.data.filter(item => item.resource_type === "application")
254-
folders = res.data.filter(item => item.resource_type === "folder")
254+
node.data.cardList = res.data.filter((item) => item.resource_type === 'application')
255+
folders = res.data.filter((item) => item.resource_type === 'folder')
255256
}
256-
const children = folders.map(f => ({
257+
const children = folders.map((f) => ({
257258
...f,
258259
children: [],
259260
isLeaf: false,
@@ -300,7 +301,7 @@ function getApplicationFolder() {
300301
301302
onMounted(() => {
302303
if (user.isEE()) {
303-
getShareTool()
304+
getShareTool()
304305
}
305306
getToolFolder()
306307
getApplicationFolder()
@@ -358,7 +359,7 @@ onMounted(() => {
358359
}
359360
}
360361
361-
:deep(.el-tree-node):focus>.el-tree-node__content {
362+
:deep(.el-tree-node):focus > .el-tree-node__content {
362363
background: transparent;
363364
}
364365
:deep(.el-tree-node__content) {

0 commit comments

Comments
 (0)