7
7
<Card >
8
8
<p slot =" title" >
9
9
<Icon type =" person" ></Icon >
10
- 个人信息
10
+ {{'Personal Information'|l}}
11
11
</p >
12
12
<div >
13
13
<Form
39
39
</div >
40
40
</div >
41
41
</FormItem >
42
- <FormItem label =" 公司: " >
42
+ <FormItem label =" {{'Company'|l}}: " >
43
43
<span >{{ userForm.company }}</span >
44
44
</FormItem >
45
- <FormItem label =" 部门: " >
45
+ <FormItem label =" {{'Department'|l}}: " >
46
46
<span >{{ userForm.department }}</span >
47
47
</FormItem >
48
- <FormItem label =" 登录密码: " >
49
- <Button type =" text" size =" small" @click =" showEditPassword" >修改密码 </Button >
48
+ <FormItem label =" {{'Password'|l}}: " >
49
+ <Button type =" text" size =" small" @click =" showEditPassword" >{{'Change Password'|l}} </Button >
50
50
</FormItem >
51
51
<div >
52
- <Button type =" text" style =" width : 100px ;" @click =" cancelEditUserInfor" >取消 </Button >
53
- <Button type =" primary" style =" width : 100px ;" :loading =" save_loading" @click =" saveEdit" >保存 </Button >
52
+ <Button type =" text" style =" width : 100px ;" @click =" cancelEditUserInfor" >{{'Cancel'|l}} </Button >
53
+ <Button type =" primary" style =" width : 100px ;" :loading =" save_loading" @click =" saveEdit" >{{'Save'|l}} </Button >
54
54
</div >
55
55
</Form >
56
56
</div >
57
57
</Card >
58
58
<Modal v-model =" editPasswordModal" :closable =' false' :mask-closable =false :width =" 500" >
59
- <h3 slot =" header" style =" color :#2D8CF0 " >修改密码 </h3 >
59
+ <h3 slot =" header" style =" color :#2D8CF0 " >{{'Change Password'|l}} </h3 >
60
60
<Form ref =" editPasswordForm" :model =" editPasswordForm" :label-width =" 100" label-position =" right" :rules =" passwordValidate" >
61
- <FormItem label =" 原密码 " prop =" oldPass" :error =" oldPassError" >
62
- <Input v-model =" editPasswordForm.oldPass" placeholder =" 请输入现在使用的密码 " ></Input >
61
+ <FormItem label =" OldPassword " prop =" oldPass" :error =" oldPassError" >
62
+ <Input v-model =" editPasswordForm.oldPass" placeholder =" {{'Please enter the password you are using now'|l}} " ></Input >
63
63
</FormItem >
64
- <FormItem label =" 新密码 " prop =" newPass" >
65
- <Input v-model =" editPasswordForm.newPass" placeholder =" 请输入新密码,至少6位字符 " ></Input >
64
+ <FormItem label =" NewPassword " prop =" newPass" >
65
+ <Input v-model =" editPasswordForm.newPass" placeholder =" {{'Please enter a new password, at least 6 characters'|l}} " ></Input >
66
66
</FormItem >
67
- <FormItem label =" 确认新密码 " prop =" rePass" >
68
- <Input v-model =" editPasswordForm.rePass" placeholder =" 请再次输入新密码 " ></Input >
67
+ <FormItem label =" ConfirmNewPassword " prop =" rePass" >
68
+ <Input v-model =" editPasswordForm.rePass" placeholder =" {{'Please re-enter the new password'|l}} " ></Input >
69
69
</FormItem >
70
70
</Form >
71
71
<div slot =" footer" >
72
- <Button type =" text" @click =" cancelEditPass" >取消 </Button >
73
- <Button type =" primary" :loading =" savePassLoading" @click =" saveEditPass" >保存 </Button >
72
+ <Button type =" text" @click =" cancelEditPass" >{{'Cancel'|l}} </Button >
73
+ <Button type =" primary" :loading =" savePassLoading" @click =" saveEditPass" >{{'Save'|l}} </Button >
74
74
</div >
75
75
</Modal >
76
76
</div >
77
77
</template >
78
78
79
79
<script >
80
+ import util from ' @/libs/util.js' ;
80
81
export default {
81
82
name: ' ownspace_index' ,
82
83
data () {
83
84
const validePhone = (rule , value , callback ) => {
84
85
var re = / ^ 1[0-9 ] {10} $ / ;
85
86
if (! re .test (value)) {
86
- callback (new Error (' 请输入正确格式的手机号 ' ));
87
+ callback (new Error (util . l ( ' Please enter the phone number in the correct format ' ) ));
87
88
} else {
88
89
callback ();
89
90
}
90
91
};
91
92
const valideRePassword = (rule , value , callback ) => {
92
93
if (value !== this .editPasswordForm .newPass ) {
93
- callback (new Error (' 两次输入密码不一致 ' ));
94
+ callback (new Error (util . l ( ' New password does not match with old password ' ) ));
94
95
} else {
95
96
callback ();
96
97
}
@@ -102,24 +103,24 @@ export default {
102
103
company: ' ' ,
103
104
department: ' '
104
105
},
105
- uid: ' ' , // 登录用户的userId
106
- securityCode: ' ' , // 验证码
107
- phoneHasChanged: false , // 是否编辑了手机
106
+ uid: ' ' ,
107
+ securityCode: ' ' ,
108
+ phoneHasChanged: false ,
108
109
save_loading: false ,
109
- identifyError: ' ' , // 验证码错误
110
- editPasswordModal: false , // 修改密码模态框显示
110
+ identifyError: ' ' ,
111
+ editPasswordModal: false ,
111
112
savePassLoading: false ,
112
113
oldPassError: ' ' ,
113
- identifyCodeRight: false , // 验证码是否正确
114
- hasGetIdentifyCode: false , // 是否点了获取验证码
115
- canGetIdentifyCode: false , // 是否可点获取验证码
114
+ identifyCodeRight: false ,
115
+ hasGetIdentifyCode: false ,
116
+ canGetIdentifyCode: false ,
116
117
checkIdentifyCodeLoading: false ,
117
118
inforValidate: {
118
119
name: [
119
- { required: true , message: ' 请输入姓名 ' , trigger: ' blur' }
120
+ { required: true , message: util . l ( ' Please type in your name ' ) , trigger: ' blur' }
120
121
],
121
122
cellphone: [
122
- { required: true , message: ' 请输入手机号码 ' },
123
+ { required: true , message: util . l ( ' Please enter the phone number ' ) },
123
124
{ validator: validePhone }
124
125
]
125
126
},
@@ -130,21 +131,21 @@ export default {
130
131
},
131
132
passwordValidate: {
132
133
oldPass: [
133
- { required: true , message: ' 请输入原密码 ' , trigger: ' blur' }
134
+ { required: true , message: util . l ( ' Please enter the original password ' ) , trigger: ' blur' }
134
135
],
135
136
newPass: [
136
- { required: true , message: ' 请输入新密码 ' , trigger: ' blur' },
137
- { min: 6 , message: ' 请至少输入6个字符 ' , trigger: ' blur' },
138
- { max: 32 , message: ' 最多输入32个字符 ' , trigger: ' blur' }
137
+ { required: true , message: util . l ( ' Please enter the new psasword ' ) , trigger: ' blur' },
138
+ { min: 6 , message: util . l ( ' Please enter at least 6 characters ' ) , trigger: ' blur' },
139
+ { max: 32 , message: util . l ( ' Please enter maximum 32 characters ' ) , trigger: ' blur' }
139
140
],
140
141
rePass: [
141
- { required: true , message: ' 请再次输入新密码 ' , trigger: ' blur' },
142
+ { required: true , message: util . l ( ' Please re-enter the new password ' ) , trigger: ' blur' },
142
143
{ validator: valideRePassword, trigger: ' blur' }
143
144
]
144
145
},
145
- inputCodeVisible: false , // 显示填写验证码box
146
+ inputCodeVisible: false ,
146
147
initPhone: ' ' ,
147
- gettingIdentifyCodeBtnContent: ' 获取验证码 ' // “获取验证码”按钮的文字
148
+ gettingIdentifyCodeBtnContent: util . l ( ' Get verification code ' )
148
149
};
149
150
},
150
151
methods: {
@@ -165,7 +166,6 @@ export default {
165
166
}
166
167
}, 1000 );
167
168
this .inputCodeVisible = true ;
168
- // you can write ajax request here
169
169
}
170
170
});
171
171
},
@@ -188,15 +188,15 @@ export default {
188
188
saveEdit () {
189
189
this .$refs [' userForm' ].validate ((valid ) => {
190
190
if (valid) {
191
- if (this .phoneHasChanged && this .userForm .cellphone !== this .initPhone ) { // 手机号码修改过了而且修改之后的手机号和原来的不一样
192
- if (this .hasGetIdentifyCode ) { // 判断是否点了获取验证码
193
- if (this .identifyCodeRight ) { // 判断验证码是否正确
191
+ if (this .phoneHasChanged && this .userForm .cellphone !== this .initPhone ) {
192
+ if (this .hasGetIdentifyCode ) {
193
+ if (this .identifyCodeRight ) {
194
194
this .saveInfoAjax ();
195
195
} else {
196
- this .$Message .error (' 验证码错误,请重新输入 ' );
196
+ this .$Message .error (util . l ( ' Verification code error, please re-enter ' ) );
197
197
}
198
198
} else {
199
- this .$Message .warning (' 请先点击获取验证码 ' );
199
+ this .$Message .warning (util . l ( ' Please click to get the verification code ' ) );
200
200
}
201
201
} else {
202
202
this .saveInfoAjax ();
@@ -211,16 +211,15 @@ export default {
211
211
this .$refs [' editPasswordForm' ].validate ((valid ) => {
212
212
if (valid) {
213
213
this .savePassLoading = true ;
214
- // you can write ajax request here
215
214
}
216
215
});
217
216
},
218
217
init () {
219
218
this .userForm .name = ' Lison' ;
220
219
this .userForm .cellphone = ' 17712345678' ;
221
220
this .initPhone = ' 17712345678' ;
222
- this .userForm .company = ' TalkingData ' ;
223
- this .userForm .department = ' 可视化部门 ' ;
221
+ this .userForm .company = ' AbpProjectName ' ;
222
+ this .userForm .department = ' IT ' ;
224
223
},
225
224
cancelInputCodeBox () {
226
225
this .inputCodeVisible = false ;
@@ -230,10 +229,10 @@ export default {
230
229
let vm = this ;
231
230
vm .checkIdentifyCodeLoading = true ;
232
231
if (this .securityCode .length === 0 ) {
233
- this .$Message .error (' 请填写短信验证码 ' );
232
+ this .$Message .error (util . l ( ' Please fill in SMS verification code ' ) );
234
233
} else {
235
234
setTimeout (() => {
236
- this .$Message .success (' 验证码正确 ' );
235
+ this .$Message .success (util . l ( ' The verification code is correct ' ) );
237
236
this .inputCodeVisible = false ;
238
237
this .checkIdentifyCodeLoading = false ;
239
238
}, 1000 );
@@ -247,7 +246,7 @@ export default {
247
246
saveInfoAjax () {
248
247
this .save_loading = true ;
249
248
setTimeout (() => {
250
- this .$Message .success (' 保存成功 ' );
249
+ this .$Message .success (util . l ( ' SavedSuccessfully ' ) );
251
250
this .save_loading = false ;
252
251
}, 1000 );
253
252
}
0 commit comments