From c92ed664362cfae3b605264167f5cd98c34dce5d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 12 Jan 2023 17:31:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B5=E7=AD=BE=E5=B1=9E?= =?UTF-8?q?=E6=80=A7refresh=E4=B8=BAundefined=E6=97=B6=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=A2=AB=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/static/ruoyi/index.js | 2 +- ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/index.js b/ruoyi-admin/src/main/resources/static/ruoyi/index.js index d6addefa8..5a60670cf 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/index.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/index.js @@ -440,7 +440,7 @@ $(function() { $('.mainContent .RuoYi_iframe').each(function() { if ($(this).data('id') == currentId) { $(this).show().siblings('.RuoYi_iframe').hide(); - isRefresh = $(this).data('refresh'); + isRefresh = $.common.nullToDefault($(this).data('refresh'), false); return false; } }); 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 88df2a1e2..cdcd0fb5d 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 @@ -1563,6 +1563,10 @@ var table = { isNotEmpty: function (value) { return !$.common.isEmpty(value); }, + // 如果值是空,则返回指定默认字符串,否则返回字符串本身 + nullToDefault: function (value, defaultValue) { + return $.common.isEmpty(value) ? defaultValue : value; + }, // 空对象转字符串 nullToStr: function(value) { if ($.common.isEmpty(value)) {