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.0 KiB

5 years ago
5 years ago
5 years ago
  1. <template>
  2. <member-list
  3. :headers="headers"
  4. :members="items"
  5. :selected="selected"
  6. :loading="loading"
  7. @update-selected="updateSelected"
  8. @update-role="updateRole"
  9. />
  10. </template>
  11. <script>
  12. import { mapState, mapActions, mapMutations } from 'vuex'
  13. import MemberList from '@/components/organisms/MemberList'
  14. export default {
  15. components: {
  16. MemberList
  17. },
  18. data() {
  19. return {
  20. headers: [
  21. {
  22. text: 'Name',
  23. align: 'left',
  24. sortable: false,
  25. value: 'username'
  26. },
  27. {
  28. text: 'Role',
  29. value: 'role'
  30. }
  31. ]
  32. }
  33. },
  34. computed: {
  35. ...mapState('members', ['items', 'selected', 'loading'])
  36. },
  37. created() {
  38. this.getMemberList()
  39. },
  40. methods: {
  41. ...mapActions('members', ['getMemberList', 'updateMemberRole']),
  42. ...mapMutations('members', ['updateSelected']),
  43. updateRole(payload) {
  44. const data = {
  45. projectId: this.$route.params.id,
  46. ...payload
  47. }
  48. this.updateMemberRole(data)
  49. }
  50. }
  51. }
  52. </script>