From 578fa91d36a3b2ff568744d891a186884095cf2c Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 15 Aug 2025 23:16:13 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=E5=BC=80=E5=A7=8B=E5=85=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/admin/view/index/index.js | 1 + extend/base/admin/view/system/admin/add.html | 5 +- .../plugs/lay-module/layuimini/miniTab.js | 69 ++++++--- .../static/plugs/ulthon-admin/ulthon-admin.js | 140 ++++++++++++------ 4 files changed, 151 insertions(+), 64 deletions(-) diff --git a/extend/base/admin/view/index/index.js b/extend/base/admin/view/index/index.js index a9a02c0..e7f0dca 100644 --- a/extend/base/admin/view/index/index.js +++ b/extend/base/admin/view/index/index.js @@ -1,3 +1,4 @@ +window.pageType = 'index'; $(function () { var options = { iniUrl: ua.url('ajax/initAdmin'), // 初始化接口 diff --git a/extend/base/admin/view/system/admin/add.html b/extend/base/admin/view/system/admin/add.html index e33f123..fb81980 100644 --- a/extend/base/admin/view/system/admin/add.html +++ b/extend/base/admin/view/system/admin/add.html @@ -53,7 +53,10 @@
- + {notempty name='$Request.param.backTagId'} +
返回
+ {/notempty} +
diff --git a/public/static/plugs/lay-module/layuimini/miniTab.js b/public/static/plugs/lay-module/layuimini/miniTab.js index f86f6c5..d4bc158 100644 --- a/public/static/plugs/lay-module/layuimini/miniTab.js +++ b/public/static/plugs/lay-module/layuimini/miniTab.js @@ -69,14 +69,9 @@ * @param isParent */ delete: function (tabId, isParent) { - // todo 未知BUG,不知道是不是layui问题,必须先删除元素 - $('.layuimini-tab .layui-tab-title .layui-unselect.layui-tab-bar').remove(); - - if (isParent === true) { - parent.layui.element.tabDelete('layuiminiTab', tabId); - } else { - element.tabDelete('layuiminiTab', tabId); - } + ua.findIndexPage(function (window) { + window.layui.element.tabDelete('layuiminiTab', tabId); + }); }, /** @@ -117,21 +112,33 @@ check: function (tabId, isIframe) { // 判断选项卡上是否有 var checkTab = false; - if (isIframe === undefined || isIframe === false) { - $('.layui-tab-title li').each(function () { + // if (isIframe === undefined || isIframe === false) { + // $('.layui-tab-title li').each(function () { + // var checkTabId = $(this).attr('lay-id'); + // if (checkTabId != null && checkTabId === tabId) { + // checkTab = true; + // } + // }); + // } else { + // parent.layui.$('.layui-tab-title li').each(function () { + // var checkTabId = $(this).attr('lay-id'); + // if (checkTabId != null && checkTabId === tabId) { + // checkTab = true; + // } + // }); + // } + + + ua.findIndexPage(function (window) { + + window.layui.$('.layui-tab-title li').each(function () { var checkTabId = $(this).attr('lay-id'); + if (checkTabId != null && checkTabId === tabId) { checkTab = true; } }); - } else { - parent.layui.$('.layui-tab-title li').each(function () { - var checkTabId = $(this).attr('lay-id'); - if (checkTabId != null && checkTabId === tabId) { - checkTab = true; - } - }); - } + }); return checkTab; }, @@ -245,14 +252,29 @@ var tabId = $(this).attr('layuimini-content-href'), href = $(this).attr('layuimini-content-href'), title = $(this).attr('data-title'), + back = $(this).attr('data-back') || 0, + external = $(this).attr('data-external') || false, target = $(this).attr('target'); + + if(back == 0){ + if (href.indexOf("?") === -1) { + href += '?backTagId=' + ua.getCurrentPageId(); + } else { + href += '&backTagId=' + ua.getCurrentPageId(); + } + } + href = external ? href : ua.url(href); + tabId = href; + if (target === '_blank') { parent.layer.close(loading); window.open(href, '_blank'); return false; } + if (tabId === null || tabId === undefined) tabId = new Date().getTime(); var checkTab = miniTab.check(tabId, true); + if (!checkTab) { miniTab.create({ tabId: tabId, @@ -264,6 +286,11 @@ } parent.layui.element.tabChange('layuiminiTab', tabId); parent.layer.close(loading); + if(back == 1){ + console.log(back); + + miniTab.delete(ua.getCurrentPageId()); + } }); /** @@ -404,19 +431,19 @@ if (!options.urlHashLocation) return false; var tabId = location.hash.replace(/^#/, ''); if (tabId === null || tabId === undefined || tabId === '') return false; - + // 判断是否为首页 if (tabId === options.homeInfo.href || tabId === options.homeInfo.mb_href) return false; // 判断tab是否已存在 - if($('.layuimini-tab .layui-tab-content [lay-id="'+tabId+'"]').length > 0) { + if ($('.layuimini-tab .layui-tab-content [lay-id="' + tabId + '"]').length > 0) { element.tabChange('layuiminiTab', tabId); return false; } // 判断是否为右侧菜单 var menu = miniTab.searchMenu(tabId, options.menuList); - + if (menu !== undefined) { miniTab.create({ tabId: tabId, diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index 931cadd..c122eca 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -144,28 +144,28 @@ }; complete = complete || function () { }; - if(no){ + if (no) { var originalNo = no; no = function (res) { originalNo(res); complete(); - } - }else{ + }; + } else { no = function (res) { var msg = res.msg == undefined ? '返回数据格式有误' : res.msg; admin.msg.error(msg); complete(); return false; - } + }; } - if(ex){ + if (ex) { var originalEx = ex; ex = function (res) { originalEx(res); complete(); - } - }else{ + }; + } else { ex = function (res) { complete(); }; @@ -524,7 +524,7 @@ toolbarHtml += ' \n'; } else if (v === 'add') { if (admin.checkAuth('add', elem)) { - toolbarHtml += '\n'; + toolbarHtml += '\n'; } } else if (v === 'delete') { if (admin.checkAuth('delete', elem)) { @@ -1112,7 +1112,8 @@ formatToolbar.method = ''; } else if (toolbar.method === 'blank') { formatToolbar.method = ' href="' + formatToolbar.url + '" target="_blank" '; - + } else if (operat.method === 'tab') { + formatToolbar.method = ' layuimini-content-href="' + formatToolbar.url + '" data-title="' + formatToolbar.title + '"'; } else { formatToolbar.method = formatToolbar.method !== '' ? 'data-request="' + formatToolbar.url + '" data-title="' + formatToolbar.title + '" ' : ''; } @@ -2261,39 +2262,7 @@ window.open(admin.url($(this).attr('href'))); }); }, - form: function (url, data, ok, no, ex, refreshTable, close, complete) { - if (refreshTable === undefined) { - refreshTable = true; - } - if(ok){ - var originalOk = ok; - ok = function (res) { - originalOk(res); - complete() - } - }else{ - ok = function (res) { - res.msg = res.msg || ''; - admin.msg.success(res.msg, function () { - if (close) { - admin.api.closeCurrentOpen({ - refreshTable: refreshTable, - onClose: function () { - complete(); - } - }); - } - }); - return false; - }; - } - admin.request.post({ - url: url, - data: data, - }, ok, no, ex, complete); - return false; - }, closeCurrentOpen: function (option) { option = option || {}; option.refreshTable = option.refreshTable || false; @@ -2406,6 +2375,7 @@ // 判断btn是否具备name和value属性,如果有,则加到表单数据里 var btnName = $(btnElem).attr('name'); var btnValue = $(btnElem).attr('value'); + var backHref = $(btnElem).attr('data-back-href'); if (btnName !== undefined && btnValue !== undefined) { data.field[btnName] = btnValue; } @@ -2422,7 +2392,48 @@ complete = complete || function () { $(form).removeClass('loading'); }; - admin.api.form(url, dataField, ok, no, ex, refresh, close, complete); + // admin.api.form(url, dataField, ok, no, ex, refresh, close, complete); + + if (ok) { + var originalOk = ok; + ok = function (res) { + originalOk(res); + complete(); + }; + } else { + ok = function (res) { + res.msg = res.msg || ''; + admin.msg.success(res.msg, function () { + if (close) { + if (backHref) { + var backWindow = admin.findPageId(backHref); + console.log(backWindow); + console.log(option.refreshTable); + + backWindow.layui.table.reloadData(option.refreshTable); + + admin.findIndexPage(function (window) { + window.layui.element.tabDelete('layuiminiTab', backHref); + }); + + } else { + admin.api.closeCurrentOpen({ + refreshTable: refreshTable, + onClose: function () { + complete(); + } + }); + } + } + }); + return false; + }; + } + + admin.request.post({ + url: url, + data: data, + }, ok, no, ex, complete); return false; }); @@ -3097,6 +3108,51 @@ } return oldValue; + }, + isCurrentIndex() { + console.log(window.pageType); + + if (window.pageType && window.pageType == 'index') { + return true; + } + return false; + }, + findIndexPage(findCallback, missCallback) { + if (!findCallback) { + findCallback = function (w) { return w; }; + } + if (!missCallback) { + missCallback = function (w) { return w; }; + } + if (this.isCurrentIndex()) { + return findCallback(window); + } + + var parent = window.parent; + if (parent && parent != window) { + return parent.ua.findIndexPage(findCallback, missCallback); + } + + return missCallback(null); + }, + getCurrentPageId() { + // pageId就是路径加参数 + var path = location.pathname; + var params = location.search; + return path + params; + }, + findPageId(tabId) { + var iframeWindow; + this.findIndexPage(function(window){ + window.layui.$('.layui-tab-title li').each(function () { + var checkTabId = $(this).attr('lay-id'); + + if (checkTabId != null && checkTabId === tabId) { + iframeWindow = $(this).find('iframe').contentWindow + } + }); + }) + return iframeWindow } }; From d43c3d18ca8ee596a48990b81bc3add4fc85d466 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Aug 2025 22:13:42 +0800 Subject: [PATCH 2/8] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E5=85=B3=E9=97=AD=E8=87=AA=E5=8A=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + extend/base/admin/view/system/admin/add.html | 2 +- .../static/plugs/ulthon-admin/ulthon-admin.js | 70 ++++++++++--------- 3 files changed, 38 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 6ea4d5f..7e95115 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ ul.db /.VSCodeCounter result.txt test.php +/.env.prod \ No newline at end of file diff --git a/extend/base/admin/view/system/admin/add.html b/extend/base/admin/view/system/admin/add.html index fb81980..efe3ef0 100644 --- a/extend/base/admin/view/system/admin/add.html +++ b/extend/base/admin/view/system/admin/add.html @@ -56,7 +56,7 @@ {notempty name='$Request.param.backTagId'}
返回
{/notempty} - + diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index c122eca..eafd105 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -525,6 +525,7 @@ } else if (v === 'add') { if (admin.checkAuth('add', elem)) { toolbarHtml += '\n'; + // toolbarHtml += '\n'; } } else if (v === 'delete') { if (admin.checkAuth('delete', elem)) { @@ -2265,19 +2266,29 @@ closeCurrentOpen: function (option) { option = option || {}; + option.backHref = option.backHref || ''; option.refreshTable = option.refreshTable || false; option.refreshFrame = option.refreshFrame || false; option.onClose = option.onClose || function () { }; if (option.refreshTable === true) { option.refreshTable = init.tableRenderId; } + var backWindow = window.parent; + if (option.backHref) { + backWindow = admin.findPageId(option.backHref); + backWindow.layui.table.reloadData(option.refreshTable); + + admin.findIndexPage(function (window) { + window.layui.element.tabDelete('layuiminiTab', admin.getCurrentPageId()); + }); + } var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index, option.onClose); + backWindow.layer.close(index, option.onClose); if (option.refreshTable !== false) { - parent.layui.table.reloadData(option.refreshTable); + backWindow.layui.table.reloadData(option.refreshTable); } if (option.refreshFrame) { - parent.location.reload(); + backWindow.location.reload(); } return false; }, @@ -2379,11 +2390,12 @@ if (btnName !== undefined && btnValue !== undefined) { data.field[btnName] = btnValue; } + if (!backHref) { + backHref = admin.getQueryVariable('backTagId'); + } var dataField = data.field; - dataField = admin.api.formSubmitEditor(dataField, v); - dataField = admin.api.formSubmitCity(dataField, v); if (typeof preposeCallback === 'function') { @@ -2392,7 +2404,6 @@ complete = complete || function () { $(form).removeClass('loading'); }; - // admin.api.form(url, dataField, ok, no, ex, refresh, close, complete); if (ok) { var originalOk = ok; @@ -2405,25 +2416,15 @@ res.msg = res.msg || ''; admin.msg.success(res.msg, function () { if (close) { - if (backHref) { - var backWindow = admin.findPageId(backHref); - console.log(backWindow); - console.log(option.refreshTable); - - backWindow.layui.table.reloadData(option.refreshTable); - admin.findIndexPage(function (window) { - window.layui.element.tabDelete('layuiminiTab', backHref); - }); + admin.api.closeCurrentOpen({ + refreshTable: refresh, + backHref: backHref, + onClose: function () { + complete(); + } + }); - } else { - admin.api.closeCurrentOpen({ - refreshTable: refreshTable, - onClose: function () { - complete(); - } - }); - } } }); return false; @@ -2432,7 +2433,7 @@ admin.request.post({ url: url, - data: data, + data: dataField, }, ok, no, ex, complete); return false; @@ -3143,17 +3144,18 @@ }, findPageId(tabId) { var iframeWindow; - this.findIndexPage(function(window){ - window.layui.$('.layui-tab-title li').each(function () { - var checkTabId = $(this).attr('lay-id'); - - if (checkTabId != null && checkTabId === tabId) { - iframeWindow = $(this).find('iframe').contentWindow + this.findIndexPage(function (window) { + // 查找对应的tab内容区域 + var tabContent = window.layui.$('.layui-tab-content .layui-tab-item[lay-id="' + tabId + '"]'); + if (tabContent.length > 0) { + var iframe = tabContent.find('iframe')[0]; + if (iframe) { + iframeWindow = iframe.contentWindow; } - }); - }) - return iframeWindow - } + } + }); + return iframeWindow; + }, }; From 6aba138c109585f7164ade9bd43af42fd4499981 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Aug 2025 22:16:08 +0800 Subject: [PATCH 3/8] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=BB=98=E8=AE=A4=E6=96=B0tab=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/plugs/ulthon-admin/ulthon-admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index eafd105..c9015bc 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -1327,7 +1327,7 @@ case 'edit': var operat = { class: 'layui-btn layui-btn-success layui-btn-xs', - method: 'open', + method: 'tab', field: 'id', icon: '', text: '编辑', From 49a58206d877484ed781a76b3d896e99f18ce055 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Aug 2025 22:21:08 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E6=96=B0tab?= =?UTF-8?q?=E6=89=93=E5=BC=80=E8=BF=94=E5=9B=9E=E6=97=B6=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E7=BC=BA=E5=B0=91=E7=9A=84tab=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/plugs/ulthon-admin/ulthon-admin.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index c9015bc..0b55116 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -2275,13 +2275,26 @@ } var backWindow = window.parent; if (option.backHref) { + // 标签打开页面,需要返回上一个标签刷新的情况 backWindow = admin.findPageId(option.backHref); - backWindow.layui.table.reloadData(option.refreshTable); - + if (backWindow) { + backWindow.layui.table.reloadData(option.refreshTable); + } else { + admin.findIndexPage(function (window) { + window.miniTab.create({ + tabId: option.backHref, + href: option.backHref, + title: 'xxx', + isIframe: true, + }); + }); + } admin.findIndexPage(function (window) { window.layui.element.tabDelete('layuiminiTab', admin.getCurrentPageId()); }); + return; } + // 弹框保存后刷新的情况 var index = parent.layer.getFrameIndex(window.name); backWindow.layer.close(index, option.onClose); if (option.refreshTable !== false) { From f2b2b057e228f7fa24634581c41eb0ed2b34cd62 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Aug 2025 22:37:04 +0800 Subject: [PATCH 5/8] =?UTF-8?q?feat:=20=E5=9B=9E=E9=80=80=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=EF=BC=8C=E5=88=99=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=B9=B6=E4=BB=8E=E8=8F=9C=E5=8D=95=E8=AF=BB=E5=8F=96=E6=A0=87?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/plugs/lay-module/layuimini/miniTab.js | 9 +++++++++ public/static/plugs/ulthon-admin/ulthon-admin.js | 11 +++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/public/static/plugs/lay-module/layuimini/miniTab.js b/public/static/plugs/lay-module/layuimini/miniTab.js index d4bc158..2120d0a 100644 --- a/public/static/plugs/lay-module/layuimini/miniTab.js +++ b/public/static/plugs/lay-module/layuimini/miniTab.js @@ -1,13 +1,17 @@ (function () { var element = layui.element; $ = layui.$; + var miniTab = { + renderOptions:{}, /** * 初始化tab * @param options */ render: function (options) { + this.renderOptions = options; + options.filter = options.filter || null; options.urlHashLocation = options.urlHashLocation || false; options.maxTabNum = options.maxTabNum || 20; @@ -180,6 +184,10 @@ * @param menuList */ searchMenu: function (href, menuList) { + if(!menuList){ + menuList = this.renderOptions.menuList + } + var menu; for (key in menuList) { var item = menuList[key]; @@ -393,6 +401,7 @@ listenSwitch: function (options) { options.filter = options.filter || null; options.urlHashLocation = options.urlHashLocation || false; + options.listenSwichCallback = options.listenSwichCallback || function () { }; element.on('tab(' + options.filter + ')', function (data) { var tabId = $(this).attr('lay-id'); diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index 0b55116..bd9fc08 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -1141,7 +1141,6 @@ var titleEndfix = ''; if (typeof operat.titleField == 'function') { - console.log(operat.titleField(data, operat)); titleEndfix = operat.titleField(data, operat); } else if (data[operat.titleField]) { @@ -2281,10 +2280,16 @@ backWindow.layui.table.reloadData(option.refreshTable); } else { admin.findIndexPage(function (window) { + var menu = window.miniTab.searchMenu(option.backHref); + var title = option.backHref + + if(menu){ + title = menu.title; + } window.miniTab.create({ tabId: option.backHref, href: option.backHref, - title: 'xxx', + title: title, isIframe: true, }); }); @@ -3124,8 +3129,6 @@ return oldValue; }, isCurrentIndex() { - console.log(window.pageType); - if (window.pageType && window.pageType == 'index') { return true; } From f0dc6d118ba9ea43aee5a51ea2c46065870c69a4 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Aug 2025 22:40:34 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/admin/view/system/admin/edit.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extend/base/admin/view/system/admin/edit.html b/extend/base/admin/view/system/admin/edit.html index bb4f4cc..f634b0d 100644 --- a/extend/base/admin/view/system/admin/edit.html +++ b/extend/base/admin/view/system/admin/edit.html @@ -53,6 +53,9 @@
+ {notempty name='$Request.param.backTagId'} +
返回
+ {/notempty}
From 5eb4d787c738c9c7d2a4962d6cf074238e5c3c76 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Aug 2025 22:56:08 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A1=B6=E7=BA=A7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=89=93=E5=BC=80tab=E7=9A=84=E5=86=99?= =?UTF-8?q?=E6=B3=95=E5=85=BC=E5=AE=B9=E6=80=A7=E4=B8=8D=E5=A5=BD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/plugs/ulthon-admin/ulthon-admin.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js index bd9fc08..c6e1a7e 100644 --- a/public/static/plugs/ulthon-admin/ulthon-admin.js +++ b/public/static/plugs/ulthon-admin/ulthon-admin.js @@ -2290,7 +2290,6 @@ tabId: option.backHref, href: option.backHref, title: title, - isIframe: true, }); }); } From 9493134c56b6e64e0989c1b6dfddf8bac6ddb006 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 21 Aug 2025 22:56:19 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=95=88=E6=9E=9C=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/curd/templates/view/form.code | 3 ++ .../plugs/lay-module/layuimini/miniTab.js | 39 ++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/extend/base/admin/service/curd/templates/view/form.code b/extend/base/admin/service/curd/templates/view/form.code index 9e92c33..6107bbb 100644 --- a/extend/base/admin/service/curd/templates/view/form.code +++ b/extend/base/admin/service/curd/templates/view/form.code @@ -3,6 +3,9 @@ {{formList}}
+ {notempty name='$Request.param.backTagId'} +
返回
+ {/notempty}
diff --git a/public/static/plugs/lay-module/layuimini/miniTab.js b/public/static/plugs/lay-module/layuimini/miniTab.js index 2120d0a..72f47cf 100644 --- a/public/static/plugs/lay-module/layuimini/miniTab.js +++ b/public/static/plugs/lay-module/layuimini/miniTab.js @@ -1,10 +1,10 @@ (function () { var element = layui.element; $ = layui.$; - + var miniTab = { - renderOptions:{}, + renderOptions: {}, /** * 初始化tab * @param options @@ -73,7 +73,7 @@ * @param isParent */ delete: function (tabId, isParent) { - ua.findIndexPage(function (window) { + ua.findIndexPage(function (window) { window.layui.element.tabDelete('layuiminiTab', tabId); }); }, @@ -131,13 +131,13 @@ // } // }); // } - - + + ua.findIndexPage(function (window) { window.layui.$('.layui-tab-title li').each(function () { var checkTabId = $(this).attr('lay-id'); - + if (checkTabId != null && checkTabId === tabId) { checkTab = true; } @@ -184,10 +184,10 @@ * @param menuList */ searchMenu: function (href, menuList) { - if(!menuList){ - menuList = this.renderOptions.menuList + if (!menuList) { + menuList = this.renderOptions.menuList; } - + var menu; for (key in menuList) { var item = menuList[key]; @@ -264,7 +264,8 @@ external = $(this).attr('data-external') || false, target = $(this).attr('target'); - if(back == 0){ + + if (back == 0) { if (href.indexOf("?") === -1) { href += '?backTagId=' + ua.getCurrentPageId(); } else { @@ -282,8 +283,18 @@ if (tabId === null || tabId === undefined) tabId = new Date().getTime(); var checkTab = miniTab.check(tabId, true); - + if (!checkTab) { + if (!title) { + title = tabId; + ua.findIndexPage(function (window) { + var menu = window.miniTab.searchMenu(tabId); + + if (menu) { + title = menu.title; + } + }); + } miniTab.create({ tabId: tabId, href: href, @@ -294,9 +305,9 @@ } parent.layui.element.tabChange('layuiminiTab', tabId); parent.layer.close(loading); - if(back == 1){ + if (back == 1) { console.log(back); - + miniTab.delete(ua.getCurrentPageId()); } }); @@ -401,7 +412,7 @@ listenSwitch: function (options) { options.filter = options.filter || null; options.urlHashLocation = options.urlHashLocation || false; - + options.listenSwichCallback = options.listenSwichCallback || function () { }; element.on('tab(' + options.filter + ')', function (data) { var tabId = $(this).attr('lay-id');