feat: 新增知识卡片页面及路由支持
- 添加知识卡片 API 接口与 Mock 数据 - 实现知识卡片列表展示与筛选功能 - 实现知识卡片详情抽屉 - 支持路由嵌套配置与菜单展开
This commit is contained in:
38
frontend/src/api/knowledgeCards.ts
Normal file
38
frontend/src/api/knowledgeCards.ts
Normal 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>)
|
||||
}
|
||||
Reference in New Issue
Block a user