mirror of https://gitee.com/y_project/RuoYi.git
新增页签右键操作
parent
7d7c052771
commit
8076277497
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -806,7 +806,7 @@ label {
|
|||
.bootstrap-tree-table .treetable-expander {width:16px; height: 16px; display: inline-block; position: relative; cursor: pointer;}
|
||||
.bootstrap-tree-table .treetable-selected{background: #f5f5f5 !important;}
|
||||
.bootstrap-tree-table .treetable-table{border:0 !important;margin-bottom:0}
|
||||
.bootstrap-tree-table .treetable-table tbody {display:block;height:auto;}
|
||||
.bootstrap-tree-table .treetable-table tbody {display:block;height:auto;overflow-y:auto;}
|
||||
.bootstrap-tree-table .treetable-table thead, .treetable-table tbody tr {display:table;width:100%;table-layout:fixed;}
|
||||
.bootstrap-tree-table .treetable-thead th{line-height:24px;border: 0 !important;border-radius: 4px;border-left:0px solid #e7eaec !important;border-bottom:1px solid #ccc!important;text-align: left;}
|
||||
.bootstrap-tree-table .treetable-thead tr :first-child{border-left:0 !important}
|
||||
|
|
|
@ -338,16 +338,6 @@ $(function() {
|
|||
|
||||
$('.menuTabs').on('click', '.menuTab i', closeTab);
|
||||
|
||||
//关闭其他选项卡
|
||||
function closeOtherTabs() {
|
||||
$('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function() {
|
||||
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').remove();
|
||||
$(this).remove();
|
||||
});
|
||||
$('.page-tabs-content').css("margin-left", "0");
|
||||
}
|
||||
$('.tabCloseOther').on('click', closeOtherTabs);
|
||||
|
||||
//滚动到已激活的选项卡
|
||||
function showActiveTab() {
|
||||
scrollToTab($('.menuTab.active'));
|
||||
|
@ -373,7 +363,7 @@ $(function() {
|
|||
// 点击选项卡菜单
|
||||
$('.menuTabs').on('click', '.menuTab', activeTab);
|
||||
|
||||
//刷新iframe
|
||||
// 刷新iframe
|
||||
function refreshTab() {
|
||||
var currentId = $('.page-tabs-content').find('.active').attr('data-id');
|
||||
var target = $('.RuoYi_iframe[data-id="' + currentId + '"]');
|
||||
|
@ -381,6 +371,34 @@ $(function() {
|
|||
target.attr('src', url).ready();
|
||||
}
|
||||
|
||||
// 关闭当前选项卡
|
||||
function tabCloseCurrent() {
|
||||
$('.page-tabs-content').find('.active i').trigger("click");
|
||||
}
|
||||
|
||||
//关闭其他选项卡
|
||||
function tabCloseOther() {
|
||||
$('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function() {
|
||||
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').remove();
|
||||
$(this).remove();
|
||||
});
|
||||
$('.page-tabs-content').css("margin-left", "0");
|
||||
}
|
||||
|
||||
// 关闭全部选项卡
|
||||
function tabCloseAll() {
|
||||
$('.page-tabs-content').children("[data-id]").not(":first").each(function() {
|
||||
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').remove();
|
||||
$(this).remove();
|
||||
});
|
||||
$('.page-tabs-content').children("[data-id]:first").each(function() {
|
||||
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').show();
|
||||
$(this).addClass("active");
|
||||
});
|
||||
$('.page-tabs-content').css("margin-left", "0");
|
||||
}
|
||||
|
||||
|
||||
// 全屏显示
|
||||
$('#fullScreen').on('click', function () {
|
||||
$('#wrapper').fullScreen();
|
||||
|
@ -399,22 +417,13 @@ $(function() {
|
|||
$('.tabRight').on('click', scrollTabRight);
|
||||
|
||||
// 关闭当前
|
||||
$('.tabCloseCurrent').on('click', function () {
|
||||
$('.page-tabs-content').find('.active i').trigger("click");
|
||||
});
|
||||
$('.tabCloseCurrent').on('click', tabCloseCurrent);
|
||||
|
||||
// 关闭其他
|
||||
$('.tabCloseOther').on('click', tabCloseOther);
|
||||
|
||||
// 关闭全部
|
||||
$('.tabCloseAll').on('click', function() {
|
||||
$('.page-tabs-content').children("[data-id]").not(":first").each(function() {
|
||||
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').remove();
|
||||
$(this).remove();
|
||||
});
|
||||
$('.page-tabs-content').children("[data-id]:first").each(function() {
|
||||
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').show();
|
||||
$(this).addClass("active");
|
||||
});
|
||||
$('.page-tabs-content').css("margin-left", "0");
|
||||
});
|
||||
$('.tabCloseAll').on('click', tabCloseAll);
|
||||
|
||||
// tab全屏显示
|
||||
$('.tabMaxCurrent').on('click', function () {
|
||||
|
@ -439,4 +448,48 @@ $(function() {
|
|||
$('#ax_close_max').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 右键菜单实现
|
||||
$.contextMenu({
|
||||
selector: ".page-tabs-content",
|
||||
trigger: 'right',
|
||||
autoHide: true,
|
||||
items: {
|
||||
"close_current": {
|
||||
name: "关闭当前",
|
||||
icon: "fa-close",
|
||||
callback: function(key, opt) {
|
||||
tabCloseCurrent();
|
||||
}
|
||||
},
|
||||
"close_other": {
|
||||
name: "关闭其他",
|
||||
icon: "fa-close",
|
||||
callback: function(key, opt) {
|
||||
tabCloseOther();
|
||||
}
|
||||
},
|
||||
"close_all": {
|
||||
name: "全部关闭",
|
||||
icon: "fa-close",
|
||||
callback: function(key, opt) {
|
||||
tabCloseAll();
|
||||
}
|
||||
},
|
||||
"full": {
|
||||
name: "全屏显示",
|
||||
icon: "fa-arrows-alt",
|
||||
callback: function(key, opt) {
|
||||
activeTabMax();
|
||||
}
|
||||
},
|
||||
"refresh": {
|
||||
name: "刷新页面",
|
||||
icon: "fa-refresh",
|
||||
callback: function(key, opt) {
|
||||
refreshTab();
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
});
|
|
@ -12,6 +12,7 @@
|
|||
<![endif]-->
|
||||
<link th:href="@{favicon.ico}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/animate.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/style.css}" rel="stylesheet"/>
|
||||
|
@ -156,6 +157,7 @@
|
|||
<script th:src="@{/js/bootstrap.min.js}"></script>
|
||||
<script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
|
||||
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
|
||||
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
|
||||
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=3.3.0}"></script>
|
||||
|
|
|
@ -95,10 +95,10 @@
|
|||
formatter: function(value, row, index) {
|
||||
if (row.parentId != 0) {
|
||||
var actions = [];
|
||||
actions.push('<a class="' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit"></i>编辑</a>');
|
||||
actions.push('<a class="' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deptId + '\')"><i class="fa fa-trash"></i>删除</a>');
|
||||
actions.push('<a class="' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus"></i>添加下级部门</a>');
|
||||
return $.table.dropdownToggle(actions.join(''));
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus"></i>新增</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deptId + '\')"><i class="fa fa-trash"></i>删除</a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -131,10 +131,10 @@
|
|||
align: "left",
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.menuId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.menuId + '\')"><i class="fa fa-trash"></i>删除</a>');
|
||||
actions.push('<a class="' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.menuId + '\')"><i class="fa fa-plus"></i>添加下级菜单</a> ');
|
||||
return $.table.dropdownToggle(actions.join(''));
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.menuId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.menuId + '\')"><i class="fa fa-plus"></i>新增</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.menuId + '\')"><i class="fa fa-trash"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue