|
@@ -28,8 +28,8 @@
|
|
|
@interaction="$emit('interaction', $event)"
|
|
|
@labelSelector="$emit('labelSelector', $event)"
|
|
|
@labelBox="labelBox"
|
|
|
- @removeBox="removeBox"
|
|
|
- @confirmBox="confirmBox"
|
|
|
+ @remove="$emit('remove', $event)"
|
|
|
+ @confirm="$emit('confirm', $event)"
|
|
|
@updateBox="updateBox"
|
|
|
@zoom="zoomBox(index, $event)"/>
|
|
|
|
|
@@ -173,24 +173,19 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (this.interaction === 'label-box') {
|
|
|
- this.$root.socket.post(`/data/${this.file.identifier}/results`, {
|
|
|
- type: 'labeled-image',
|
|
|
- label: this.label.identifier
|
|
|
- });
|
|
|
+ this.$emit("labelImage",
|
|
|
+ this.file.identifier,
|
|
|
+ this.label.identifier)
|
|
|
}
|
|
|
if (this.interaction === 'confirm-box') {
|
|
|
- if (this.imageLabelResult) {
|
|
|
- this.$root.socket.post(`/results/${this.imageLabelResult.identifier}/confirm`, {
|
|
|
- confirm: true
|
|
|
- });
|
|
|
- }
|
|
|
+ if (this.imageLabelResult)
|
|
|
+ this.$emit("confirmImage", this.imageLabelResult.identifier);
|
|
|
+
|
|
|
}
|
|
|
if (this.interaction === 'remove-box') {
|
|
|
- if (this.imageLabelResult) {
|
|
|
- this.$root.socket.post(`/results/${this.imageLabelResult.identifier}/remove`, {
|
|
|
- remove: true
|
|
|
- });
|
|
|
- }
|
|
|
+ if (this.imageLabelResult)
|
|
|
+ this.$emit("remove", this.imageLabelResult.identifier);
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
track: function (event) {
|
|
@@ -216,7 +211,7 @@ export default {
|
|
|
|
|
|
if (this.interaction === 'estimate-box'){
|
|
|
const coordinates = this.getEventCoordinates(event);
|
|
|
- this.$root.socket.post(`/data/${this.file.identifier}/estimate`, coordinates);
|
|
|
+ this.$emit("estimateBox", this.file.identifier, coordinates);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -226,10 +221,7 @@ export default {
|
|
|
this.callback(this.current);
|
|
|
else
|
|
|
// TODO then / error
|
|
|
- this.$root.socket.post(`/data/${this.file.identifier}/results`, {
|
|
|
- type: 'bounding-box',
|
|
|
- data: this.current
|
|
|
- });
|
|
|
+ this.$emit("newBox", this.file.identifier, this.current);
|
|
|
}
|
|
|
|
|
|
this.callback = false;
|
|
@@ -306,21 +298,19 @@ export default {
|
|
|
this.zoomed = index;
|
|
|
this.$emit('zoom', this.boundingBoxes[index].data);
|
|
|
},
|
|
|
+
|
|
|
prevZoom: function () {
|
|
|
this.zoomBox(this.zoomed - 1);
|
|
|
},
|
|
|
+
|
|
|
nextZoom: function () {
|
|
|
this.zoomBox(this.zoomed + 1);
|
|
|
},
|
|
|
+
|
|
|
labelBox: function (box_id, label_id) {
|
|
|
this.$emit('labelBox', box_id, label_id);
|
|
|
},
|
|
|
- removeBox: function (box_id) {
|
|
|
- this.$emit('removeBox', box_id);
|
|
|
- },
|
|
|
- confirmBox: function (box_id) {
|
|
|
- this.$emit('confirmBox', box_id);
|
|
|
- },
|
|
|
+
|
|
|
updateBox: function (box_id, data) {
|
|
|
this.$emit('updateBox', box_id, data);
|
|
|
},
|