ResetAccount.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Ext.define('saas.view.tools.ResetAccount', {
  2. extend: 'Ext.form.Panel',
  3. xtype: 'tools-resetaccount',
  4. requires: ['Ext.layout.container.Column'],
  5. layout: 'column',
  6. width: 350,
  7. bodyPadding: 10,
  8. items: [{
  9. xtype: 'textfield',
  10. name: 'userName',
  11. emptyText: '输入账号',
  12. columnWidth: 1,
  13. allowBlank: false
  14. }],
  15. buttonAlign: 'center',
  16. buttons: [{
  17. text: '确定',
  18. formBind: true,
  19. handler: function() {
  20. var win = this.up('core-win'),
  21. form = this.up('tools-resetaccount'),
  22. userName = form.getValues().userName;
  23. win.setLoading(true);
  24. saas.util.BaseUtil.request({
  25. url: '/api/oper_auth/clearAuthorizeCount?username=' + userName,
  26. }).then(function(res) {
  27. saas.util.BaseUtil.showSuccessToast('账号[' + userName + ']已重置');
  28. win.setLoading(false);
  29. win.close();
  30. }).catch(function(e) {
  31. saas.util.BaseUtil.showErrorToast('账号[' + userName + ']重置失败: ' + e.message);
  32. win.setLoading(false);
  33. win.close();
  34. });
  35. }
  36. }, {
  37. text: '取消',
  38. handler: 'closeWin'
  39. }]
  40. })