diff --git a/frontend/components/tasks/sequenceLabeling/EntityEditor.vue b/frontend/components/tasks/sequenceLabeling/EntityEditor.vue index 3f927544..a00e9e92 100644 --- a/frontend/components/tasks/sequenceLabeling/EntityEditor.vue +++ b/frontend/components/tasks/sequenceLabeling/EntityEditor.vue @@ -49,8 +49,6 @@ - + @@ -77,6 +107,7 @@ export default { project: {}, enableAutoLabeling: false, rtl: false, + selectedLabelIndex: null, } }, @@ -101,15 +132,25 @@ export default { shortKeys() { return Object.fromEntries(this.labels.map(item => [item.id, [item.suffixKey]])) }, + projectId() { return this.$route.params.id }, + doc() { if (_.isEmpty(this.docs) || this.docs.items.length === 0) { return {} } else { return this.docs.items[0] } + }, + + selectedLabel() { + if (Number.isInteger(this.selectedLabelIndex)) { + return this.labels[this.selectedLabelIndex] + } else { + return null + } } }, @@ -178,6 +219,10 @@ export default { await this.$services.example.confirm(this.projectId, this.doc.id) await this.$fetch() }, + + changeSelectedLabel(event) { + this.selectedLabelIndex = this.labels.findIndex((item) => item.suffixKey === event.srcKey) + } } }