多tab页完成

This commit is contained in:
caoqianming 2021-05-19 21:54:58 +08:00
parent 268d47c267
commit 96d60bf2d4
7 changed files with 94 additions and 12 deletions

View File

@ -206,6 +206,18 @@
.icon-offence { .icon-offence {
background: url('icons/offence.png') no-repeat center center; background: url('icons/offence.png') no-repeat center center;
} }
.icon-safelist {
background: url('icons/safelist.png') no-repeat center center;
}
.icon-dutylist {
background: url('icons/dutyist.png') no-repeat center center;
}
.icon-worklist {
background: url('icons/worklist.png') no-repeat center center;
}
.icon-feedbacklist {
background: url('icons/feedbacklist.png') no-repeat center center;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

View File

@ -77,8 +77,8 @@
<div id='Loading' class="loading"> <div id='Loading' class="loading">
<font>加载中···</font> <font>加载中···</font>
</div> </div>
<div id="tt" class="easyui-tabs" data-options="region:'center',border:false"> <div id="tt" region="center" class="easyui-tabs">
<div title="主页" id='main' href="mainhtml" style="overflow-x:hidden;"> <div title="主页" href="/mainhtml" id="main">
</div> </div>
</div> </div>
<div region="north" class="northDiv"> <div region="north" class="northDiv">
@ -177,8 +177,77 @@
<div id="questiondd" style="overflow: hidden;"></div> <div id="questiondd" style="overflow: hidden;"></div>
<input type="hidden" id="in" show="" total="" target="" show2="" /> <input type="hidden" id="in" show="" total="" target="" show2="" />
<!-- <button type="hidden" id="getb" onclick="test()" /> --> <!-- <button type="hidden" id="getb" onclick="test()" /> -->
<div id="rcmenu" class="easyui-menu">
<div id="closecur">
关闭
</div>
<div id="closeall">
关闭全部
</div>
<div id="closeother">
关闭其他
</div>
</div>
<script> <script>
$(document).ready(function () {
$('#tt').tabs({
border: false,
onSelect: function (title) {
var allTabs = $('#tt').tabs('tabs');
var selectTab = $('#tt').tabs('getSelected');
for (var i = 0; i < allTabs.length; i++) {
if (allTabs[i].panel('options').title != selectTab.panel('options').title) {
$('#tt').tabs('update', {
tab: allTabs[i],
options: {
content: 'Tab Body'
}
});
}
}
selectTab.panel('refresh')
}
});
$(".tabs-header").bind('contextmenu',function(e){
e.preventDefault();
$('#rcmenu').menu('show', {
left: e.pageX,
top: e.pageY
});
});
//关闭当前标签页
$("#closecur").bind("click",function(){
var tab = $('#tt').tabs('getSelected');
var index = $('#tt').tabs('getTabIndex',tab);
if(index!=0){
$('#tab').tabs('close',index);
}
});
//关闭所有标签页
$("#closeall").bind("click",function(){
var tablist = $('#tt').tabs('tabs');
for(var i=tablist.length-1;i>0;i--){
$('#tt').tabs('close',i);
}
});
//关闭非当前标签页(先关闭右侧,再关闭左侧)
$("#closeother").bind("click",function(){
var tablist = $('#tt').tabs('tabs');
var tab = $('#tt').tabs('getSelected');
var index = $('#tt').tabs('getTabIndex',tab);
for(var i=tablist.length-1;i>index;i--){
$('#tt').tabs('close',i);
}
var num = index-1;
for(var i=num;i>0;i--){
$('#tt').tabs('close',i);
}
});
});
$.messager.show({ $.messager.show({
title: '提示', title: '提示',
msg: '每晚10点-11点为维护时间,请尽量不在此时间使用', msg: '每晚10点-11点为维护时间,请尽量不在此时间使用',
@ -284,7 +353,7 @@
$("#main").attr('value', 'listall'); $("#main").attr('value', 'listall');
// $("#main").panel({ href: node.attributes, title: node.text }); // $("#main").panel({ href: node.attributes, title: node.text });
let title = node.text let title = node.text
if ($('#tt').tabs('tabs').length>7){ if ($('#tt').tabs('tabs').length > 10) {
alert('标签页过多,请先关闭') alert('标签页过多,请先关闭')
return return
} }
@ -298,13 +367,13 @@
title: title, title: title,
href: node.attributes, href: node.attributes,
closable: true, closable: true,
tools:[{ // tools: [{
iconCls:'icon-mini-refresh', // iconCls: 'icon-mini-refresh',
handler:function(){ // handler: function () {
var tab = $('#tt').tabs('getSelected'); // get selected panel // var tab = $('#tt').tabs('getSelected'); // get selected panel
tab.panel('refresh'); // tab.panel('refresh');
} // }
}] // }]
}); });
} }
}, },

View File

@ -1,3 +1,4 @@
<div style="margin-left: 10px;margin-right:10px;overflow: hidden;">
<div style="width:100%;height:300px;padding: 20px;"> <div style="width:100%;height:300px;padding: 20px;">
<div id="map1div" style="width: 33%; height:100%;float:left;"></div> <div id="map1div" style="width: 33%; height:100%;float:left;"></div>
<div id="map2div" style="width: 66%; height:100%;float:left;"></div> <div id="map2div" style="width: 66%; height:100%;float:left;"></div>
@ -330,7 +331,7 @@ float: left;">
<div id="panelx" class="easyui-panel" data-options="iconCls:'fa-bar-chart'" > <div id="panelx" class="easyui-panel" data-options="iconCls:'fa-bar-chart'" >
</div> </div>
</div>
<script type="text/javascript"> <script type="text/javascript">
//首页总数统计 //首页总数统计