diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js index b4c08785..20b10e00 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js @@ -155,8 +155,16 @@ var refreshItem = function(){ } /** 关闭选项卡 */ -var closeItem = function(){ +var closeItem = function(dataId){ var topWindow = $(window.parent.document); + if($.common.isNotEmpty(dataId)){ + window.parent.$.modal.closeLoading(); + // 根据dataId关闭指定选项卡 + $('.menuTab[data-id="' + dataId + '"]', topWindow).remove(); + // 移除相应tab对应的内容区 + $('.mainContent .RuoYi_iframe[data-id="' + dataId + '"]', topWindow).remove(); + return; + } var panelUrl = window.frameElement.getAttribute('data-panel'); $('.page-tabs-content .active i', topWindow).click(); if($.common.isNotEmpty(panelUrl)){ diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 66799b84..816f9c0d 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -701,6 +701,12 @@ openTab: function (title, url) { createMenuItem(url, title); }, + // 选卡页同一页签打开 + parentTab: function (title, url) { + var dataId = window.frameElement.getAttribute('data-id'); + createMenuItem(url, title); + closeItem(dataId); + }, // 关闭选项卡 closeTab: function () { closeItem(); diff --git a/ruoyi-admin/src/main/resources/templates/system/dict/type/type.html b/ruoyi-admin/src/main/resources/templates/system/dict/type/type.html index b15cc1c5..62a303ee 100644 --- a/ruoyi-admin/src/main/resources/templates/system/dict/type/type.html +++ b/ruoyi-admin/src/main/resources/templates/system/dict/type/type.html @@ -130,7 +130,7 @@ /*字典列表-详细*/ function detail(dictId) { var url = prefix + '/detail/' + dictId; - createMenuItem(url, "字典数据"); + $.modal.openTab("字典数据", url); } diff --git a/ruoyi-admin/src/main/resources/templates/system/user/user.html b/ruoyi-admin/src/main/resources/templates/system/user/user.html index be0f01ac..ed3d12c7 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/user.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/user.html @@ -210,7 +210,7 @@ /* 用户管理-部门 */ function dept() { var url = ctx + "system/dept"; - createMenuItem(url, "部门管理"); + $.modal.openTab("部门管理", url); } /* 用户管理-重置密码 */ diff --git a/ruoyi-quartz/src/main/resources/templates/monitor/job/job.html b/ruoyi-quartz/src/main/resources/templates/monitor/job/job.html index 62b8625d..92fbef27 100644 --- a/ruoyi-quartz/src/main/resources/templates/monitor/job/job.html +++ b/ruoyi-quartz/src/main/resources/templates/monitor/job/job.html @@ -166,7 +166,7 @@ /* 调度日志查询 */ function jobLog(id) { var url = ctx + 'monitor/jobLog'; - createMenuItem(url, "调度日志"); + $.modal.openTab("调度日志", url); }