Ext.define('saas.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'main',
requires: [
'Ext.list.Tree',
'Ext.Img'
],
controller: 'main',
viewModel: 'main',
cls: 'main-ct',
id: 'mainView',
itemId: 'mainView',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [
{
xtype: 'toolbar',
cls: 'main-headerbar shadow',
height: 64,
itemId: 'headerBar',
items: [
{
xtype: 'component',
reference: 'mainLogo',
cls: 'main-logo-wrap',
html: '

优企云服
',
bind: {
width: '{navWidth}'
}
},
{
margin: '0 0 0 8',
ui: 'header',
iconCls:'x-fa fa-navicon',
id: 'main-navigation-btn',
handler: 'onToggleNavigationSize'
},{
reference: 'mainprofile',
arrowVisible: false,
ui: 'header',
tooltip: '所属公司',
bind: {
text: '{company.name}'
},
menu: {
items: [{
xtype: 'menuseparator'
}]
}
},
'->',
{
iconCls:'icon-usoftchina',
ui: 'header',
tooltip: '优软云',
handler:function(){
window.open('http://www.usoftchina.com','_blank');
}
},
{
iconCls:'x-fa fa-question',
ui: 'header',
arrowVisible: false,
tooltip: '帮助',
width:50,
listeners:{
'mouseover':function(){
this.showMenu();
},
'mouseout':function(btn,e){
var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
var btnLayout = btn.el.dom.getBoundingClientRect();
if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
btn.hideMenu();
}
},'mouseleave':function(enu){
this.hide();
}
},
menu: {
cls:'x-main-menu',
items: [{
text: '新手导航',
iconCls:'x-fa icon-userGuite',
handler:function(){
console.log("新手导航");
}
},{
text: '用户手册',
iconCls:'x-fa icon-userBook',
handler:function(){
console.log("用户手册");
}
},{
text: '常见问题',
iconCls:'x-fa icon-commonQuestion',
handler:function(){
console.log("常见问题");
}
},{
text: '客服热线',
iconCls:'x-fa icon-serviceOnline',
handler:function(){
console.log("客服热线");
}
}]
}
},
{
ui: 'header',
bind: {
tooltip: '{account.realname}',
text: '{account.realname}'
}
},
{
ui: 'header',
arrowVisible: false,
cls: 'header-right-profile-image',
height: 70,
width: 70,
menu: {
items: [ {
text: '账户中心',
iconCls:'x-fa icon-accountCenter',
handler:function(){
console.log("账户中心");
}
},{
text: '意见反馈',
iconCls:'x-fa icon-feedback',
handler:function(){
console.log("意见反馈");
}
}, {
text: '退出',
handler: 'onLogout'
}]
} ,
listeners:{
'mouseover':function(){
this.showMenu();
},
'mouseout':function(btn,e){
var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
var btnLayout = btn.el.dom.getBoundingClientRect();
if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
btn.hideMenu();
}
},'mouseleave':function(enu){
this.hide();
}
}
}
]
},
{
xtype: 'maincontainerwrap'
}
]
});