Skip to content

Commit 056f79a

Browse files
committed
feat: update shared knowledge workflow API and adjust data source handling
1 parent f08a9c5 commit 056f79a

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

ui/src/views/knowledge-workflow/component/DebugDrawer.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,26 @@ import Result from '@/views/knowledge-workflow/component/action/Result.vue'
5353
import applicationApi from '@/api/application/application'
5454
import KnowledgeBase from '@/views/knowledge-workflow/component/action/KnowledgeBase.vue'
5555
import { WorkflowType } from '@/enums/application'
56-
import KnowledgeApi from '@/api/knowledge/knowledge'
56+
import { loadSharedApi } from "@/utils/dynamics-api/shared-api.ts";
57+
import { useRoute } from "vue-router";
5758
provide('upload', (file: any, loading?: Ref<boolean>) => {
5859
return applicationApi.postUploadFile(file, _knowledge_id.value, 'KNOWLEDGE', loading)
5960
})
61+
const route = useRoute()
6062
const ak = {
6163
data_source: DataSource,
6264
knowledge_base: KnowledgeBase,
6365
result: Result,
6466
}
67+
const apiType = computed(() => {
68+
if (route.path.includes('shared')) {
69+
return 'systemShare'
70+
} else if (route.path.includes('resource-management')) {
71+
return 'systemManage'
72+
} else {
73+
return 'workspace'
74+
}
75+
})
6576
const loading = ref<boolean>(false)
6677
const action_id = ref<string>()
6778
const ActionRef = ref()
@@ -103,10 +114,11 @@ const up = () => {
103114
const upload = () => {
104115
ActionRef.value.validate().then(() => {
105116
form_data.value[active.value] = ActionRef.value.get_data()
106-
KnowledgeApi.workflowAction(_knowledge_id.value, form_data.value, loading).then((ok) => {
107-
action_id.value = ok.data.id
108-
active.value = 'result'
109-
})
117+
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
118+
.workflowAction(_knowledge_id.value, form_data.value, loading).then((ok: any) => {
119+
action_id.value = ok.data.id
120+
active.value = 'result'
121+
})
110122
})
111123
}
112124
defineExpose({ close, open })

ui/src/views/knowledge-workflow/component/action/DataSource.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ const { user } = useStore()
5656
const route = useRoute()
5757
5858
const apiType = computed(() => {
59-
if (route.path.includes('resource-management')) {
59+
if (route.path.includes('shared')) {
60+
return 'systemShare'
61+
} else if (route.path.includes('resource-management')) {
6062
return 'systemManage'
6163
} else {
6264
return 'workspace'

0 commit comments

Comments
 (0)