From 0ebd155be48edbdcc7c324cadca181b5bf337d9a Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 18 Oct 2019 17:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=AE=E5=8A=A8=E6=8F=90=E7=A4=BA=E6=96=B9?= =?UTF-8?q?=E6=B3=95tooltip=E6=94=AF=E6=8C=81=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ruoyi/js/ry-ui.js | 23 ++++++++++++++----- .../src/main/resources/templates/index.html | 2 +- .../templates/system/config/config.html | 12 +++++++--- 3 files changed, 27 insertions(+), 10 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 6eedb1715..e91fa2453 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 @@ -177,11 +177,21 @@ window.open(src); } }); - // 单击tooltip复制文本 + // 单击tooltip事件 $.btTable.on('click', '.tooltip-show', function() { + var target = $(this).data('target'); var input = $(this).prev(); - input.select(); - document.execCommand("copy"); + if ($.common.equals("0", target)) { + input.select(); + document.execCommand("copy"); + } else if ($.common.equals("1", target)) { + parent.layer.alert(input.val(), { + title: "信息内容", + shadeClose: true, + btn: ['确认'], + btnclass: ['btn btn-primary'], + }); + } }); }, // 当所有数据被加载时触发 @@ -204,17 +214,18 @@ var pageNumber = table.pageNumber; return pageSize * (pageNumber - 1) + index + 1; }, - // 列超出指定长度浮动提示(单击文本复制) - tooltip: function (value, length) { + // 列超出指定长度浮动提示(target=0单击文本复制,不弹窗,target=1弹窗打开) + tooltip: function (value, length, target) { var _length = $.common.isEmpty(length) ? 20 : length; var _text = ""; var _value = $.common.nullToStr(value); + var _target = $.common.isEmpty(target) ? '0' : target; if (_value.length > _length) { _text = _value.substr(0, _length) + "..."; _value = _value.replace(/\'/g,"’"); var actions = []; actions.push($.common.sprintf('', _value)); - actions.push($.common.sprintf("%s", _value, _text)); + actions.push($.common.sprintf("%s", _target, _value, _text)); return actions.join(''); } else { _text = _value; diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index e431060e3..829d99ef4 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -262,7 +262,7 @@ if($.common.isNotEmpty(skin)){ /* 用户管理-重置密码 */ function resetPwd() { var url = ctx + 'system/user/profile/resetPwd'; - $.modal.open("重置密码", url, '800', '500'); + $.modal.open("重置密码", url, '770', '380'); } /* 切换主题 */ function switchSkin() { diff --git a/ruoyi-admin/src/main/resources/templates/system/config/config.html b/ruoyi-admin/src/main/resources/templates/system/config/config.html index 0195ac73f..aa3b4334c 100644 --- a/ruoyi-admin/src/main/resources/templates/system/config/config.html +++ b/ruoyi-admin/src/main/resources/templates/system/config/config.html @@ -82,11 +82,17 @@ }, { field: 'configName', - title: '参数名称' + title: '参数名称', + formatter: function(value, row, index) { + return $.table.tooltip(value); + } }, { field: 'configKey', - title: '参数键名' + title: '参数键名', + formatter: function(value, row, index) { + return $.table.tooltip(value); + } }, { field: 'configValue', @@ -105,7 +111,7 @@ title: '备注', align: 'center', formatter: function(value, row, index) { - return $.table.tooltip(value); + return $.table.tooltip(value, 10, 1); } }, {