From 92c629be271c0a0536213d6d2d5af9333503b098 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Tue, 29 Apr 2025 09:16:18 +0800 Subject: [PATCH] 'commit' --- dsBase/WebRoot/component/pear/module/admin.js | 58 ++++++------------- dsBase/WebRoot/config/pear.config.yml | 3 +- .../view/hk/component/pear/module/admin.js | 6 +- 3 files changed, 23 insertions(+), 44 deletions(-) diff --git a/dsBase/WebRoot/component/pear/module/admin.js b/dsBase/WebRoot/component/pear/module/admin.js index 86dac46f..80522ed7 100644 --- a/dsBase/WebRoot/component/pear/module/admin.js +++ b/dsBase/WebRoot/component/pear/module/admin.js @@ -22,7 +22,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm var msgInstance; var body = $('body'); - var pearAdmin = new function () { + var pearAdmin = new function () { var configType = 'yml'; var configPath = 'pear.config.yml'; @@ -100,44 +100,14 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm }); } - this.bodyRender = function (param) { + this.bodyRender = function(param) { - body.on("click", ".refresh", function () { + body.on("click", ".refresh", function() { refresh(); }) if (isMuiltTab(param) === "true" || isMuiltTab(param) === true) { - - var indexTabData = {}; - // $.ajax({ - // type: "GET", - // url: "/dsBase/gtzz/getWhiceRole", - // async: false, - // success: function (res) { - // var indexHref = 'html/pages/welcome.html'; - // var _id = "indexPage"; - // - // if (param.other.report) { - // indexHref = 'view/tb/school/task_list_p.html?is_finish=0'; - // _id = "10"; - // } else { - // if (res.role_id == 232) { - // indexHref = 'html/pages/projectManagement/zbzx/index.html'; - // } else if (res.role_id == 234 || res.role_id === 243) { - // indexHref = 'html/pages/projectManagement/xx/index.html'; - // } - // } - // - // indexTabData = { - // id: _id, - // url: indexHref, - // title: param.tab.index.title, - // close: false - // } - // - // } - // }); - + bodyTab = pearTab.render({ elem: 'content', roll: true, @@ -148,13 +118,18 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm index: 0, tabMax: param.tab.max, preload: param.tab.preload, - closeEvent: function (id) { + closeEvent: function(id) { sideMenu.selectItem(id); }, - data: [indexTabData], - success: function (id) { + data: [{ + id: param.tab.index.id, + url: param.tab.index.href, + title: param.tab.index.title, + close: false + }], + success: function(id) { if (param.tab.session) { - setTimeout(function () { + setTimeout(function() { sideMenu.selectItem(id); bodyTab.positionTab(); }, 500) @@ -162,7 +137,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm } }); - bodyTab.click(function (id) { + bodyTab.click(function(id) { if (!param.tab.keepState) { bodyTab.refresh(false); } @@ -170,7 +145,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm sideMenu.selectItem(id); }) - sideMenu.click(function (dom, data) { + sideMenu.click(function(dom, data) { bodyTab.addTabOnly({ id: data.menuId, title: data.menuTitle, @@ -181,6 +156,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm compatible(); }) } else { + console.log(param); bodyFrame = pearFrame.render({ elem: 'content', title: '首页', @@ -189,7 +165,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm height: '100%' }); - sideMenu.click(function (dom, data) { + sideMenu.click(function(dom, data) { bodyFrame.changePage(data.menuUrl, true); compatible() }) diff --git a/dsBase/WebRoot/config/pear.config.yml b/dsBase/WebRoot/config/pear.config.yml index 3a3de5c1..df906446 100644 --- a/dsBase/WebRoot/config/pear.config.yml +++ b/dsBase/WebRoot/config/pear.config.yml @@ -38,7 +38,8 @@ tab: ## 首页 index: id: "10" ## 标识 ID , 建议与菜单项中的 ID 一致 - href: "view/console/console1.html" ## 页面地址 + # href: "view/console/welcome.html" ## 页面地址 + href: "html/pages/welcome.html" ## 页面地址 title: "首页" ## 标题 ## 主题配置 theme: diff --git a/dsBase/WebRoot/view/hk/component/pear/module/admin.js b/dsBase/WebRoot/view/hk/component/pear/module/admin.js index ee1d902e..75dfd856 100644 --- a/dsBase/WebRoot/view/hk/component/pear/module/admin.js +++ b/dsBase/WebRoot/view/hk/component/pear/module/admin.js @@ -22,7 +22,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm var msgInstance; var body = $('body'); - var pearAdmin = new function() { + var pearAdmin = new function() { var configType = 'yml'; var configPath = 'pear.config.yml'; @@ -99,13 +99,14 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm }); } - this.bodyRender = function(param) { + this.bodyRender = function(param) { body.on("click", ".refresh", function() { refresh(); }) if (isMuiltTab(param) === "true" || isMuiltTab(param) === true) { + bodyTab = pearTab.render({ elem: 'content', roll: true, @@ -154,6 +155,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm compatible(); }) } else { + console.log(param); bodyFrame = pearFrame.render({ elem: 'content', title: '首页',