|
36 | 36 | : t('community.modelCard.tooltips.addNode') |
37 | 37 | }) |
38 | 38 |
|
| 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 | +
|
39 | 50 | // 判断是否应该显示徽章 |
40 | 51 | const shouldShowBadge = computed(() => { |
41 | 52 | if (!props.model?.tags || !Array.isArray(props.model.tags)) { |
|
46 | 57 | const allTags = tagsStore.getDict('tags') || [] |
47 | 58 |
|
48 | 59 | // 查找 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') |
50 | 61 |
|
51 | 62 | if (!rightTopTag) { |
52 | 63 | return false |
|
309 | 320 | <div class="absolute bottom-0 left-0 right-0 p-3 bg-gradient-to-t from-black/90 to-black/0"> |
310 | 321 | <div class="flex items-center gap-2"> |
311 | 322 | <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 | + " |
313 | 329 | :class="tagsStore.getHighestOrderTag(model.tags)?.class || 'model-tag'" |
314 | 330 | >{{ |
315 | 331 | tagsStore.getHighestOrderTag(model.tags)?.label || t('community.modelCard.tags.new') |
|
320 | 336 | <span |
321 | 337 | v-if=" |
322 | 338 | 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 |
324 | 341 | " |
325 | 342 | className="text-xs text-white bg-[#7C3AED] px-1 inline-block h-[18px] rounded" |
326 | 343 | > |
|
0 commit comments