ClearCache.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Ext.define('saas.view.tools.ClearCache', {
  2. extend: 'Ext.form.Panel',
  3. xtype: 'tools-clearcache',
  4. requires: ['Ext.form.field.Display'],
  5. layout: 'column',
  6. width: 350,
  7. bodyPadding: 10,
  8. items: [{
  9. xtype: 'displayfield',
  10. value: '确定执行清除缓存操作吗?',
  11. columnWidth: 1
  12. }],
  13. buttonAlign: 'center',
  14. buttons: [{
  15. text: '确定',
  16. handler: function() {
  17. var win = this.up('core-win');
  18. win.setLoading(true);
  19. saas.util.BaseUtil.request({
  20. url: '/api/account/account/cache/clearAll',
  21. }).then(function(res) {
  22. saas.util.BaseUtil.showSuccessToast('清除缓存成功');
  23. win.setLoading(false);
  24. win.close();
  25. }).catch(function(e) {
  26. saas.util.BaseUtil.showErrorToast('清除缓存失败: ' + e.message);
  27. win.setLoading(false);
  28. win.close();
  29. });
  30. }
  31. }, {
  32. text: '取消',
  33. handler: 'closeWin'
  34. }]
  35. })