Skip to content

Commit 2008cb9

Browse files
committed
fix
1 parent 4704dfb commit 2008cb9

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

src/components/community/modules/ModelCard.vue

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@
3636
: t('community.modelCard.tooltips.addNode')
3737
})
3838
39+
// 是否存在 position 为 'item_right_top' 的匹配标签
40+
const hasRightTopPositionTag = computed(() => {
41+
if (!props.model?.tags || !Array.isArray(props.model.tags)) {
42+
return false
43+
}
44+
const allTags = tagsStore.getDict('tags') || []
45+
return allTags.some(
46+
(tag: any) => props.model.tags.includes(tag.id) && tag.position === 'item_right_top'
47+
)
48+
})
49+
3950
// 判断是否应该显示徽章
4051
const shouldShowBadge = computed(() => {
4152
if (!props.model?.tags || !Array.isArray(props.model.tags)) {
@@ -46,7 +57,7 @@
4657
const allTags = tagsStore.getDict('tags') || []
4758
4859
// 查找 class 为 'item_right_top' 的标签(或者使用其他字段如 type)
49-
const rightTopTag = allTags.find((tag: any) => tag.class === 'item_right_top')
60+
const rightTopTag = allTags.find((tag: any) => tag.position === 'item_right_top')
5061
5162
if (!rightTopTag) {
5263
return false
@@ -309,7 +320,12 @@
309320
<div class="absolute bottom-0 left-0 right-0 p-3 bg-gradient-to-t from-black/90 to-black/0">
310321
<div class="flex items-center gap-2">
311322
<span
312-
v-if="model.tags && model.tags.length > 0 && tagsStore.getHighestOrderTag(model.tags)"
323+
v-if="
324+
model.tags &&
325+
model.tags.length > 0 &&
326+
tagsStore.getHighestOrderTag(model.tags) &&
327+
tagsStore.getHighestOrderTag(model.tags)?.position !== 'item_right_top'
328+
"
313329
:class="tagsStore.getHighestOrderTag(model.tags)?.class || 'model-tag'"
314330
>{{
315331
tagsStore.getHighestOrderTag(model.tags)?.label || t('community.modelCard.tags.new')
@@ -320,7 +336,8 @@
320336
<span
321337
v-if="
322338
model.type === 'Workflow' &&
323-
model.versions.filter((version: any) => version.draft_id).length > 0
339+
model.versions.filter((version: any) => version.draft_id).length > 0 &&
340+
!hasRightTopPositionTag
324341
"
325342
className="text-xs text-white bg-[#7C3AED] px-1 inline-block h-[18px] rounded"
326343
>

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.53
1+
1.2.54

0 commit comments

Comments
 (0)