feat(knowledge-base): add document batch delete and list view
Add a list-view alongside the existing card grid (issue #957) and multi-select batch delete (issue #1045) for documents inside a knowledge base. The two views are toggled from the toolbar and the preference is persisted in localStorage. Selection state is shared between views with shift-range support and a sticky batch-action bar. Backend - POST /api/v1/knowledge/batch-delete: validates KB scope and editor permission, then delegates to the existing DeleteKnowledgeList service which already cascades vector/file/graph cleanup. Caps batch size at 200 and uses a single GetKnowledgeBatch call for membership validation. Frontend - DocumentListView: table layout with sticky header, checkbox column (with indeterminate select-all), file-type icons, status badges, per-row action menu. - DocumentBatchBar: floating pill bar with selected count and delete action; appears when items are selected. - KnowledgeBase.vue: view-mode toggle, selection state, batch-delete confirmation dialog, hover/active checkbox overlay on existing cards. - Extracted formatFileSize and getFileIcon to utils/files.ts to share with the new list view and avoid further drift from the existing inline copies. - i18n keys added for zh-CN, en-US, ko-KR, ru-RU. Closes #1045 Closes #957
This commit is contained in:
@@ -222,6 +222,8 @@ func RegisterKnowledgeRoutes(r *gin.RouterGroup, handler *handler.KnowledgeHandl
|
||||
k.PUT("/tags", handler.UpdateKnowledgeTagBatch)
|
||||
// 搜索知识
|
||||
k.GET("/search", handler.SearchKnowledge)
|
||||
// 批量删除知识(同一知识库内)
|
||||
k.POST("/batch-delete", handler.BatchDeleteKnowledge)
|
||||
// 移动知识到其他知识库
|
||||
k.POST("/move", handler.MoveKnowledge)
|
||||
// 获取知识移动进度
|
||||
|
||||
Reference in New Issue
Block a user