Application.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * @Description:
  3. * @Author: hy
  4. * @Date: 2019-08-12 17:59:33
  5. * @LastEditTime: 2019-08-14 18:21:37
  6. */
  7. Ext.define('uas.Application', {
  8. extend: 'Ext.app.Application',
  9. requires: [
  10. 'uas.view.main.*',
  11. 'uas.controller.Global',
  12. 'uas.model.Base'
  13. ],
  14. name: 'uas',
  15. controllers: [
  16. 'Global',
  17. ],
  18. defaultToken: '',
  19. init: function() {
  20. Ext.tip.QuickTipManager.init(null, {
  21. showOnTap: true
  22. });
  23. if (!Ext.platformTags.test) {
  24. Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider',{
  25. expires: new Date(new Date().getTime()+(1000*60*60*24*30)) //30 days
  26. }));
  27. }
  28. },
  29. launch: function () {
  30. var view = 'uas.view.main.Main';
  31. this.setMainView({
  32. xclass: view
  33. });
  34. },
  35. onAppUpdate: function () {
  36. Ext.Msg.confirm('Application Update', 'This application has an update, reload?',
  37. function (choice) {
  38. if (choice === 'yes') {
  39. window.location.reload();
  40. }
  41. }
  42. );
  43. }
  44. });