Main.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. Ext.define('saas.view.main.Main', {
  2. extend: 'Ext.container.Container',
  3. xtype: 'main',
  4. requires: [
  5. 'Ext.list.Tree',
  6. 'Ext.Img'
  7. ],
  8. controller: 'main',
  9. viewModel: 'main',
  10. cls: 'main-ct',
  11. id: 'mainView',
  12. itemId: 'mainView',
  13. layout: {
  14. type: 'vbox',
  15. align: 'stretch'
  16. },
  17. items: [
  18. {
  19. xtype: 'toolbar',
  20. cls: 'main-headerbar shadow',
  21. height: 64,
  22. itemId: 'headerBar',
  23. items: [
  24. {
  25. xtype: 'component',
  26. reference: 'mainLogo',
  27. cls: 'main-logo-wrap',
  28. html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">优企云服</div></div>',
  29. bind: {
  30. width: '{navWidth}'
  31. }
  32. },
  33. {
  34. margin: '0 0 0 8',
  35. ui: 'header',
  36. iconCls:'x-fa fa-navicon',
  37. id: 'main-navigation-btn',
  38. handler: 'onToggleNavigationSize'
  39. },{
  40. reference: 'mainprofile',
  41. arrowVisible: false,
  42. ui: 'header',
  43. tooltip: '所属公司',
  44. bind: {
  45. text: '{company.name}'
  46. },
  47. menu: {
  48. items: [{
  49. xtype: 'menuseparator'
  50. }]
  51. }
  52. },
  53. '->',
  54. {
  55. iconCls:'icon-usoftchina',
  56. ui: 'header',
  57. tooltip: '优软云',
  58. handler:function(){
  59. window.open('http://www.usoftchina.com','_blank');
  60. }
  61. },
  62. {
  63. iconCls:'x-fa fa-question',
  64. ui: 'header',
  65. arrowVisible: false,
  66. //tooltip: '帮助',
  67. width:50,
  68. listeners:{
  69. 'mouseover':function(){
  70. this.showMenu();
  71. },
  72. 'mouseout':function(btn,e){
  73. var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
  74. var btnLayout = btn.el.dom.getBoundingClientRect();
  75. if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
  76. btn.hideMenu();
  77. }
  78. },'mouseleave':function(enu){
  79. this.hide();
  80. }
  81. },
  82. menu: {
  83. items: [{
  84. text: '新手导航',
  85. iconCls:'x-fa icon-userGuite',
  86. handler:function(){
  87. console.log("新手导航");
  88. }
  89. },{
  90. text: '用户手册',
  91. iconCls:'x-fa icon-userBook',
  92. handler:function(){
  93. console.log("用户手册");
  94. }
  95. },{
  96. text: '常见问题',
  97. iconCls:'x-fa icon-commonQuestion',
  98. handler:function(){
  99. console.log("常见问题");
  100. }
  101. },{
  102. text: '客服热线',
  103. iconCls:'x-fa icon-serviceOnline',
  104. handler:function(){
  105. console.log("客服热线");
  106. }
  107. }]
  108. }
  109. },
  110. {
  111. ui: 'header',
  112. bind: {
  113. tooltip: '{account.realname}',
  114. text: '{account.realname}'
  115. }
  116. },
  117. {
  118. ui: 'header',
  119. arrowVisible: false,
  120. cls: 'header-right-profile-image',
  121. height: 70,
  122. width: 70,
  123. /* bind: {
  124. src: '{avatarUrl}'
  125. }, */
  126. menu: {
  127. items: [ {
  128. text: '账户中心',
  129. iconCls:'x-fa icon-accountCenter',
  130. handler:function(){
  131. console.log("账户中心");
  132. }
  133. },{
  134. text: '意见反馈',
  135. iconCls:'x-fa icon-feedback',
  136. handler:function(){
  137. console.log("意见反馈");
  138. }
  139. }, {
  140. text: '退出',
  141. handler: 'onLogout'
  142. }]
  143. } ,
  144. listeners:{
  145. 'mouseover':function(){
  146. this.showMenu();
  147. },
  148. 'mouseout':function(btn,e){
  149. var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
  150. var btnLayout = btn.el.dom.getBoundingClientRect();
  151. if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
  152. btn.hideMenu();
  153. }
  154. },'mouseleave':function(enu){
  155. this.hide();
  156. }
  157. }
  158. }
  159. ]
  160. },
  161. {
  162. xtype: 'maincontainerwrap'
  163. }
  164. ]
  165. });