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 @@
-
+
+
+
+
+
+
+ {{ current?.name }}
+
+
@@ -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 @@
) {
+ return new Promise((resolve, reject) => {
+ knowledgeApi
+ .getKnowledgeDetail(knowledge_id, loading)
+ .then((data) => {
+ resolve(data)
+ })
+ .catch((error) => {
+ reject(error)
+ })
+ })
+ },
// async asyncGetTreeRootKnowledge(loading?: Ref) {
// const folder = useFolderStore()
// return Promise.all([
@@ -87,18 +99,6 @@ const useKnowledgeStore = defineStore('knowledge', {
// return Promise.reject(error)
// })
// },
- async asyncGetKnowledgeDetail(knowledge_id: string, loading?: Ref) {
- return new Promise((resolve, reject) => {
- knowledgeApi
- .getKnowledgeDetail(knowledge_id, loading)
- .then((data) => {
- resolve(data)
- })
- .catch((error) => {
- reject(error)
- })
- })
- },
},
})
diff --git a/ui/src/views/chat/base/index.vue b/ui/src/views/chat/base/index.vue
index f48d6bacc..3ad51ddd1 100644
--- a/ui/src/views/chat/base/index.vue
+++ b/ui/src/views/chat/base/index.vue
@@ -11,13 +11,7 @@
>
-
+
{{ applicationDetail?.name }}
@@ -64,7 +58,7 @@ const applicationDetail = computed({
get: () => {
return props.application_profile
},
- set: (v) => {}
+ set: (v) => {},
})
const recordList = ref([])
const currentChatId = ref('')
diff --git a/ui/src/views/chat/embed/index.vue b/ui/src/views/chat/embed/index.vue
index 8a983c74c..f79fec715 100644
--- a/ui/src/views/chat/embed/index.vue
+++ b/ui/src/views/chat/embed/index.vue
@@ -5,7 +5,7 @@
v-loading="loading"
:style="{
'--el-color-primary': applicationDetail?.custom_theme?.theme_color,
- '--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1)
+ '--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
}"
>
{{ applicationDetail?.name }}
@@ -64,7 +58,7 @@
@@ -154,12 +148,12 @@ const applicationDetail = computed({
get: () => {
return props.application_profile
},
- set: (v) => {}
+ set: (v) => {},
})
const paginationConfig = reactive({
current_page: 1,
page_size: 20,
- total: 0
+ total: 0,
})
const currentRecordList = ref([])
@@ -170,14 +164,14 @@ const mouseId = ref('')
const customStyle = computed(() => {
return {
background: applicationDetail.value?.custom_theme?.theme_color,
- color: applicationDetail.value?.custom_theme?.header_font_color
+ color: applicationDetail.value?.custom_theme?.header_font_color,
}
})
function editName(val: string, item: any) {
if (val) {
const obj = {
- abstract: val
+ abstract: val,
}
chatLog.asyncPutChatClientLog(applicationDetail.value.id, item.id, obj, loading).then(() => {
const find = chatLogData.value.find((row: any) => row.id === item.id)
@@ -241,7 +235,7 @@ function newChat() {
function getChatLog(id: string) {
const page = {
current_page: 1,
- page_size: 20
+ page_size: 20,
}
chatLog.asyncGetChatLogClient(id, page, left_loading).then((res: any) => {
@@ -263,7 +257,7 @@ function getChatRecord() {
currentChatId.value,
paginationConfig,
loading,
- false
+ false,
)
.then((res: any) => {
paginationConfig.total = res.data.total
@@ -273,7 +267,7 @@ function getChatRecord() {
v['record_id'] = v.id
})
currentRecordList.value = [...list, ...currentRecordList.value].sort((a, b) =>
- a.create_time.localeCompare(b.create_time)
+ a.create_time.localeCompare(b.create_time),
)
if (paginationConfig.current_page === 1) {
nextTick(() => {
diff --git a/ui/src/views/chat/mobile/index.vue b/ui/src/views/chat/mobile/index.vue
index e43145502..db8a80ec0 100644
--- a/ui/src/views/chat/mobile/index.vue
+++ b/ui/src/views/chat/mobile/index.vue
@@ -4,7 +4,7 @@
v-loading="loading"
:style="{
'--el-color-primary': applicationDetail?.custom_theme?.theme_color,
- '--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1)
+ '--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
}"
>
{{ applicationDetail?.name }}
@@ -63,7 +57,7 @@
@@ -149,12 +143,12 @@ const applicationDetail = computed({
get: () => {
return props.application_profile
},
- set: (v) => {}
+ set: (v) => {},
})
const paginationConfig = reactive({
current_page: 1,
page_size: 20,
- total: 0
+ total: 0,
})
const currentRecordList = ref([])
@@ -165,14 +159,14 @@ const mouseId = ref('')
const customStyle = computed(() => {
return {
background: applicationDetail.value?.custom_theme?.theme_color,
- color: applicationDetail.value?.custom_theme?.header_font_color
+ color: applicationDetail.value?.custom_theme?.header_font_color,
}
})
function editName(val: string, item: any) {
if (val) {
const obj = {
- abstract: val
+ abstract: val,
}
chatLog.asyncPutChatClientLog(applicationDetail.value.id, item.id, obj, loading).then(() => {
@@ -237,7 +231,7 @@ function newChat() {
function getChatLog(id: string) {
const page = {
current_page: 1,
- page_size: 20
+ page_size: 20,
}
chatLog.asyncGetChatLogClient(id, page, left_loading).then((res: any) => {
@@ -259,7 +253,7 @@ function getChatRecord() {
currentChatId.value,
paginationConfig,
loading,
- false
+ false,
)
.then((res: any) => {
paginationConfig.total = res.data.total
@@ -269,7 +263,7 @@ function getChatRecord() {
v['record_id'] = v.id
})
currentRecordList.value = [...list, ...currentRecordList.value].sort((a, b) =>
- a.create_time.localeCompare(b.create_time)
+ a.create_time.localeCompare(b.create_time),
)
if (paginationConfig.current_page === 1) {
nextTick(() => {