diff --git a/frontend/pages/projects/_id/image-captioning/index.vue b/frontend/pages/projects/_id/image-captioning/index.vue index 83000f3b..98dd870e 100644 --- a/frontend/pages/projects/_id/image-captioning/index.vue +++ b/frontend/pages/projects/_id/image-captioning/index.vue @@ -138,9 +138,10 @@ export default { watch: { '$route.query': '$fetch', - enableAutoLabeling(val) { - if (val) { - this.list(this.image.id) + async enableAutoLabeling(val) { + if (val && !this.image.isConfirmed) { + await this.autoLabel(this.image.id) + await this.list(this.image.id) } } }, diff --git a/frontend/pages/projects/_id/image-classification/index.vue b/frontend/pages/projects/_id/image-classification/index.vue index 5b256340..57641289 100644 --- a/frontend/pages/projects/_id/image-classification/index.vue +++ b/frontend/pages/projects/_id/image-classification/index.vue @@ -141,9 +141,10 @@ export default { watch: { '$route.query': '$fetch', - enableAutoLabeling(val) { - if (val) { - this.list(this.image.id) + async enableAutoLabeling(val) { + if (val && !this.image.isConfirmed) { + await this.autoLabel(this.image.id) + await this.list(this.image.id) } } }, diff --git a/frontend/pages/projects/_id/intent-detection-and-slot-filling/index.vue b/frontend/pages/projects/_id/intent-detection-and-slot-filling/index.vue index fb2de8af..98be2310 100644 --- a/frontend/pages/projects/_id/intent-detection-and-slot-filling/index.vue +++ b/frontend/pages/projects/_id/intent-detection-and-slot-filling/index.vue @@ -120,7 +120,14 @@ export default { }, watch: { - '$route.query': '$fetch' + '$route.query': '$fetch', + async enableAutoLabeling(val) { + if (val && !this.doc.isConfirmed) { + await this.autoLabel(this.doc.id) + await this.listSpan(this.doc.id) + await this.listCategory(this.doc.id) + } + } }, async created() { diff --git a/frontend/pages/projects/_id/object-detection/index.vue b/frontend/pages/projects/_id/object-detection/index.vue index 732149cc..4a4cd057 100644 --- a/frontend/pages/projects/_id/object-detection/index.vue +++ b/frontend/pages/projects/_id/object-detection/index.vue @@ -201,9 +201,10 @@ export default { watch: { '$route.query': '$fetch', - enableAutoLabeling(val) { - if (val) { - this.list(this.image.id) + async enableAutoLabeling(val) { + if (val && !this.image.isConfirmed) { + await this.autoLabel(this.image.id) + await this.list(this.image.id) } }, diff --git a/frontend/pages/projects/_id/segmentation/index.vue b/frontend/pages/projects/_id/segmentation/index.vue index 47c61bf5..eb26cca6 100644 --- a/frontend/pages/projects/_id/segmentation/index.vue +++ b/frontend/pages/projects/_id/segmentation/index.vue @@ -202,9 +202,10 @@ export default { watch: { '$route.query': '$fetch', - enableAutoLabeling(val) { - if (val) { - this.list(this.image.id) + async enableAutoLabeling(val) { + if (val && !this.image.isConfirmed) { + await this.autoLabel(this.image.id) + await this.list(this.image.id) } }, diff --git a/frontend/pages/projects/_id/sequence-labeling/index.vue b/frontend/pages/projects/_id/sequence-labeling/index.vue index 8b069bb9..15cad39e 100644 --- a/frontend/pages/projects/_id/sequence-labeling/index.vue +++ b/frontend/pages/projects/_id/sequence-labeling/index.vue @@ -193,9 +193,10 @@ export default { watch: { '$route.query': '$fetch', - enableAutoLabeling(val) { - if (val) { - this.list(this.doc.id) + async enableAutoLabeling(val) { + if (val && !this.doc.isConfirmed) { + await this.autoLabel(this.doc.id) + await this.list(this.doc.id) } } }, diff --git a/frontend/pages/projects/_id/sequence-to-sequence/index.vue b/frontend/pages/projects/_id/sequence-to-sequence/index.vue index d250e77f..37bee020 100644 --- a/frontend/pages/projects/_id/sequence-to-sequence/index.vue +++ b/frontend/pages/projects/_id/sequence-to-sequence/index.vue @@ -96,9 +96,10 @@ export default { watch: { '$route.query': '$fetch', - enableAutoLabeling(val) { - if (val) { - this.list(this.doc.id) + async enableAutoLabeling(val) { + if (val && !this.doc.isConfirmed) { + await this.autoLabel(this.doc.id) + await this.list(this.doc.id) } } }, diff --git a/frontend/pages/projects/_id/speech-to-text/index.vue b/frontend/pages/projects/_id/speech-to-text/index.vue index ce893ebb..11ed5205 100644 --- a/frontend/pages/projects/_id/speech-to-text/index.vue +++ b/frontend/pages/projects/_id/speech-to-text/index.vue @@ -102,9 +102,10 @@ export default { watch: { '$route.query': '$fetch', - enableAutoLabeling(val) { - if (val) { - this.list(this.item.id) + async enableAutoLabeling(val) { + if (val && !this.item.isConfirmed) { + await this.autoLabel(this.item.id) + await this.list(this.item.id) } } }, diff --git a/frontend/pages/projects/_id/text-classification/index.vue b/frontend/pages/projects/_id/text-classification/index.vue index b8bd49ed..a382c3ad 100644 --- a/frontend/pages/projects/_id/text-classification/index.vue +++ b/frontend/pages/projects/_id/text-classification/index.vue @@ -109,6 +109,12 @@ export default { } }) watch(query, fetch) + watch(enableAutoLabeling, async (val) => { + if (val && !exampleState.example.isConfirmed) { + await autoLabel(exampleState.example.id) + await getTeacherList(exampleState.example.id) + } + }) return { ...toRefs(labelState),