Ext.define('erp.view.sys.InitPortal',{ extend: 'Ext.panel.Panel', alias: 'widget.syspanel', id:'syspanel', layout:'card', //animCollapse: false, //constrainHeader: true, bodyBorder: true, layout:'card', title:'初始向导', border: false, autoShow: true, bodyStyle:'background-color:#f1f1f1;', buttons: [{ id: 'move-prev', text: '上一步', handler: function(btn) { var panel=btn.up("syspanel"); panel.changeCard(panel, "prev"); }, disabled: true }, '->', { id: 'move-next', text: '下一步', handler: function(btn) { var panel=btn.up("syspanel"); panel.changeCard(panel, "next"); } } ], initComponent : function(){ var me=this; Ext.applyIf(me,{ items:me.getItems() }); this.callParent(arguments); }, ActiveIndex_:0, changeCard:function(panel,direction,index){ var layout = panel.getLayout(); var app=erp.getApplication(); if(direction){ layout[direction](); }else{ var a=index; layout.setActiveItem(index); } this.ActiveIndex_=direction=='next'?++this.ActiveIndex_:--this.ActiveIndex_; activeItem=layout.getActiveItem(); if(activeItem.type){ var contrlPath=this.getContrlPath(activeItem.type); Ext.require("erp.controller."+contrlPath,function(){ var Controller = app.getController(contrlPath);//4.2 直接init },self); } Ext.getCmp('syspanel').setTitle(activeItem.desc); Ext.getCmp('move-prev').setDisabled(!layout.getPrev()); Ext.getCmp('move-next').setDisabled(!layout.getNext()); //showResult('提示','初始化成功!'); }, getContrlPath:function(type){ return "sys.step."+type+"Controller"; }, getItems:function(){ var array=[{ desc: '企业信息', xtype:'enterpriseportal' },{ desc: '系统设置', xtype:'modulesetportal', condition:"step='sys'" },{ desc: '组织人员', layout:'fit', type:'Hr' },{ desc:'销售管理', type:'Sale', layout:'fit' },{ desc:'采购管理', type:'PU', layout:'fit' },{ desc: '物料信息', layout:'fit', type:'PR' },{ desc: '库存管理', glyph:'72@My Font Family', type:'SC', layout:'fit' },{ desc: '财务会计', glyph:'73@My Font Family', layout:'fit', type:'FA' }]; if(installtype && installtype=='Make'){ array=Ext.Array.insert(array,6,[{ desc: '生产委外管理', layout:'fit', type:'MO' }]); } return array; } });