From b45feeb60e3fc90ac455647c374ff823bd4d4b4b Mon Sep 17 00:00:00 2001 From: lovewcy51 <5366512+lovewcy51@user.noreply.gitee.com> Date: Sun, 27 Mar 2022 09:30:33 +0000 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=88=97=E8=A1=A8loading?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=9A=84=E6=95=88=E6=9E=9C=EF=BC=8C=E8=AE=A9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9C=8B=E8=B5=B7=E6=9D=A5=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=9C=89=E7=82=B9=E6=85=A2=EF=BC=8C=E5=8A=A0=E4=B8=AA=E5=BC=80?= =?UTF-8?q?=E5=85=B3=EF=BC=8C=E8=87=AA=E7=94=B1=E9=80=89=E6=8B=A9=EF=BC=8C?= =?UTF-8?q?=E6=94=BE=E5=9C=A8=E5=8F=B3=E4=BE=A7=E9=A3=8E=E6=A0=BC=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=87=8C=E9=9D=A2=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/system/admin/theme.html | 12 +++++++++--- public/static/system/module/admin.js | 10 +++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/admin/view/system/admin/theme.html b/app/admin/view/system/admin/theme.html index bef8e16b..1d267bbb 100644 --- a/app/admin/view/system/admin/theme.html +++ b/app/admin/view/system/admin/theme.html @@ -59,7 +59,7 @@
- +
@@ -284,8 +284,14 @@ }) // 路由动画 - layui.form.on('switch(router)',function(obj) { - layer.msg('系统已内置loading','info'); + var router = admin.getStorage('showloading'); + if (typeof router == 'undefined') { + router = admin.options.showloading; + } + $('.router').prop('checked', router); + layui.form.on('switch(router)',function(obj) { + admin.setStorage('showloading',obj.elem.checked); + layer.msg('系统已内置loading切换成功','info'); }) // 重置选项 diff --git a/public/static/system/module/admin.js b/public/static/system/module/admin.js index 6a0fbeab..2b1a2669 100644 --- a/public/static/system/module/admin.js +++ b/public/static/system/module/admin.js @@ -45,7 +45,7 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl fluid: true, // 是否内容铺满 openHeader: true, openFooter: true, - + showloading: false, //是否加载路由动画,默认关闭。 }, getSpinningHtml: function () { return ['
', @@ -2060,7 +2060,9 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl } // 增加动画 - admin.showLoading($('iframe[lay-id="' + url + '"]').parent()); + if(admin.getStorage('showloading')) { + admin.showLoading($('iframe[lay-id="' + url + '"]').parent()); + } element.render("breadcrumb"); element.tabChange(TABFILTER, id); } @@ -2084,7 +2086,9 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl admin.setBreadHtml(); element.render("breadcrumb"); - admin.showLoading($('#swiftadmin-iframe')); + if(admin.getStorage('showloading')) { + admin.showLoading($('#swiftadmin-iframe')); + } } // 添加到选项卡 -- Gitee