Init.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.common.Init', {
  3. extend: 'Ext.app.Controller',
  4. requires: ['erp.util.BaseUtil'],
  5. views: ['common.init.Init', 'common.init.Tree', 'core.button.UpExcel'],
  6. init: function(){
  7. var me = this;
  8. me.BaseUtil = Ext.create('erp.util.BaseUtil');
  9. this.control({
  10. '#northbtn > button': {
  11. click: function(btn){//切换步骤
  12. me.toogle(btn, btn.step);
  13. }
  14. }
  15. });
  16. },
  17. toogle: function(btn, step){
  18. var c = Ext.ComponentQuery.query('#centerpanel > panel[hidden=false]')[0];
  19. if(c){
  20. var bt = parent.Ext.ComponentQuery.query('button[step=' + c.step + ']')[0];
  21. bt.removeCls('stepon');
  22. bt.addCls('stepoff');
  23. c.hide();
  24. }
  25. var p = Ext.ComponentQuery.query('#centerpanel > panel[step=' + step + ']')[0];
  26. if(p){
  27. btn.removeCls('stepoff');
  28. btn.addCls('stepon');
  29. p.show();
  30. if(!p.loaded){
  31. p.getEl().down('iframe').dom.contentWindow.location.href = basePath + p.url;
  32. p.loaded = true;
  33. }
  34. }
  35. }
  36. });