feat: enhance UserMenu and KnowledgeBase components with loading skeletons and improved UI elements, including GitHub star tooltip and translations for better user experience
This commit is contained in:
@@ -23,8 +23,13 @@
|
||||
:disabled="!props.kbId"
|
||||
@click.stop="handleNavigateToCurrentKB"
|
||||
>
|
||||
<span>{{ kbInfo?.name || '--' }}</span>
|
||||
<t-icon name="chevron-down" />
|
||||
<template v-if="!kbInfo">
|
||||
<t-skeleton animation="gradient" :row-col="[{ width: '120px', height: '20px' }]" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{ kbInfo.name }}</span>
|
||||
<t-icon name="chevron-down" />
|
||||
</template>
|
||||
</button>
|
||||
</t-dropdown>
|
||||
<button
|
||||
@@ -34,13 +39,18 @@
|
||||
:disabled="!props.kbId"
|
||||
@click="handleNavigateToCurrentKB"
|
||||
>
|
||||
{{ kbInfo?.name || '--' }}
|
||||
<template v-if="!kbInfo">
|
||||
<t-skeleton animation="gradient" :row-col="[{ width: '120px', height: '20px' }]" />
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ kbInfo.name }}
|
||||
</template>
|
||||
</button>
|
||||
<t-icon name="chevron-right" class="breadcrumb-separator" />
|
||||
<span class="breadcrumb-current">{{ $t('knowledgeEditor.faq.title') }}</span>
|
||||
</h2>
|
||||
<!-- 身份与最后更新:紧凑单行,置于标题行右侧,悬停显示权限说明 -->
|
||||
<div v-if="kbInfo" class="faq-access-meta">
|
||||
<div v-if="kbInfo && !authStore.isLiteMode" class="faq-access-meta">
|
||||
<t-tooltip :content="accessPermissionSummary" placement="top">
|
||||
<span class="faq-access-meta-inner">
|
||||
<t-tag size="small" :theme="isOwner ? 'success' : (effectiveKBPermission === 'admin' ? 'primary' : effectiveKBPermission === 'editor' ? 'warning' : 'default')" class="faq-access-role-tag">
|
||||
@@ -206,7 +216,7 @@
|
||||
:title="$t('knowledgeBase.tagCreateAction')"
|
||||
@click="startCreateTag"
|
||||
>
|
||||
<span class="create-tag-plus" aria-hidden="true">+</span>
|
||||
<t-icon name="add" />
|
||||
</t-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -222,13 +232,20 @@
|
||||
</template>
|
||||
</t-input>
|
||||
</div>
|
||||
<t-loading :loading="tagLoading" size="small">
|
||||
<div ref="tagListRef" class="faq-tag-list" @scroll="handleTagListScroll">
|
||||
<div ref="tagListRef" class="faq-tag-list" @scroll="handleTagListScroll">
|
||||
<template v-if="tagLoading && !filteredTags.length">
|
||||
<div v-for="n in 8" :key="'skel-tag-'+n" class="faq-tag-item" style="cursor: default; pointer-events: none;">
|
||||
<div class="faq-tag-left" style="gap: 12px; width: 100%;">
|
||||
<t-skeleton animation="gradient" :row-col="[{ width: '80%', height: '18px' }]" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-if="creatingTag" class="faq-tag-item tag-editing" @click.stop>
|
||||
<div class="faq-tag-left">
|
||||
<t-icon name="folder" size="18px" />
|
||||
<div class="tag-edit-input">
|
||||
<t-input
|
||||
<div class="faq-tag-left">
|
||||
<span class="tag-hash-icon">#</span>
|
||||
<div class="tag-edit-input">
|
||||
<t-input
|
||||
ref="newTagInputRef"
|
||||
v-model="newTagName"
|
||||
size="small"
|
||||
@@ -270,9 +287,9 @@
|
||||
:class="{ active: selectedTagId === tag.seq_id, editing: editingTagId === tag.id }"
|
||||
@click="handleTagRowClick(tag.seq_id)"
|
||||
>
|
||||
<div class="faq-tag-left">
|
||||
<t-icon name="folder" size="18px" />
|
||||
<template v-if="editingTagId === tag.id">
|
||||
<div class="faq-tag-left">
|
||||
<span class="tag-hash-icon">#</span>
|
||||
<template v-if="editingTagId === tag.id">
|
||||
<div class="tag-edit-input" @click.stop>
|
||||
<t-input
|
||||
:ref="setEditingTagInputRefByTag(tag.id)"
|
||||
@@ -343,8 +360,8 @@
|
||||
<div v-if="tagLoadingMore" class="tag-loading-more">
|
||||
<t-loading size="small" />
|
||||
</div>
|
||||
</div>
|
||||
</t-loading>
|
||||
</template>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="faq-card-area">
|
||||
@@ -3286,22 +3303,21 @@ watch(() => entries.value.map(e => ({
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
background: var(--td-bg-color-container);
|
||||
border: 1px solid var(--td-component-stroke);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
// 与列表页筛选区、文档型知识库标签栏一致:白底卡片感
|
||||
// 贴近整体系统设计语言的极简侧栏
|
||||
.faq-tag-panel {
|
||||
width: 200px;
|
||||
background: var(--td-bg-color-container);
|
||||
width: 180px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-right: 1px solid var(--td-component-stroke);
|
||||
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
|
||||
padding: 16px;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 1px 0 0 rgba(0, 0, 0, 0.02);
|
||||
padding: 0 16px 0 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
max-height: 100%;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
@@ -3320,77 +3336,88 @@ watch(() => entries.value.map(e => ({
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 12px;
|
||||
padding: 0 4px;
|
||||
color: var(--td-text-color-primary);
|
||||
|
||||
.sidebar-title {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 4px;
|
||||
font-size: 13px;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
|
||||
.sidebar-count {
|
||||
font-size: 12px;
|
||||
color: var(--td-text-color-secondary);
|
||||
color: var(--td-text-color-placeholder);
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-actions {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
color: var(--td-text-color-placeholder);
|
||||
align-items: center;
|
||||
|
||||
.create-tag-btn {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
border-radius: 6px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--td-success-color);
|
||||
line-height: 1;
|
||||
transition: background 0.2s ease, color 0.2s ease;
|
||||
color: var(--td-text-color-secondary);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
.t-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-brand-color-active);
|
||||
color: var(--td-brand-color);
|
||||
}
|
||||
}
|
||||
|
||||
.create-tag-plus {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.sidebar-action-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 6px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--td-text-color-secondary);
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease, color 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-success-color);
|
||||
color: var(--td-brand-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tag-search-bar {
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 12px;
|
||||
padding: 0 4px;
|
||||
|
||||
:deep(.t-input) {
|
||||
font-size: 12px;
|
||||
background-color: var(--td-bg-color-container);
|
||||
border-color: var(--td-component-stroke);
|
||||
font-size: 13px;
|
||||
background-color: var(--td-bg-color-secondarycontainer);
|
||||
border-color: transparent;
|
||||
border-radius: 6px;
|
||||
box-shadow: none !important;
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&.t-is-focused {
|
||||
border-color: var(--td-brand-color);
|
||||
background-color: var(--td-bg-color-container);
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.t-input__inner) {
|
||||
@@ -3427,13 +3454,13 @@ watch(() => entries.value.map(e => ({
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 9px 12px;
|
||||
padding: 8px 8px;
|
||||
border-radius: 6px;
|
||||
color: var(--td-text-color-primary);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
.faq-tag-left {
|
||||
@@ -3443,12 +3470,25 @@ watch(() => entries.value.map(e => ({
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
|
||||
.t-icon {
|
||||
.t-icon,
|
||||
.tag-hash-icon {
|
||||
flex-shrink: 0;
|
||||
color: var(--td-text-color-secondary);
|
||||
font-size: 14px;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.t-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.tag-hash-icon {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-name {
|
||||
@@ -3458,10 +3498,9 @@ watch(() => entries.value.map(e => ({
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 450;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.faq-tag-right {
|
||||
@@ -3474,37 +3513,34 @@ watch(() => entries.value.map(e => ({
|
||||
|
||||
.faq-tag-count {
|
||||
font-size: 12px;
|
||||
color: var(--td-text-color-secondary);
|
||||
font-weight: 500;
|
||||
min-width: 28px;
|
||||
padding: 3px 7px;
|
||||
border-radius: 8px;
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-text-color-placeholder);
|
||||
font-weight: 400;
|
||||
transition: all 0.2s ease;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
text-align: right;
|
||||
padding-left: 8px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-text-color-primary);
|
||||
|
||||
.faq-tag-left .t-icon {
|
||||
color: var(--td-text-color-primary);
|
||||
.faq-tag-left .t-icon,
|
||||
.faq-tag-left .tag-hash-icon {
|
||||
color: var(--td-text-color-secondary);
|
||||
}
|
||||
|
||||
.faq-tag-count {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-text-color-primary);
|
||||
color: var(--td-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: var(--td-success-color-light);
|
||||
background: var(--td-brand-color-light);
|
||||
color: var(--td-brand-color);
|
||||
font-weight: 500;
|
||||
|
||||
.faq-tag-left .t-icon {
|
||||
.faq-tag-left .t-icon,
|
||||
.faq-tag-left .tag-hash-icon {
|
||||
color: var(--td-brand-color);
|
||||
}
|
||||
|
||||
@@ -3513,13 +3549,7 @@ watch(() => entries.value.map(e => ({
|
||||
}
|
||||
|
||||
.faq-tag-count {
|
||||
background: var(--td-success-color-light);
|
||||
color: var(--td-brand-color);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--td-success-color-light);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3563,22 +3593,22 @@ watch(() => entries.value.map(e => ({
|
||||
}
|
||||
|
||||
:deep(.tag-action-btn.confirm) {
|
||||
background: var(--td-success-color-light);
|
||||
color: var(--td-brand-color-active);
|
||||
|
||||
&:hover {
|
||||
background: var(--td-success-color-light);
|
||||
color: var(--td-success-color);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.tag-action-btn.cancel) {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
background: transparent;
|
||||
color: var(--td-text-color-secondary);
|
||||
|
||||
&:hover {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-text-color-secondary);
|
||||
color: var(--td-brand-color);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.tag-action-btn.cancel) {
|
||||
background: transparent;
|
||||
color: var(--td-text-color-secondary);
|
||||
|
||||
&:hover {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-error-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3589,39 +3619,40 @@ watch(() => entries.value.map(e => ({
|
||||
max-width: 100%;
|
||||
|
||||
:deep(.t-input) {
|
||||
font-size: 12px;
|
||||
font-size: 13px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid var(--td-component-stroke);
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.t-input__wrap) {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid var(--td-component-stroke);
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
:deep(.t-input__inner) {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
padding: 0;
|
||||
color: var(--td-text-color-primary);
|
||||
caret-color: var(--td-text-color-primary);
|
||||
caret-color: var(--td-brand-color);
|
||||
}
|
||||
|
||||
:deep(.t-input:hover),
|
||||
:deep(.t-input.t-is-focused),
|
||||
:deep(.t-input__wrap:hover),
|
||||
:deep(.t-input__wrap.t-is-focused) {
|
||||
border-bottom-color: var(--td-success-color);
|
||||
border-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tag-more-btn {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
@@ -3629,23 +3660,15 @@ watch(() => entries.value.map(e => ({
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
color: var(--td-text-color-secondary);
|
||||
color: var(--td-text-color-placeholder);
|
||||
transition: all 0.2s ease;
|
||||
opacity: 0.6;
|
||||
|
||||
&:hover {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
color: var(--td-text-color-secondary);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tag-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tag-more-placeholder {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
@@ -3665,12 +3688,13 @@ watch(() => entries.value.map(e => ({
|
||||
.faq-card-area {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 12px;
|
||||
min-height: 0;
|
||||
padding: 0 0 0 16px;
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
background: var(--td-bg-color-container);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.faq-search-bar {
|
||||
@@ -3695,7 +3719,7 @@ watch(() => entries.value.map(e => ({
|
||||
background: transparent;
|
||||
border: none;
|
||||
&:hover {
|
||||
color: var(--td-text-color-secondary);
|
||||
color: var(--td-brand-color);
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
}
|
||||
}
|
||||
@@ -3703,15 +3727,17 @@ watch(() => entries.value.map(e => ({
|
||||
|
||||
:deep(.t-input) {
|
||||
font-size: 13px;
|
||||
background-color: var(--td-bg-color-container);
|
||||
border-color: var(--td-component-stroke);
|
||||
background-color: var(--td-bg-color-secondarycontainer);
|
||||
border-color: transparent;
|
||||
border-radius: 6px;
|
||||
box-shadow: none !important;
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&.t-is-focused {
|
||||
border-color: var(--td-brand-color);
|
||||
background-color: var(--td-bg-color-container);
|
||||
border-color: var(--td-success-color);
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user