fix(frontend): hide redundant card badges when section headers apply
Suppress duplicate origin, builtin, role, and org-name pills on knowledge base, agent, and organization list cards when the visible group header or sidebar filter already conveys the same information.
This commit is contained in:
@@ -279,7 +279,7 @@
|
||||
</t-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!authStore.isLiteMode" class="bottom-right">
|
||||
<div v-if="!authStore.isLiteMode && showKbOriginBadge(kb)" class="bottom-right">
|
||||
<ResourceOriginBadge :variant="kbOriginVariant(kb)" :creator-name="kb.creator_name" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -504,7 +504,7 @@
|
||||
</t-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!authStore.isLiteMode" class="bottom-right">
|
||||
<div v-if="!authStore.isLiteMode && showKbOriginBadge(kb)" class="bottom-right">
|
||||
<ResourceOriginBadge :variant="kbOriginVariant(kb)" :creator-name="kb.creator_name" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -604,15 +604,6 @@
|
||||
</t-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-right">
|
||||
<t-tooltip :content="shared.org_name" placement="top">
|
||||
<div class="org-source">
|
||||
<img src="@/assets/img/organization-green.svg" class="org-source-icon" alt=""
|
||||
aria-hidden="true" />
|
||||
<span>{{ shared.org_name }}</span>
|
||||
</div>
|
||||
</t-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -783,6 +774,7 @@ import KnowledgeBaseEditorModal from './KnowledgeBaseEditorModal.vue'
|
||||
import ShareKnowledgeBaseDialog from '@/components/ShareKnowledgeBaseDialog.vue'
|
||||
import ListSpaceSidebar from '@/components/ListSpaceSidebar.vue'
|
||||
import ResourceOriginBadge from '@/components/ResourceOriginBadge.vue'
|
||||
import { shouldShowResourceOriginBadge } from '@/utils/card-list-badge'
|
||||
import ContextualGuide from '@/components/ContextualGuide.vue'
|
||||
import { isContextualGuideDone, markContextualGuideDone } from '@/config/contextualGuides'
|
||||
import { useTenantModelReadiness } from '@/composables/useTenantModelReadiness'
|
||||
@@ -1361,6 +1353,15 @@ function kbOriginVariant(kb: { creator_id?: string }): 'mine' | 'creator' {
|
||||
return isMyKb(kb) ? 'mine' : 'creator'
|
||||
}
|
||||
|
||||
function showKbOriginBadge(kb: { creator_id?: string; creator_name?: string }): boolean {
|
||||
return shouldShowResourceOriginBadge({
|
||||
section: kbSectionOf(kb),
|
||||
variant: kbOriginVariant(kb),
|
||||
creatorName: kb.creator_name,
|
||||
showSectionHeaders: showShareGroupHeaders.value,
|
||||
})
|
||||
}
|
||||
|
||||
// 通过 ID 处理设置(用于全部 Tab 下的知识库)
|
||||
const handleSettingsById = (id: string) => {
|
||||
goSettings(id)
|
||||
|
||||
Reference in New Issue
Block a user