From df46c8b83c722c3f9cf781c95771624f5f0d67ee Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 28 Jun 2020 11:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81openOptions=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E6=8C=89=E9=92=AE=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ruoyi/js/ry-ui.js | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) 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 7b1951b5..48312655 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 @@ -801,22 +801,31 @@ var table = { options.callBack(index, layero); } } - layer.open({ - type: 2, - maxmin: true, - shade: 0.3, - title: _title, - fix: false, - area: [_width + 'px', _height + 'px'], - content: _url, - shadeClose: $.common.isEmpty(options.shadeClose) ? true : options.shadeClose, - skin: options.skin, - btn: $.common.isEmpty(options.btn) ? _btn : options.btn, - yes: options.yes, - cancel: function () { - return true; - } - }); + var btnCallback = {}; + if(options.btn instanceof Array){ + for (var i = 1, len = options.btn.length; i < len; i++) { + var btn = options["btn" + (i + 1)]; + if (btn) { + btnCallback["btn" + (i + 1)] = btn; + } + } + } + layer.open($.extend({ + type: 2, + maxmin: true, + shade: 0.3, + title: _title, + fix: false, + area: [_width + 'px', _height + 'px'], + content: _url, + shadeClose: $.common.isEmpty(options.shadeClose) ? true : options.shadeClose, + skin: options.skin, + btn: $.common.isEmpty(options.btn) ? _btn : options.btn, + yes: options.yes, + cancel: function () { + return true; + } + }, btnCallback)); }, // 弹出层全屏 openFull: function (title, url, width, height) {