1、wmcoreframe.jsp
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.:GHT综合网管系统:.</title>
<%@ includefile="/common/core/meta.jsp" %>
<link rel="stylesheet"type="text/css" href="${ctx}/resource/core/ext-4.1.1/resources/css/ext-all.css"/>
<link rel="stylesheet"type="text/css" href="${ctx}/css/core/ext/ext4-cn-font.css"/>
<link rel="stylesheet"type="text/css" href="${ctx}/resource/core/ext-4.1.1/examples/shared/example.css"/>
<link rel="stylesheet"type="text/css" href="${ctx}/resource/core/ext-4.1.1/examples/ux/css/CheckHeader.css"/>
<script type="text/javascript"src="${ctx}/resource/core/ext-4.1.1/ext-all.js"></script>
<script type="text/javascript"src="${ctx}/resource/core/ext-4.1.1/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript"src="${ctx}/js/g2s/core/wmcoreframe.js"></script>
</head>
<body>
<style type="text/css">
.munuList {
list-style: square;
padding-left: 20px;
margin-top: 6px;
color: #000000;
font-size: 12px;
list-style-type:none;
}
a:link {
color: #2C5394;
text-decoration: none
}
a:visited {
color: #2C5394;
text-decoration: none
}
a:hover {
color: #FF0000;
text-decoration: underline
}
a:active {
color: #2C5394;
text-decoration: none
}
.title {
background-color:#1F4D8B;
padding: 5 5 5 5;
color: white;
width:100%;
font-weight: bolder;
text-align:center;
}
</style>
</body>
</html>
2.、wmcoreframe.js
var treeClick;
var tabPanels =new Hashtable();
Ext.application({
name:'wmcoreframe',
launch:function(){
var store =Ext.create('Ext.data.TreeStore', {
autoScroll:true,//必要的时候自动滚动
root: {
expanded: true,
children: [
{ text: 'G2S软交换网管系统',expanded: true,
children: [
{
text:"系统信息",
expanded: true,
children:[
{text:'版本信息',leaf: true,id:'1'},
{text:'License信息',leaf: true,id:'2'},
{text:'时间信息',leaf: true,id:'3'},
{text:'地址信息',leaf: true,id:'4'},
{text:'模块信息',leaf: true,id:'5'}
]
},{
text:"系统管理",
expanded: true,
children:[
{text:'在线呼叫',leaf: true,id:'6'},
{text:'呼叫统计',leaf: true,id:'7'},
{text:'呼叫记录',leaf: true,id:'8'},
{text:'系统复位',leaf: true,id:'9'}
]
},{
text:'呼叫管理',
expanded: true,
children:[
{text:'区域管理',leaf: true,id:'10'},
{text:'终端用户',leaf: true,id:'11'},
{text:'中继用户',leaf: true,id:'12'},
{text:'服务级别',leaf: true ,id:'13'},
{text:'功能级别',leaf: true, id:'14'},
{text:'授权码',leaf: true, id:'15'},
{text:'主叫转换',leaf: true, id:'16'},
{text:'被叫转换',leaf: true, id:'17'},
{text:'被叫识别',leaf: true, id:'18'},
{text:'路由设置',leaf: true, id:'19'},
{text:'组合转换',leaf:true, id:'20'},
{text:'特服资源组',leaf: true, id:'21'},
{text:'特服号码',leaf: true, id:'22'},
{text:'系统音源',leaf: true ,id:'23'},
{text:'IP范围限定',leaf: true, id:'24'}
]
},{
text: "双归属",
expanded: true,
children:[
{text:'探测链路',leaf: true, id:'25'},
{text:'接管配置',leaf: true ,id:'26'}
]
},{
text: "应用服务",
expanded: true,
children:[
{text:'一号通',leaf: true ,id:'27'},
{text:'提醒服务',leaf: true ,id:'28'},
{text:'语音信箱',leaf: true ,id:'29'},
{text:'虚拟集团',leaf: true ,id:'30'},
{text:'会议管理',leaf: true ,id:'31'}
]
},{
text: "调度业务",
expanded: true,
children:[
{text:'调度组',leaf: true, id:'32'}
]
},{
text: "日志信息",
expanded: true,
children:[
{text:'日志级别',leaf: true, id:'33'},
{text:'系统日志',leaf: true, id:'34'},
{text:'维护日志',leaf: true, id:'35'}
]
}
,{
text: "备份恢复",
expanded: true,
children:[
{text:'备份数据',leaf: true, id:'36'},
{text:'恢复数据',leaf: true, id:'37'}
]
}
]
}
]
}
});
//public function
var addTab;
var updateTab;
//内容面板
var contentPanel = newExt.TabPanel({
region : 'center',
enableTabScroll : true,
border:true,
activeTab : 0,
items : [{
id : 'homePage',
title : '首页',
autoScroll : true,
html : '<divstyle="color:#ff0000;"><h1align="center"><b><marquee direction="right"behavior="alternate" scrolldelay="100">欢迎使用G2S软交换管理系统</marquee></b></h1></div>'
}]
});
//树形面板
var treepanel= newExt.tree.Panel({
id: 'westFrame',
titleAlign: 'right',
title: "<imageοnclick='window.top.reloadWestFrame()' src='" + ctx+"/image/refresh.gif' style='cursor:hand;width:16px;height:16px;'></image>",
region: 'west',
tabPosition: 'bottom',
collapsible: true,
hideCollapseTool:true,
split: true,
width: 250,
minWidth: 50,
maxWidth: 300,
margin: '0 0 1 1',
border:false,
width:250,
autoHeight:true,//自动设置高度
autoScroll:true,//必要的时候自动滚动
store:store,
rootVisible: false,
renderTo: Ext.getBody()
});
addTab = function(destTabPanel,id, tabTitle, targetUrl) {
var panel = new Ext.panel.Panel({
id: id + '_panel',
title: " " +tabTitle + " ",
loader: {
url: targetUrl,
// renderer: 'html',
scripts: true,
scope: this,
autoLoad: true
/* ,callback: function() {
if (Ext.isIE8) {
var ifrm = document.getElementById(id+'_Frame');
ifrm.height=Ext.getCmp(id +'_panel').getHeight()-2;
}
}*/
},
autoScroll: true,
border: 1,
bodyBorder : false,
margins : '0 0 0 0',
closable:true
});
/**关闭*/
Ext.getCmp(id+'_panel').on(
'close',
function(panel) {
tabPanels.remove(id+'_panel');
// iframeRelease(panel);
delete panel;
}
);
tabPanels.put(id+'_panel',panel);
destTabPanel.add(panel).show();
};
updateTab = function(destTabPanel,id, tabTitle, targetUrl) {
var tab = destTabPanel.getComponent(id + '_panel');
if (tab) {
//tabPanel.remove(tab);
destTabPanel.setActiveTab(tab); //如果Tab存在,则将当前Tab切换到该Tab
return;
}
tab = addTab(destTabPanel, id, tabTitle, targetUrl);
destTabPanel.setActiveTab(tab);
};
// 设置树的点击事件五个参数Ext.view.View this,
//Ext.data.Model record,HTMLElement item, Number index, Ext.EventObject e, Object eOpts
treeClick=function (veiw, record,item, index, e, opts ) {
var url="";
var nodeId =record.raw.id;//获取id
var text=record.raw.text;//获取文字
if(text!='undefined'){
if(text=='模块信息'){
url=ctx+'/g2s/sysinfo/module.action';
}
if(text=='地址信息'){
url=ctx+"/g2s/sysinfo/address.action";
}
}
/*******************alert(nodeId);
var n =contentPanel.getComponent(nodeId);
if(text!='undefined'){
if(text=='模块信息'){
url=ctx+'/g2s/sysinfo/module.action';
}
if(text=='地址信息'){
url=ctx+"/g2s/sysinfo/address.action";
}
}
if (n) {
contentPanel.remove(n);
contentPanel.setActiveTab(n);
return;
}
var tab =contentPanel.add({
'id' : nodeId,
'title' :text,
closable : true,
autoLoad : {
url : url,
scripts :true
} // 通过autoLoad属性载入目标页,如果要用到脚本,必须加上scripts属性
});
contentPanel.setActiveTab(tab);
*************************/
updateTab(contentPanel,nodeId, text, url);
};
treepanel.on('itemclick',treeClick);
Ext.create('Ext.container.Viewport',{
layout: 'border',
items: [{
id: 'topFrame',
region: 'north',//北面内容
height: 40,
header: false,
border: false,
margins: '0 0 2 0',
autoLoad : {
url :ctx+"/common/core/g2s/header.jsp",//一个头部的内容,包括//顶端的图片
scripts : true
}
},
contentPanel,//中间内容面板
treepanel//左边树
, {
id: 'bottomFrame',
region: 'south',
frame: true,
height: 38,
margin: '0 1 1 1',
padding: '0 2 0 2',
layout: {
type: 'hbox',
align: 'middle',
pack: 'start'
},
items: [{
id: 'bottomFrame_Left',
xtype: 'container',
height: 34,
border: 0,
padding: 0,
flex: 7,
layout: {
type: 'hbox',
align: 'middle',
pack: 'start'
}
},{
id: 'bottomFrame_Right',
xtype: 'container',
border: 0,
padding: 0,
flex: 3,
layout: {
type: 'hbox',
align: 'middle',
pack: 'end'
}
}]
}]
});
}
});
以下为效果图