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.

61 lines
1.4 KiB

  1. <template>
  2. <div>
  3. <v-card
  4. v-if="currentDoc"
  5. class="title mb-5"
  6. >
  7. <v-card-text class="title">
  8. {{ currentDoc.text }}
  9. </v-card-text>
  10. </v-card>
  11. <seq2seq-box
  12. v-if="currentDoc"
  13. :text="currentDoc.text"
  14. :annotations="currentDoc.annotations"
  15. :delete-annotation="_deleteAnnotation"
  16. :update-annotation="_updateAnnotation"
  17. :create-annotation="_createAnnotation"
  18. />
  19. </div>
  20. </template>
  21. <script>
  22. import { mapActions, mapGetters } from 'vuex'
  23. import Seq2seqBox from '~/components/organisms/annotation/Seq2seqBox'
  24. export default {
  25. components: {
  26. Seq2seqBox
  27. },
  28. computed: {
  29. ...mapGetters('documents', ['currentDoc'])
  30. },
  31. methods: {
  32. ...mapActions('documents', ['getDocumentList', 'deleteAnnotation', 'updateAnnotation', 'addAnnotation']),
  33. _deleteAnnotation(annotationId) {
  34. const payload = {
  35. annotationId,
  36. projectId: this.$route.params.id
  37. }
  38. this.deleteAnnotation(payload)
  39. },
  40. _updateAnnotation(annotationId, text) {
  41. const payload = {
  42. annotationId,
  43. text: text,
  44. projectId: this.$route.params.id
  45. }
  46. this.updateAnnotation(payload)
  47. },
  48. _createAnnotation(text) {
  49. const payload = {
  50. text,
  51. projectId: this.$route.params.id
  52. }
  53. this.addAnnotation(payload)
  54. }
  55. }
  56. }
  57. </script>