define(function (require) { return function (context) { var $dlg, $form, $comb; return { xtype: 'dialog', dialogId: 'updatePwd', title: '修改密码', maximizable: false, $target: $('body'), width: 620, height: 400, onOpen: function () { $dlg = $(this); }, center: { items: { xtype: 'formgroup', onRender: function () { $form = $(this); }, items: [ [ {name: 'oldPwd', label: '原始密码', span: 2, xtype: 'passwordbox'}, {name: 'newPwd', label: '新密码', span: 2, xtype: 'passwordbox'}, {name: 'rePwd', label: '确认密码', span: 2, xtype: 'passwordbox'}, ]] } }, buttons: [ { text: "提交", iconCls: "fa fa-save", onClick: function () { $.yvan.ajax({ url: api('/account/resetPwd'), method: 'post', data: $form.formGet(), success: function (data) { if (data.success === true) { $dlg.dialog('close'); $.yvan.msg(data.msg, function () { top.window.location.href = jumpApi(LOGINURL); }); } else { $.yvan.msg(data.message); } } }); } }, { text: "关闭", iconCls: "fa fa-times", onClick: function () { $dlg.dialog('close'); } } ] }; }; });