mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-30 09:42:48 +00:00
feat: update shared knowledge workflow API and adjust data source handling
This commit is contained in:
parent
f08a9c53d4
commit
056f79a8b8
|
|
@ -53,15 +53,26 @@ import Result from '@/views/knowledge-workflow/component/action/Result.vue'
|
|||
import applicationApi from '@/api/application/application'
|
||||
import KnowledgeBase from '@/views/knowledge-workflow/component/action/KnowledgeBase.vue'
|
||||
import { WorkflowType } from '@/enums/application'
|
||||
import KnowledgeApi from '@/api/knowledge/knowledge'
|
||||
import { loadSharedApi } from "@/utils/dynamics-api/shared-api.ts";
|
||||
import { useRoute } from "vue-router";
|
||||
provide('upload', (file: any, loading?: Ref<boolean>) => {
|
||||
return applicationApi.postUploadFile(file, _knowledge_id.value, 'KNOWLEDGE', loading)
|
||||
})
|
||||
const route = useRoute()
|
||||
const ak = {
|
||||
data_source: DataSource,
|
||||
knowledge_base: KnowledgeBase,
|
||||
result: Result,
|
||||
}
|
||||
const apiType = computed(() => {
|
||||
if (route.path.includes('shared')) {
|
||||
return 'systemShare'
|
||||
} else if (route.path.includes('resource-management')) {
|
||||
return 'systemManage'
|
||||
} else {
|
||||
return 'workspace'
|
||||
}
|
||||
})
|
||||
const loading = ref<boolean>(false)
|
||||
const action_id = ref<string>()
|
||||
const ActionRef = ref()
|
||||
|
|
@ -103,10 +114,11 @@ const up = () => {
|
|||
const upload = () => {
|
||||
ActionRef.value.validate().then(() => {
|
||||
form_data.value[active.value] = ActionRef.value.get_data()
|
||||
KnowledgeApi.workflowAction(_knowledge_id.value, form_data.value, loading).then((ok) => {
|
||||
action_id.value = ok.data.id
|
||||
active.value = 'result'
|
||||
})
|
||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||
.workflowAction(_knowledge_id.value, form_data.value, loading).then((ok: any) => {
|
||||
action_id.value = ok.data.id
|
||||
active.value = 'result'
|
||||
})
|
||||
})
|
||||
}
|
||||
defineExpose({ close, open })
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ const { user } = useStore()
|
|||
const route = useRoute()
|
||||
|
||||
const apiType = computed(() => {
|
||||
if (route.path.includes('resource-management')) {
|
||||
if (route.path.includes('shared')) {
|
||||
return 'systemShare'
|
||||
} else if (route.path.includes('resource-management')) {
|
||||
return 'systemManage'
|
||||
} else {
|
||||
return 'workspace'
|
||||
|
|
|
|||
Loading…
Reference in New Issue