You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.2 KiB

  1. <template>
  2. <v-tooltip bottom>
  3. <template v-slot:activator="{ on }">
  4. <v-btn
  5. class="text-capitalize ps-1 pe-1"
  6. color="error"
  7. min-width="36"
  8. icon
  9. v-on="on"
  10. @click="dialog=true"
  11. >
  12. <v-icon>
  13. mdi-delete-outline
  14. </v-icon>
  15. </v-btn>
  16. </template>
  17. <span>Clear Annotations</span>
  18. <v-dialog
  19. v-model="dialog"
  20. width="800"
  21. >
  22. <confirm-form
  23. title="Clear annotations"
  24. message="Are you sure you want to delete all annotations?"
  25. :button-true-text="$t('generic.yes')"
  26. :button-false-text="$t('generic.cancel')"
  27. @ok="handleClear();dialog=false"
  28. @cancel="dialog=false"
  29. />
  30. </v-dialog>
  31. </v-tooltip>
  32. </template>
  33. <script>
  34. import { mapActions } from 'vuex'
  35. import ConfirmForm from '@/components/organisms/utils/ConfirmForm'
  36. export default {
  37. components: {
  38. ConfirmForm
  39. },
  40. data() {
  41. return {
  42. dialog: false
  43. }
  44. },
  45. methods: {
  46. ...mapActions('documents', ['clearAnnotations']),
  47. handleClear() {
  48. const projectId = this.$route.params.id
  49. this.clearAnnotations(projectId)
  50. }
  51. }
  52. }
  53. </script>