diff --git a/frontend/components/tasks/sequenceLabeling/EntityEditor.vue b/frontend/components/tasks/sequenceLabeling/EntityEditor.vue
index 5eb1be43..321704ed 100644
--- a/frontend/components/tasks/sequenceLabeling/EntityEditor.vue
+++ b/frontend/components/tasks/sequenceLabeling/EntityEditor.vue
@@ -29,6 +29,34 @@
max-height="400"
class="overflow-y-auto"
>
+
+
+
+
+ {{ data.item.text }}
+
+
+
+
label.suffixKey !== null)
+ },
+ currentLabel(): any {
+ if (this.entity) {
+ const label = this.entityLabels.find((label: any) => label.id === this.entity!.label)
+ return label
+ } else {
+ return null
+ }
}
},
@@ -134,7 +171,7 @@ export default Vue.extend({
},
setEntity(entityId: number) {
- this.entityId = entityId
+ this.entity = this.entities.find((entity: any) => entity.id === entityId)
},
showEntityLabelMenu(e: any) {
@@ -158,7 +195,7 @@ export default Vue.extend({
},
addOrUpdateEntity(labelId: number) {
- if (this.entityId !== -1) {
+ if (this.entity) {
this.updateEntity(labelId)
} else {
this.addEntity(labelId)
@@ -166,7 +203,7 @@ export default Vue.extend({
this.showMenu = false
this.startOffset = 0
this.endOffset = 0
- this.entityId = -1
+ this.entity = null
},
addEntity(labelId: number) {
@@ -174,11 +211,13 @@ export default Vue.extend({
},
updateEntity(labelId: number) {
- this.$emit('click:entity', this.entityId, labelId)
+ this.$emit('click:entity', this.entity!.id, labelId)
},
deleteEntity(entity: any) {
this.$emit('contextmenu:entity', entity.id)
+ this.entity = null
+ this.showMenu = false
},
updateRelation() {