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.

59 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <base-modal
  3. text="Add"
  4. :is-create="true"
  5. >
  6. <template v-slot="slotProps">
  7. <member-addition-form
  8. :add-member="addMember"
  9. :items="items"
  10. :roles="roles"
  11. @close="slotProps.close"
  12. @search-user="searchUser"
  13. />
  14. </template>
  15. </base-modal>
  16. </template>
  17. <script>
  18. import { mapActions, mapGetters } from 'vuex'
  19. import BaseModal from '@/components/molecules/BaseModal'
  20. import MemberAdditionForm from '@/components/organisms/members/MemberAdditionForm'
  21. import UserService from '@/services/user.service'
  22. export default {
  23. components: {
  24. BaseModal,
  25. MemberAdditionForm
  26. },
  27. data() {
  28. return {
  29. items: []
  30. }
  31. },
  32. computed: {
  33. ...mapGetters('roles', ['roles'])
  34. },
  35. created() {
  36. this.getRoleList()
  37. },
  38. methods: {
  39. ...mapActions('members', ['addMember']),
  40. ...mapActions('roles', ['getRoleList']),
  41. searchUser(username) {
  42. UserService.getUserList(username)
  43. .then((response) => {
  44. this.items = response.data
  45. })
  46. .catch((error) => {
  47. alert(error)
  48. })
  49. }
  50. }
  51. }
  52. </script>