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.

64 lines
1.6 KiB

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