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.

69 lines
1.6 KiB

  1. <template>
  2. <div>
  3. <action-menu
  4. :items="menuItems"
  5. :text="$t('dataset.actions')"
  6. @upload="importDialog=true"
  7. @download="exportDialog=true"
  8. />
  9. <v-dialog
  10. v-model="importDialog"
  11. width="800"
  12. >
  13. <document-upload-form
  14. :upload-document="uploadDocument"
  15. :formats="getImportFormat"
  16. @close="importDialog=false"
  17. />
  18. </v-dialog>
  19. <v-dialog
  20. v-model="exportDialog"
  21. width="800"
  22. >
  23. <document-export-form
  24. :export-document="exportDocument"
  25. :formats="getExportFormat"
  26. @close="exportDialog=false"
  27. />
  28. </v-dialog>
  29. </div>
  30. </template>
  31. <script>
  32. import { mapActions, mapGetters } from 'vuex'
  33. import ActionMenu from '@/components/molecules/ActionMenu'
  34. import DocumentUploadForm from '@/components/organisms/documents/DocumentUploadForm'
  35. import DocumentExportForm from '@/components/organisms/documents/DocumentExportForm'
  36. export default {
  37. components: {
  38. ActionMenu,
  39. DocumentUploadForm,
  40. DocumentExportForm
  41. },
  42. data() {
  43. return {
  44. importDialog: false,
  45. exportDialog: false,
  46. menuItems: [
  47. { title: this.$t('dataset.importDataset'), icon: 'mdi-upload', event: 'upload' },
  48. { title: this.$t('dataset.exportDataset'), icon: 'mdi-download', event: 'download' }
  49. ]
  50. }
  51. },
  52. computed: {
  53. ...mapGetters('projects', ['getImportFormat', 'getExportFormat'])
  54. },
  55. created() {
  56. this.setCurrentProject(this.$route.params.id)
  57. },
  58. methods: {
  59. ...mapActions('documents', ['uploadDocument', 'exportDocument']),
  60. ...mapActions('projects', ['setCurrentProject'])
  61. }
  62. }
  63. </script>