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: 50,
itemId: 'headerBar',
items: [
{
xtype: 'component',
reference: 'mainLogo',
width: 180,
cls: 'main-logo-wrap',
html: '

U企云服
',
bind: {
width: '{navWidth}'
}
},
{
margin: '0 8 0 8',
padding: '7 0 7 0',
ui: 'header',
iconCls:'x-sa sa-arrows-left',
id: 'main-navigation-toggle-btn',
handler: 'onToggleNavigationSize'
},{
padding: '0 0 0 0',
reference: 'mainprofile',
cls:'x-main-master',
ui: 'header',
bind: {
text: '{company.name}',
arrowVisible: '{hasManyCompany}',
},
menu: {
items: []
}
},
'->',
{
iconCls:'icon-usoftchina',
ui: 'header',
tooltip: '优软云',
handler:function(){
window.open('http://www.usoftchina.com','_blank');
}
},
{
margin:'0 3 0 6',
iconCls:'x-fa fa-share-square',
cls:'sa-nav-button',
ui: 'header',
tooltip: '邀请同事',
handler:'shareCompany'
},
{
iconCls:'x-sa sa-help',
cls:'sa-nav-button',
ui: 'header',
arrowVisible: false,
tooltip: '帮助',
width:50,
height:45,
menu: {
cls:'x-main-menu sa-nav-menu',
height: 66,
items: [{
text: '新手导航',
iconCls:'x-fa sa-navicon fa-comment-o',
handler:function(){
saas.util.BaseUtil.openTab('sys-guide-formpanel','新手导航', 'sys-guide-formpanel-nav');
}
}/* ,{
text: '用户手册',
hidden:true,
iconCls:'x-fa sa-navicon fa-address-book-o',
handler:function(){
window.open('http://www.usoftchina.com','_blank');
}
},{
text: '常见问题',
iconCls:'x-fa fa-question-circle-o sa-navicon',
handler:function(){
window.open('http://www.usoftchina.com','_blank');
}
} */,{
text: '客服热线',
iconCls:'x-fa fa-phone sa-navicon',
menu:{
cls:'sa-nav-menu',
items:[{
text:'优软科技官网'
},{
text:'电话:400-830-1818'
},{
text:'邮箱:info@usoftchina.com'
}]
}
}]
}
},
{
//margin: '0 0 0 0',
xtype: 'tbtext',
name:'realname',
cls:'sa-nav-button nav-realname',
bind: {
html: '{account.realname}'
},
style:{
cursor:'default',
textAlign:'center'
},
listeners:{
afterrender:function(b){
var main = b.ownerCt.ownerCt;
//调用
var _localStorage = Ext.decode(localStorage.getItem('app-state-session'));
var nowCompanyId = _localStorage.account.companyId;
if(_localStorage.account.rolesMap){
var rolesMap = _localStorage.account.rolesMap[nowCompanyId];
if(rolesMap&&rolesMap.length>0){
for(var i = 0; i < rolesMap.length; i++) {
if(rolesMap[i].type==0){
main.isAdmin = true;
main.getController().loadInvitationMsg(1,nowCompanyId)
}
}
}
}
}
},
},
{
// ui: 'header',
cls:' sa-nav-button',
width: 50,
height:50,
bind: {
html:''
},
menu: {
// height: 132,
cls:'x-main-menu2 sa-nav-menu',
items: [ {
text: '账户中心',
iconCls:'x-fa fa-user-o sa-navicon',
handler:function(){
var userId = saas.util.BaseUtil.getCurrentUser().id,
url = Ext.manifest.server.accountEnterprise;
if(userId == '-99999') {
url = Ext.manifest.server.accountCenter;
}
window.open(url, '_blank');
}
},{
text: '意见反馈',
iconCls:'x-fa fa-comment-o sa-navicon',
handler:'feedbackMsg'
}, {
text: '加入申请',
name:'join',
iconCls:'x-fa fa-handshake-o sa-navicon',
handler:function(b){
saas.util.BaseUtil.openTab('sys-invitation-datalist','申请列表', 'sys-invitation-datalist');
},
bind: {hidden: '{!isAdmin}'}
}, {
text: '退出',
iconCls:'x-fa fa-power-off sa-navicon',
handler: 'onLogout'
}],
listeners:{
show:function(m){
var name = m.ownerCmp.ownerCt.down('[name=realname]');
var classList = name.getEl().dom.classList;
if(classList.contains('x-header-redpoint')){
m.getEl().dom.classList.add('x-menu-redpoint')
}else{
m.getEl().dom.classList.remove('x-menu-redpoint')
}
}
}
}
}
]
},
{
xtype: 'maincontainerwrap'
}
]
});