Main.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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: 50,
  22. itemId: 'headerBar',
  23. items: [
  24. {
  25. xtype: 'component',
  26. reference: 'mainLogo',
  27. width: 180,
  28. cls: 'main-logo-wrap',
  29. html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">U企云服</div></div>',
  30. bind: {
  31. width: '{navWidth}'
  32. }
  33. },
  34. {
  35. margin: '0 8 0 8',
  36. padding: '7 0 7 0',
  37. ui: 'header',
  38. iconCls:'x-sa sa-arrows-left',
  39. id: 'main-navigation-toggle-btn',
  40. handler: 'onToggleNavigationSize'
  41. },{
  42. padding: '0 0 0 0',
  43. reference: 'mainprofile',
  44. cls:'x-main-master',
  45. ui: 'header',
  46. bind: {
  47. text: '{company.name}',
  48. arrowVisible: '{hasManyCompany}',
  49. },
  50. menu: {
  51. items: []
  52. }
  53. },
  54. '->',
  55. {
  56. iconCls:'icon-usoftchina',
  57. text: '优软云',
  58. ui: 'header',
  59. tooltip: '优软云',
  60. handler:function(){
  61. window.open('http://www.usoftchina.com','_blank');
  62. }
  63. },
  64. {
  65. margin:'0 3 0 6',
  66. // iconCls:'x-fa fa-share-square',
  67. iconCls:'x-sa sa-invite',
  68. cls:'sa-nav-button',
  69. ui: 'header',
  70. tooltip: '邀请同事',
  71. handler:'shareCompany'
  72. },
  73. {
  74. iconCls:'x-sa sa-help',
  75. cls:'sa-nav-button',
  76. ui: 'header',
  77. arrowVisible: false,
  78. tooltip: '帮助',
  79. width:50,
  80. height:45,
  81. menu: {
  82. cls:'x-main-menu sa-nav-menu',
  83. height: 66,
  84. items: [{
  85. text: '新手导航',
  86. iconCls:'x-fa sa-navicon fa-comment-o',
  87. handler:function(){
  88. saas.util.BaseUtil.openTab('sys-guide-formpanel','新手导航', 'sys-guide-formpanel-nav');
  89. }
  90. }/* ,{
  91. text: '用户手册',
  92. hidden:true,
  93. iconCls:'x-fa sa-navicon fa-address-book-o',
  94. handler:function(){
  95. window.open('http://www.usoftchina.com','_blank');
  96. }
  97. },{
  98. text: '常见问题',
  99. iconCls:'x-fa fa-question-circle-o sa-navicon',
  100. handler:function(){
  101. window.open('http://www.usoftchina.com','_blank');
  102. }
  103. } */,{
  104. text: '客服热线',
  105. iconCls:'x-fa fa-phone sa-navicon',
  106. menu:{
  107. cls:'sa-nav-menu',
  108. items:[{
  109. text:'<span onclick="javascript:window.open(\'http://www.usoftchina.com\');" style="text-decoration:underline;color:blue;">优软科技官网</span>'
  110. },{
  111. text:'<span>电话:400-830-1818</span>'
  112. },{
  113. text:'<span>邮箱:info@usoftchina.com</span>'
  114. }]
  115. }
  116. }]
  117. }
  118. },
  119. {
  120. //margin: '0 0 0 0',
  121. xtype: 'tbtext',
  122. name:'realname',
  123. cls:'sa-nav-button nav-realname',
  124. bind: {
  125. html: '{account.realname}'
  126. },
  127. style:{
  128. cursor:'default',
  129. textAlign:'center',
  130. color: '#9A9A9A',
  131. },
  132. listeners:{
  133. afterrender:function(b){
  134. var main = b.ownerCt.ownerCt;
  135. //调用
  136. var user = saas.util.BaseUtil.getCurrentUser();
  137. var nowCompanyId = user.companyId;
  138. if(user.rolesMap){
  139. var rolesMap = user.rolesMap[nowCompanyId];
  140. if(rolesMap&&rolesMap.length>0){
  141. for(var i = 0; i < rolesMap.length; i++) {
  142. if(rolesMap[i].type==0){
  143. main.getController().loadInvitationMsg(1,nowCompanyId)
  144. }
  145. }
  146. }
  147. }
  148. }
  149. },
  150. },
  151. {
  152. // ui: 'header',
  153. cls:' sa-nav-button',
  154. width: 50,
  155. height:50,
  156. bind: {
  157. html:'<img class="x-img x-box-item x-toolbar-item x-img-header" style="height:35px;width:35px;margin-top: 6px;margin-left: 14px;" src="{avatarUrl}" alt="">'
  158. },
  159. menu: {
  160. // height: 132,
  161. cls:'x-main-menu2 sa-nav-menu',
  162. items: [ {
  163. text: '账户中心',
  164. iconCls:'x-fa fa-user-o sa-navicon',
  165. handler:function(){
  166. var userId = saas.util.BaseUtil.getCurrentUser().id,
  167. url = Ext.manifest.server.accountEnterprise;
  168. if(userId == '-99999') {
  169. url = Ext.manifest.server.accountCenter;
  170. }
  171. window.open(url, '_blank');
  172. }
  173. },{
  174. text: '意见反馈',
  175. iconCls:'x-fa fa-comment-o sa-navicon',
  176. handler:'feedbackMsg'
  177. }, {
  178. text: '加入申请',
  179. name:'join',
  180. iconCls:'x-fa fa-handshake-o sa-navicon',
  181. handler:function(b){
  182. saas.util.BaseUtil.openTab('sys-invitation-datalist','申请列表', 'sys-invitation-datalist');
  183. },
  184. bind: {hidden: '{!isAdmin}'}
  185. }, {
  186. text: '退出',
  187. iconCls:'x-fa fa-power-off sa-navicon',
  188. handler: 'onLogout'
  189. }],
  190. listeners:{
  191. show:function(m){
  192. var name = m.ownerCmp.ownerCt.down('[name=realname]');
  193. var classList = name.getEl().dom.classList;
  194. if(classList.contains('x-header-redpoint')){
  195. m.getEl().dom.classList.add('x-menu-redpoint')
  196. }else{
  197. m.getEl().dom.classList.remove('x-menu-redpoint')
  198. }
  199. }
  200. }
  201. }
  202. }
  203. ]
  204. },
  205. {
  206. xtype: 'maincontainerwrap'
  207. }
  208. ]
  209. });