|
@@ -7,6 +7,7 @@
|
|
|
|
|
|
<div class="buttons">
|
|
|
<template v-if="!immutable">
|
|
|
+ <img v-if="confirmationButton" alt="confirm" src="@/assets/icons/check.svg" @click="confirmSelf">
|
|
|
<img alt="delete" src="@/assets/icons/trash.svg" @click="deleteSelf">
|
|
|
</template>
|
|
|
</div>
|
|
@@ -21,8 +22,11 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: "annotation-box",
|
|
|
- props: ['type', 'image', 'position', 'socket', 'immutable', 'boxUrl'],
|
|
|
+ props: ['type', 'image', 'position', 'socket', 'boxUrl'],
|
|
|
computed: {
|
|
|
+ immutable: function () {
|
|
|
+ return !this.type;
|
|
|
+ },
|
|
|
backgroundColor: function () {
|
|
|
switch (this.type) {
|
|
|
case 'user':
|
|
@@ -33,6 +37,9 @@ export default {
|
|
|
return 'rgba(255, 255, 255, 0.3)';
|
|
|
}
|
|
|
},
|
|
|
+ confirmationButton: function () {
|
|
|
+ return this.type === 'pipeline';
|
|
|
+ },
|
|
|
style: function () {
|
|
|
const left = this.image.left;
|
|
|
const top = this.image.top;
|
|
@@ -49,6 +56,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ confirmSelf: function () {
|
|
|
+ this.updateSelf(this.position);
|
|
|
+ },
|
|
|
deleteSelf: function () {
|
|
|
this.socket.post(this.boxUrl, {delete: true, id: this.id});
|
|
|
},
|