fix(admin): 优化知识库
This commit is contained in:
1 parent
3b771fc0b6
commit
a3420c5266
6 files changed
+32
-13
No files matched your search
@@ -3,7 +3,7 @@
|
||||
* features/kb/views/KbWorkspaceView.vue
|
||||
* 知识库作业面视图壳:模板与弹窗布局,业务逻辑见 useKbWorkspace。
|
||||
*/
|
||||
import { ArrowLeft, BookOpen, ChevronDown, ChevronUp, FileText, Info, RefreshCw, Search, Trash2, Upload } from 'lucide-vue-next';
|
||||
import { ArrowLeft, BookOpen, ChevronDown, ChevronUp, FileText, Info, RefreshCw, Search, Settings, Trash2, Upload } from 'lucide-vue-next';
|
||||
import KbWorkspaceOverlays from '../components/KbWorkspaceOverlays.vue';
|
||||
import { useKbWorkspace } from '../composables/useKbWorkspace';
|
||||
|
||||
@@ -52,6 +52,15 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
<RefreshCw class="h-4 w-4" />
|
||||
{{ kb.viewMode === 'group_overview' ? kb.t('kbWorkspace.actions.refreshGroups') : kb.t('kbWorkspace.actions.refreshDocuments') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="kb.viewMode === 'group_overview'"
|
||||
type="button"
|
||||
@click="kb.router.push('/admin/knowledge-base')"
|
||||
class="btn-primary"
|
||||
>
|
||||
<Settings class="h-4 w-4" />
|
||||
{{ kb.t('kbWorkspace.actions.manageGroups') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,24 +74,26 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
<div v-else-if="kb.groups.length === 0" class="kb-ws-empty py-10 text-center text-sm text-muted">
|
||||
{{ kb.t('kbWorkspace.overview.emptyGroups') }}
|
||||
</div>
|
||||
<div v-else class="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 auto-rows-fr">
|
||||
<div v-else class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4">
|
||||
<div
|
||||
v-for="group in kb.groups"
|
||||
:key="group.id"
|
||||
@click="kb.openGroupDetail(group.id)"
|
||||
class="kb-ws-card--interactive"
|
||||
class="kb-ws-card--interactive !min-h-[150px]"
|
||||
>
|
||||
<div class="w-full text-left">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div class="min-w-0">
|
||||
<div class="text-xl font-bold leading-tight text-primary break-words">{{ group.name }}</div>
|
||||
<div class="mt-1 text-sm text-muted">{{ group.description || kb.t('kbWorkspace.overview.noDescription') }}</div>
|
||||
<div class="mt-1 line-clamp-2 text-sm text-muted" :title="group.description || kb.t('kbWorkspace.overview.noDescription')">
|
||||
{{ group.description || kb.t('kbWorkspace.overview.noDescription') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="rounded-full bg-surface-soft px-2.5 py-1 text-xs font-medium text-secondary whitespace-nowrap">
|
||||
{{ kb.t('kbWorkspace.overview.documentCount', { count: group.document_count ?? 0 }) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 text-xs text-muted">{{ kb.t('kbWorkspace.overview.updatedAt') }}{{ kb.formatDateTime(group.updated_at) }}</div>
|
||||
<div class="mt-3 text-xs text-muted">{{ kb.t('kbWorkspace.overview.updatedAt') }}{{ kb.formatDateTime(group.updated_at) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user