Ext.onReady(function(){
//定義頭部組件
var header = new Ext.Panel({
region:'north',
//frame:true,
height:132,
split: true,
minSize: 132,
maxSize: 132,
collapseMode: 'mini',
autoEl:{
tag:'div',
html:'<div style="height:132px;"><iframe src="/dyzc/flash/header.html" width="100%" height="132px" frameborder="0" scrolling="no"></iframe></div><div style="position:absolute;top:110px;left:50px; color:#FFFFFF;"><font size=3 id="user">歡迎當前用戶(hù):</font></div><div id="timer"></div><div id="exit"><font style=margin-left:20px;">退出系統</font></div>'
}
});
//定義左側導航欄
var nav = new Ext.Panel({
region:'west',
//title:' ',
width:200,
split: true,
minSize: 200,
maxSize: 200,
bodyCfg:{
cls:'body'
},
scollapsible:true,
collapseMode: 'mini',
//collapsible: true,
items:[
//系統管理
new Ext.Panel({
title:'<b style="cursor:pointer; display:block;">系統管理</b>',
id:'nav009',
autiHeight:true,
collapsible: true,
titleCollapse:true,
headerCfg:{
cls:'nav010Header'
},
bodyCfg:{
cls:'alpha'
},
html:'<a id="Nav09001" class="arrow" href="#"><span style="margin-left:15px;">部門(mén)管理</span></a><div style="height:10px"></div><a id="Nav09001Q" class="arrow" href="#"><span style="margin-left:15px;">部門(mén)管理QH</span></a><div style="height:10px"></div><a id="Nav09002" class="arrow" href="#"><span style="margin-left:15px;">用戶(hù)管理</span></a><div style="height:10px"></div><a id="Nav09002Q" class="arrow" href="#"><span style="margin-left:15px;">用戶(hù)管理QH</span></a><div style="height:10px"></div><a id="Nav09003" class="arrow" href="#"><span style="margin-left:15px;">崗位管理</span></a><div style="height:10px"></div><a id="Nav09004" class="arrow" href="#"><span style="margin-left:15px;">菜單管理</span></a><div style="height:10px"></div><a id="Nav09005" class="arrow" href="#"><span style="margin-left:15px;">權限管理</span></a><div style="height:10px"></div><a id="Nav09005Q" class="arrow" href="#"><span style="margin-left:15px;">權限管理QH</span></a><div style="height:10px"></div><a id="Nav09006Q" class="arrow" href="#"><span style="margin-left:15px;">角色管理QH</span></a><div style="height:10px"></div><a id="Nav09006" class="arrow" href="#"><span style="margin-left:15px;">角色管理</span></a><div style="height:10px"></div><a id="Nav09007" class="arrow" href="#"><span style="margin-left:15px;">操作日志</span></a><div style="height:10px"></div><a id="Nav09008" class="arrow" href="#"><span style="margin-left:15px;">數據庫管理</span></a><div style="height:10px"></div><a id="Nav09009" class="arrow" href="#"><span style="margin-left:15px;">修改密碼</span></a><div style="height:10px"></div><a id="Nav09010" class="arrow" href="#"><span style="margin-left:15px;">操作日志(T)</span></a><div style="height:10px"></div><a id="Nav09012" class="arrow" href="#"><span style="margin-left:15px;">崗位日志(T)</span></a><div style="height:10px"></div><a id="Nav09013" class="arrow" href="#"><span style="margin-left:15px;">菜單管理(T)</span></a><div style="height:10px"></div>'
})
]
});
//定義右下內容部分
var content = new Ext.Panel({
region:'center',
id:'content',
html:'<iframe id="mainIframe" src="/dyzc/system/navigation.html" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>',
bodyStyle:'background:url(../resources/images/zairu.jpg) #FFFFFF center center fixed no-repeat;'
});
//定義Viewport視圖
new Ext.Viewport({
layout:'border',
items:[{
region:'north',
border:false,
bodyBorder:false,
contentEl:'header',
height:132,
split: true,
minSize: 132,
maxSize: 132,
collapseMode: 'mini'
},nav,content]
});
//退出系統
var exit = Ext.get("exit");
exit.addClass('exit01');
exit.on({
'mouseover':function(){exit.replaceClass('exit01','exit02');},
'mouseout':function(){exit.replaceClass('exit02','exit01');},
scope:this
});
exit.on('click',function(){
Ext.MessageBox.confirm('提示信息','你確定要退出系統嗎?',function(btn){
if(btn=='yes'){
Ext.Ajax.request({
url : 'loginOut.action', // 請求地址
// 成功時(shí)回調
success : function(response, options) {
var responseArray = response.responseText;
if (responseArray == 'success') {
location.replace('login.html');
} else {
Ext.Msg.alert('操作失敗');
}
}
});
}
});
});
Ext.Ajax.request({
url : 'getLoginName.action', // 請求地址
// 成功時(shí)回調
success : function(response, options) {
var responseArray = response.responseText;
var tem = responseArray.split(",");
var tem1 = tem[0];
var tem2 = tem[1];
document.getElementById("user").innerHTML += tem1;
var n = 9;
var winTip = new Ext.Window({
resizable:false,
layout: 'fit',
shadow:false,
width: 240,
title: '溫馨提示<font size="2" color="#FFFFFF">(點(diǎn)擊查看詳情)</font>',
height: 160,
hideBorders:true,
//bodyStyle:'padding-top:25px; padding-left:10px;',
//modal:true,
pageX:1500,
pageY:800,
constrain:true,
closeAction: 'hide',
html:'<div id="renwu" style="cursor:pointer; height:120px; background: url(/dyzc/resources/images/tipBk.gif) no-repeat center scroll !important; line-height:100px;">歡迎:<font color="#537DB0">'+tem1+'</font>,你有<font color="red">'+tem2+'</font>條待辦任務(wù)!</div>'
})
winTip.show();
Ext.get('renwu').on({
'click':function(t){
winTip.hide();
Ext.getCmp('content').update('<iframe src="/dyzc/task/tasklist.html" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>');
},
'mouseover':function(t){Ext.get(t.target.id).addClass('tipClass')},
'mouseout':function(t){Ext.get(t.target.id).removeClass('tipClass')},
scope:this
});
}
});
//NavOnClick開(kāi)始 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
var content = Ext.getCmp('content');
//部門(mén)管理
Ext.get('Nav09001').on('click',function(){
content.update('<iframe src="/dyzc/queryDepartInfo.action" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>');
});
//部門(mén)管理QH
Ext.get('Nav09001Q').on('click',function(){
content.update('<iframe src="/dyzc/admin/depart/listqh.html" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>');
});
//用戶(hù)管理
Ext.get('Nav09002').on('click',function(){
content.update('<iframe src="/dyzc/queryUserInfo.action" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>');
});
Ext.getCmp('nav001').collapse();
Ext.getCmp('nav002').collapse();
Ext.getCmp('nav003').collapse();
Ext.getCmp('nav004').collapse();
Ext.getCmp('nav005').collapse();
Ext.getCmp('nav006').collapse();
Ext.getCmp('nav007').collapse();
Ext.getCmp('nav008').collapse();
Ext.getCmp('nav009').collapse();
});