ResetAccount.js 1.2 KB

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