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.

53 lines
991 B

  1. <template>
  2. <document-list
  3. :headers="headers"
  4. :docs="items"
  5. :selected="selected"
  6. :loading="loading"
  7. @update-selected="updateSelected"
  8. @update-doc="handleUpdateDoc"
  9. />
  10. </template>
  11. <script>
  12. import { mapState, mapActions, mapMutations } from 'vuex'
  13. import DocumentList from '@/components/organisms/DocumentList'
  14. export default {
  15. components: {
  16. DocumentList
  17. },
  18. data() {
  19. return {
  20. headers: [
  21. {
  22. text: 'Text',
  23. align: 'left',
  24. value: 'text'
  25. }
  26. ]
  27. }
  28. },
  29. computed: {
  30. ...mapState('documents', ['items', 'selected', 'loading'])
  31. },
  32. created() {
  33. this.getDocumentList()
  34. },
  35. methods: {
  36. ...mapActions('documents', ['getDocumentList', 'updateDocument']),
  37. ...mapMutations('documents', ['updateSelected']),
  38. handleUpdateDoc(payload) {
  39. const data = {
  40. projectId: this.$route.params.id,
  41. ...payload
  42. }
  43. this.updateDocument(data)
  44. }
  45. }
  46. }
  47. </script>