-
-
- {{ tag.name }}
-
-
- |
-
-
+
+
+
+ {{ tag.name }}
+
+
+ |
+
+
-
-
-
更多
+
+
+ {{ tag }}
+
+
+
+ + 其他
+
-
diff --git a/src/views/imageCaptioning/image-captioning/components/TagSelectorOld.vue b/src/views/imageCaptioning/image-captioning/components/TagSelectorOld.vue
new file mode 100644
index 0000000..909f082
--- /dev/null
+++ b/src/views/imageCaptioning/image-captioning/components/TagSelectorOld.vue
@@ -0,0 +1,95 @@
+
+
+
+
+ {{ tag.name }}
+
+
+ |
+
+
+
+
+
+ 更多
+
+
+
+
+
+
+
diff --git a/src/views/imageCaptioning/image-captioning/index.vue b/src/views/imageCaptioning/image-captioning/index.vue
index ea3804d..01678a0 100644
--- a/src/views/imageCaptioning/image-captioning/index.vue
+++ b/src/views/imageCaptioning/image-captioning/index.vue
@@ -24,6 +24,7 @@
:visible-tags="visibleTags"
:selected-tag="selectedTag"
@toggle-tag="toggleTag"
+ @new-tag-change="newTagChange"
@toggle-all-tags="toggleAllTags"
/>
@@ -61,6 +62,7 @@
@hand-click="handleHandClick"
@confirm-results="confirmResults"
@toggle-tag="toggleTag"
+ @new-tag-change="newTagChange"
@toggle-all-tags="toggleAllTags"
@file-change="handleFileChange"
@remove-image="removeImage"
@@ -119,6 +121,8 @@ export default {
groupedImageResults: [], // 新增分组数据
remarkInfo: '', // 备注信息
+
+ newTagsList: [], // 新增标签列表
}
},
@@ -140,7 +144,9 @@ export default {
id: item.id,
name: item.name,
}))
- this.visibleTags = this.tags.slice(0, 3)
+ // this.visibleTags = this.tags.slice(0, 3)
+ console.log('this.tags:', this.tags)
+ this.visibleTags = this.tags
} else {
console.error('获取标签列表失败:', res)
this.tags = []
@@ -190,9 +196,16 @@ export default {
const selectedTagIds = this.selectedTag
.map((tag) => tag.id)
.join(',')
- const selectedTagNames = this.selectedTag
+ let selectedTagNames = this.selectedTag
.map((tag) => tag.name)
.join(',')
+
+ let newTagsNames = ''
+ if (this.newTagsList.length > 0) {
+ newTagsNames = this.newTagsList.join(',')
+ selectedTagNames = `${selectedTagNames},${newTagsNames}`
+ }
+
console.log('选中的标签IDs:', selectedTagIds)
console.log('选中的标签名称:', selectedTagNames)
if (this.fileList.length === 0) {
@@ -344,10 +357,14 @@ export default {
}
if (!this.showAllTags) {
- this.updateVisibleTagsInCollapsedState()
+ // this.updateVisibleTagsInCollapsedState()
}
},
+ newTagChange(newTagsList) {
+ this.newTagsList = newTagsList
+ },
+
updateVisibleTagsInCollapsedState() {
const selectedTags = this.selectedTag || []
const defaultTags = this.tags.slice(0, 3)