From ec7641eb3b28abe45d58cb4887a26733307f100d Mon Sep 17 00:00:00 2001 From: zhizous Date: Mon, 6 Apr 2020 18:13:55 +0800 Subject: [PATCH] =?UTF-8?q?var=20okConfig=20=3D=20{=20=20=20=20theme:=20"b?= =?UTF-8?q?lue=5Ftheme",=20//=E4=B8=BB=E9=A2=98=E8=89=B2orange=5Ftheme|blu?= =?UTF-8?q?e=5Ftheme=20=20=20=20menuArrow:=20"ok-arrow2",=20//=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E7=AE=AD=E5=A4=B4ok-arrow2:=E7=AE=AD=E5=A4=B4,?= =?UTF-8?q?=E4=B8=8D=E5=A1=AB=E4=B8=BA=E9=BB=98=E8=AE=A4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=20=20=20=20isTabMemory:=20true,=20=20//=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E6=98=AF=E5=90=A6=E8=AE=B0=E4=BD=8F=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E6=89=93=E5=BC=80tab=E8=8F=9C=E5=8D=95=20=20=20=20isTabRefresh?= =?UTF-8?q?:=20false,=20//=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=B7=E6=96=B0=20};?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/okconfig.js | 4 ++-- lib/layui/lay/okmodules/okTab.js | 6 +++--- pages/system/setting.html | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/js/okconfig.js b/js/okconfig.js index 08b6765..08bd478 100644 --- a/js/okconfig.js +++ b/js/okconfig.js @@ -1,6 +1,6 @@ var okConfig = { theme: "blue_theme", //主题色orange_theme|blue_theme menuArrow: "ok-arrow2", //导航箭头ok-arrow2:箭头,不填为默认样式 - tabMemory: true, //是否开启tab刷新记忆 - tabRefresh: false, //是否开启切换刷新 + isTabMemory: true, //刷新后是否记住上次打开tab菜单 + isTabRefresh: false, //是否开启切换刷新 }; \ No newline at end of file diff --git a/lib/layui/lay/okmodules/okTab.js b/lib/layui/lay/okmodules/okTab.js index bf9faa5..a24400e 100644 --- a/lib/layui/lay/okmodules/okTab.js +++ b/lib/layui/lay/okmodules/okTab.js @@ -65,8 +65,8 @@ layui.define(["element", "jquery", "okUtils"], function (exports) { var element = layui.element, layer = layui.layer; config = okUtils.local("okConfig") || okConfig || {}; - console.log(config); - if(!config.tabMemory){ + + if(!config.isTabRefresh){ okUtils.session("tabMenu", null); okUtils.session("lay-id", null); } @@ -270,7 +270,7 @@ layui.define(["element", "jquery", "okUtils"], function (exports) { thatElem = $(elTabs[index]);//当前元素 saveTabMenuFun($); - if(config.tabRefresh){ /**切换刷新*/ + if(config.isTabRefresh){ /**切换刷新*/ $(".ok-tab-content .layui-show").find("iframe")[0].contentWindow.location.reload(true); } that.positionTab(elMove, thatElem); diff --git a/pages/system/setting.html b/pages/system/setting.html index d4783f3..94cdaf7 100644 --- a/pages/system/setting.html +++ b/pages/system/setting.html @@ -84,8 +84,8 @@ $(item).prop("checked", false); } }); - $("input[name=refresh]").prop("checked", config.tabRefresh); - $("input[name=memory]").prop("checked", config.tabMemory); + $("input[name=refresh]").prop("checked", config.isTabRefresh); + $("input[name=memory]").prop("checked", config.isTabMemory); form.render(); form.on('radio(arrow)', function (data) { //更改导航箭头样式 @@ -101,12 +101,12 @@ }); form.on('switch(refresh)', function (data) { //切换刷新 - config.tabRefresh = data.elem.checked; + config.isTabRefresh = data.elem.checked; okUtils.local("okConfig", config); }); form.on('switch(memory)', function (data) { //tab记忆 - config.tabMemory = data.elem.checked; + config.isTabRefresh = data.elem.checked; okUtils.local("okConfig", config); });