/
changeUserProfileForm.vue
99 lines (88 loc) · 2.34 KB
/
changeUserProfileForm.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template>
<v-dialog
:value="isOpen"
@input="closeDialog()"
fullscreen
hide-overlay
transition="dialog-bottom-transition"
scrollable
dark
>
<UserProfileForm
:updateProfile="updateProfile"
:user="user"
@cancel="closeDialog()"/>
<!-- 登録中 -->
<v-dialog v-model="isSending" persistent width="300">
<v-card color="primary" dark>
<v-card-text>
更新中です...
<v-progress-linear
indeterminate
color="white"
class="mb-0"
/>
</v-card-text>
</v-card>
</v-dialog>
<!-- 登録失敗 -->
<v-dialog :value="isSendFailed" @input="toStandby()" width="500">
<v-card color="error" dark>
<v-card-text>
エラーが発生しました<br>
恐れ入りますが時間を置いてから再度やり直してください
</v-card-text>
<v-card-actions>
<v-spacer/>
<v-btn
@click="toStandby()"
color="red lighten-2"
>OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-snackbar
:value="isSendSuccess"
@input="toStandby()"
:timeout="3000"
color="success"
top>
アカウント情報の更新に成功しました
</v-snackbar>
</v-dialog>
</template>
<script lang="ts">
import { IUser } from '@/boundary/userApplicationService/InOutType'
import UserProfileForm from '@/components/organisms/userProfileForm.vue'
import {
closeDialog,
toStandby,
updateProfile,
} from '@/store/containers/changeUserProfileForm/action'
import selector from '@/store/containers/changeUserProfileForm/selector'
import authSelector from '@/store/middleware/auth/selector'
import { mapComputed } from '@/submodules/store'
import { Component, Vue } from 'vue-property-decorator'
@Component({
components: {
UserProfileForm,
},
computed: mapComputed(selector, authSelector),
})
export default class ChangeUserProfileFormContainer extends Vue {
public updateProfile(params: IUser) {
return this.$store.dispatch(updateProfile({ user: params }))
}
public toStandby() {
return this.$store.dispatch(toStandby())
}
public closeDialog() {
return this.$store.dispatch(closeDialog())
}
}
</script>
<style module>
.user-icon-img {
cursor: pointer;
}
</style>