SysHome.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Ext.define('erp.view.common.sysinit.SysHome', {
  2. extend: 'Ext.container.Viewport',
  3. getTools: function(){
  4. return [{
  5. xtype: 'tool',
  6. type: 'gear',
  7. handler: function(e, target, header, tool){
  8. var portlet = header.ownerCt;
  9. portlet.setLoading('Loading...');
  10. Ext.defer(function() {
  11. portlet.setLoading(false);
  12. }, 2000);
  13. }
  14. }];
  15. },
  16. initComponent: function(){
  17. Ext.apply(this, {
  18. layout: {
  19. type: 'fit',
  20. padding: '0 5 5 5'
  21. },
  22. items: [{
  23. id: 'portal',
  24. xtype: 'portalpanel',
  25. items: [{
  26. id: 'col-1',
  27. items: [{
  28. id: 'portlet-1',
  29. title: '功能模块',
  30. //tools: this.getTools(),
  31. height:0.4*Height,
  32. items: {
  33. xtype:'moudleconportlet'
  34. }
  35. },{
  36. id: 'portlet-2',
  37. title:'基础配置项',
  38. height:0.6*Height,
  39. items:{
  40. xtype:'basicconportlet'
  41. },
  42. listeners: {
  43. //'close': Ext.bind(this.onPortletClose, this)
  44. beforerender:function(panel){
  45. /*var e=Ext.getCmp('portal').getEl().dom,
  46. h = Number(e.style.height.replace('px', ''));
  47. panel.height=h*panel.anchorHeight-1;*/
  48. }
  49. }
  50. }]
  51. },{
  52. id: 'col-2',
  53. items: [{
  54. id: 'portlet-3',
  55. title: '初始化进度',
  56. height:Height,
  57. //tools: this.getTools(),
  58. //html: '<div class="portlet-content">'+Ext.example.bogusMarkup+'</div>',
  59. listeners: {
  60. //'close': Ext.bind(this.onPortletClose, this)
  61. }
  62. }]
  63. }]
  64. }]
  65. });
  66. this.callParent(arguments);
  67. },
  68. onPortletClose: function(portlet) {
  69. this.showMsg('"' + portlet.title + '" was removed');
  70. },
  71. showMsg: function(msg) {
  72. var el = Ext.get('app-msg'),
  73. msgId = Ext.id();
  74. this.msgId = msgId;
  75. el.update(msg).show();
  76. Ext.defer(this.clearMsg, 3000, this, [msgId]);
  77. },
  78. clearMsg: function(msgId) {
  79. if (msgId === this.msgId) {
  80. Ext.get('app-msg').hide();
  81. }
  82. }
  83. });