From 451d6fe86132c47cc87ab60ab72d585890b20639 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 11 Jul 2019 19:03:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=97=E8=B6=85=E5=87=BA?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=95=BF=E5=BA=A6=E6=B5=AE=E5=8A=A8=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=EF=BC=88=E5=8D=95=E5=87=BB=E6=96=87=E6=9C=AC=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E5=88=97=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/ruoyi/js/ry-ui.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 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 ecefd2a7..2b030c32 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 @@ -169,6 +169,12 @@ window.open(src); } }); + // 单击tooltip复制文本 + $.btTable.on('click', '.tooltip-show', function() { + var input = $(this).prev(); + input.select(); + document.execCommand("copy"); + }); }, // 当所有数据被加载时触发 onLoadSuccess: function(data) { @@ -190,14 +196,18 @@ var pageNumber = table.pageNumber; return pageSize * (pageNumber - 1) + index + 1; }, - // 列超出指定长度浮动提示 + // 列超出指定长度浮动提示(单击文本复制列) tooltip: function (value, length) { var _length = $.common.isEmpty(length) ? 20 : length; var _text = ""; var _value = $.common.nullToStr(value); if (_value.length > _length) { _text = _value.substr(0, _length) + "..."; - return $.common.sprintf("%s", _value, _text); + _value = _value.replace(/\'/g,"’"); + var actions = []; + actions.push($.common.sprintf('', _value)); + actions.push($.common.sprintf("%s", _value, _text)); + return actions.join(''); } else { _text = _value; return _text;