diff --git a/ui/src/layout/components/breadcrumb/index.vue b/ui/src/layout/components/breadcrumb/index.vue index e1f8cbfe8..c4e6283a4 100644 --- a/ui/src/layout/components/breadcrumb/index.vue +++ b/ui/src/layout/components/breadcrumb/index.vue @@ -1,7 +1,27 @@ @@ -120,10 +137,10 @@ const list = ref([]) const loading = ref(false) const breadcrumbData = computed(() => common.breadcrumb) - -const current = computed(() => { - return list.value?.filter((v) => v.id === id)?.[0] -}) +const current = ref(null) +// const current = computed(() => { +// return list.value?.filter((v) => v.id === id)?.[0] +// }) const isApplication = computed(() => { return activeMenu.includes('application') @@ -132,6 +149,32 @@ const isKnowledge = computed(() => { return activeMenu.includes('knowledge') }) +function getKnowledgeDetail() { + loading.value = true + knowledge + .asyncGetKnowledgeDetail(id) + .then((res: any) => { + current.value = res.data + loading.value = false + }) + .catch(() => { + loading.value = false + }) +} + +function getApplicationDetail() { + loading.value = true + application + .asyncGetApplicationDetail(id) + .then((res: any) => { + current.value = res.data + loading.value = false + }) + .catch(() => { + loading.value = false + }) +} + function openCreateDialog() { if (isKnowledge.value) { CreateKnowledgeDialogRef.value.open() @@ -192,15 +235,20 @@ function refresh() { common.saveBreadcrumb(null) } onMounted(() => { - if (!breadcrumbData.value) { - if (isKnowledge.value) { - getKnowledge() - } else if (isApplication.value) { - getApplication() - } - } else { - list.value = breadcrumbData.value + if (isKnowledge.value) { + getKnowledgeDetail() + } else if (isApplication.value) { + getApplicationDetail() } + // if (!breadcrumbData.value) { + // if (isKnowledge.value) { + // getKnowledge() + // } else if (isApplication.value) { + // getApplication() + // } + // } else { + // list.value = breadcrumbData.value + // } }) diff --git a/ui/src/layout/components/sidebar/index.vue b/ui/src/layout/components/sidebar/index.vue index 0f9dafdd1..0b61995ea 100644 --- a/ui/src/layout/components/sidebar/index.vue +++ b/ui/src/layout/components/sidebar/index.vue @@ -1,8 +1,8 @@