From 5969c0b9cd0ba3ecad65fd548eac465b7a562e0c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 15 Feb 2019 15:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E5=87=BA=E5=B1=82=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/run.bat | 1 - .../main/resources/static/ruoyi/js/ry-ui.js | 24 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/bin/run.bat b/bin/run.bat index a49052e9..90073a82 100644 --- a/bin/run.bat +++ b/bin/run.bat @@ -3,7 +3,6 @@ echo. echo [信息] 运行Web工程。 echo. -%~d0 cd %~dp0 cd ../ruoyi-admin/target 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 1d3493c1..9162edd1 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 @@ -99,10 +99,10 @@ tooltip: function (value, length) { var _length = $.common.isEmpty(length) ? 20 : length; var _text = ""; - if (value.length > _length) { + if ($.common.isNotEmpty(value) && value.length > _length) { _text = value.substr(0, _length) + "..."; } else { - _text = value; + _text = $.common.nullToStr(value); } return '' + _text +''; }, @@ -396,7 +396,7 @@ }); }, // 寮瑰嚭灞傛寚瀹氬搴 - open: function (title, url, width, height) { + open: function (title, url, width, height, callback) { //濡傛灉鏄Щ鍔ㄧ锛屽氨浣跨敤鑷傚簲澶у皬寮圭獥 if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) { width = 'auto'; @@ -414,6 +414,12 @@ if ($.common.isEmpty(height)) { height = ($(window).height() - 50); }; + if ($.common.isEmpty(callback)) { + callback = function(index, layero) { + var iframeWin = layero.find('iframe')[0]; + iframeWin.contentWindow.submitHandler(); + } + } layer.open({ type: 2, area: [width + 'px', height + 'px'], @@ -426,10 +432,7 @@ btn: ['纭畾', '鍏抽棴'], // 寮瑰眰澶栧尯鍩熷叧闂 shadeClose: true, - yes: function(index, layero) { - var iframeWin = layero.find('iframe')[0]; - iframeWin.contentWindow.submitHandler(); - }, + yes: callback, cancel: function(index) { return true; } @@ -912,6 +915,13 @@ isNotEmpty: function (value) { return !$.common.isEmpty(value); }, + // 绌哄璞¤浆瀛楃涓 + nullToStr: function(value) { + if ($.common.isEmpty(value)) { + return '-' + } + return value; + }, // 鏄惁鏄剧ず鏁版嵁 涓虹┖榛樿涓烘樉绀 visible: function (value) { if ($.common.isEmpty(value) || value == true) {