feat: 新增知识卡片页面及路由支持

- 添加知识卡片 API 接口与 Mock 数据
- 实现知识卡片列表展示与筛选功能
- 实现知识卡片详情抽屉
- 支持路由嵌套配置与菜单展开
This commit is contained in:
2026-05-27 19:46:05 +08:00
parent 9575e5898f
commit 34e52ab1d0
8 changed files with 808 additions and 12 deletions

View File

@@ -0,0 +1,38 @@
import { get } from '@/utils/request'
export type KnowledgeCardType = 'global' | 'product' | 'chat'
export type KnowledgeCardAuditStatus = 'pending' | 'approved'
export interface RelatedProduct {
id: number
name: string
}
export interface RelatedChat {
id: number
name: string
}
export interface KnowledgeCard {
id: number
title: string
content: string
type: KnowledgeCardType
auditStatus: KnowledgeCardAuditStatus
author: string
updatedAt: string
coverColor: string
tags: string[]
relatedProducts: RelatedProduct[]
relatedChats: RelatedChat[]
}
export interface GetKnowledgeCardsParams {
type?: KnowledgeCardType
auditStatus?: KnowledgeCardAuditStatus
}
/** 获取知识卡片列表 */
export function getKnowledgeCards(params?: GetKnowledgeCardsParams) {
return get<KnowledgeCard[]>('/knowledge/cards', params as Record<string, string>)
}