Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/components/community/modules/ModelCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
: t('community.modelCard.tooltips.addNode')
})

// 判断是否应该显示徽章
const shouldShowBadge = computed(() => {
if (!props.model?.tags || !Array.isArray(props.model.tags)) {
return false
}

// 获取所有标签数据
const allTags = tagsStore.getDict('tags') || []

// 查找 class 为 'item_right_top' 的标签(或者使用其他字段如 type)
const rightTopTag = allTags.find((tag: any) => tag.class === 'item_right_top')

if (!rightTopTag) {
return false
}

// 检查 model.tags 是否包含该标签的 id
return props.model.tags.includes(rightTopTag.id)
})

const handleImageLoad = (e: Event) => {
emit('image-load', e)
}
Expand Down Expand Up @@ -225,7 +245,7 @@
<div v-if="!props.imageLoaded" class="absolute inset-0 flex items-center justify-center">
<vDefaultPic />
</div>
<div v-if="model.tags && model.tags.includes(10005)" class="absolute right-1 -top-1">
<div v-if="shouldShowBadge" class="absolute right-1 -top-1">
<svg
width="48"
height="49"
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.52
1.2.53