Skip to content

Commit ac9bb0d

Browse files
committed
feat: enhance Result.vue to determine API type based on route
1 parent 48baeac commit ac9bb0d

File tree

1 file changed

+15
-2
lines changed
  • ui/src/views/knowledge-workflow/component/action

1 file changed

+15
-2
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ import { onUnmounted, ref, computed } from 'vue'
2929
import knowledgeApi from '@/api/knowledge/knowledge'
3030
const props = defineProps<{ id: string; knowledge_id: string }>()
3131
import ExecutionDetailContent from '@/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue'
32+
import { useRoute } from "vue-router";
33+
import { loadSharedApi } from "@/utils/dynamics-api/shared-api.ts";
34+
const route = useRoute()
35+
3236
const detail = computed(() => {
3337
if (knowledge_action.value) {
3438
return Object.values(knowledge_action.value.details)
@@ -41,16 +45,25 @@ const state = computed(() => {
4145
}
4246
return 'PADDING'
4347
})
48+
const apiType = computed(() => {
49+
if (route.path.includes('shared')) {
50+
return 'systemShare'
51+
} else if (route.path.includes('resource-management')) {
52+
return 'systemManage'
53+
} else {
54+
return 'workspace'
55+
}
56+
})
4457
const knowledge_action = ref<any>()
4558
let pollingTimer: any = null
4659
4760
const getKnowledgeWorkflowAction = () => {
4861
if (pollingTimer == null) {
4962
return
5063
}
51-
knowledgeApi
64+
loadSharedApi({type: 'knowledge', systemType: apiType.value})
5265
.getWorkflowAction(props.knowledge_id, props.id)
53-
.then((ok) => {
66+
.then((ok: any) => {
5467
knowledge_action.value = ok.data
5568
})
5669
.finally(() => {

0 commit comments

Comments
 (0)