feat(ui): Support multi knowledgebases operation

This commit is contained in:
wizardchen
2025-09-17 16:02:08 +08:00
parent 0292b3ce36
commit 98e47e83d2
39 changed files with 1718 additions and 4839 deletions
-5
View File
@@ -1,5 +1,4 @@
import { defineStore } from 'pinia'
import { resetTestDataLoaded } from '@/api/test-data'
import { ref, computed } from 'vue'
import type { UserInfo, TenantInfo, KnowledgeBaseInfo } from '@/api/auth'
@@ -85,10 +84,6 @@ export const useAuthStore = defineStore('auth', () => {
localStorage.removeItem('weknora_knowledge_bases')
localStorage.removeItem('weknora_current_kb')
// 重置测试数据加载标志,确保重新登录后会重新获取KB列表
try {
resetTestDataLoaded()
} catch {}
}
const initFromStorage = () => {
+2 -2
View File
@@ -4,8 +4,8 @@ import { defineStore } from "pinia";
export const knowledgeStore = defineStore("knowledge", {
state: () => ({
cardList: ref([]),
total: ref(0),
cardList: ref<any[]>([]),
total: ref<number>(0),
}),
actions: {},
});
+2 -3
View File
@@ -5,7 +5,7 @@ import { defineStore } from 'pinia';
export const useMenuStore = defineStore('menuStore', {
state: () => ({
menuArr: reactive([
{ title: '知识库', icon: 'zhishiku', path: 'knowledgeBase' },
{ title: '知识库', icon: 'zhishiku', path: 'knowledge-bases' },
{
title: '对话',
icon: 'prefixIcon',
@@ -13,8 +13,7 @@ export const useMenuStore = defineStore('menuStore', {
childrenPath: 'chat',
children: reactive<object[]>([]),
},
{ title: '账户信息', icon: 'tenant', path: 'tenant' },
{ title: '系统设置', icon: 'setting', path: 'settings' },
{ title: '系统信息', icon: 'tenant', path: 'tenant' },
{ title: '退出登录', icon: 'logout', path: 'logout' }
]),
isFirstSession: false,