feat: Add quick actions for document management in knowledge base
- Introduced a new section for quick actions in the menu, allowing users to upload documents and create FAQs directly from the interface. - Implemented file upload functionality with validation and error handling. - Enhanced localization for new quick action strings in English, Russian, and Chinese. - Updated the UI to improve user experience when interacting with knowledge base actions.
This commit is contained in:
@@ -1462,10 +1462,19 @@ const handleOpenKBSettings = () => {
|
||||
|
||||
const handleKnowledgeDropdownSelect = (data: { value: string }) => {
|
||||
if (!data?.value || data.value === props.kbId) return
|
||||
const target = knowledgeList.value.find((item) => item.id === data.value)
|
||||
router.push(`/platform/knowledge-bases/${data.value}`)
|
||||
}
|
||||
|
||||
const handleFaqMenuAction = (event: Event) => {
|
||||
const detail = (event as CustomEvent<{ action: string; kbId: string }>).detail
|
||||
if (!detail || detail.kbId !== props.kbId) return
|
||||
if (detail.action === 'create') {
|
||||
openEditor()
|
||||
} else if (detail.action === 'import') {
|
||||
openImportDialog()
|
||||
}
|
||||
}
|
||||
|
||||
const handleEntryStatusChange = async (entry: FAQEntry, value: boolean) => {
|
||||
if (!props.kbId) {
|
||||
return
|
||||
@@ -2240,15 +2249,14 @@ const handleResize = () => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.kbId) {
|
||||
loadEntries()
|
||||
}
|
||||
loadKnowledgeList()
|
||||
window.addEventListener('resize', handleResize)
|
||||
window.addEventListener('faqMenuAction', handleFaqMenuAction as EventListener)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', handleResize)
|
||||
window.removeEventListener('faqMenuAction', handleFaqMenuAction as EventListener)
|
||||
if (arrangeCardsTimer) {
|
||||
clearTimeout(arrangeCardsTimer)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user