Ver código fonte

浮动提示方法tooltip支持弹窗

RuoYi 5 anos atrás
pai
commit
0ebd155be4

+ 17 - 6
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('<input id="tooltip-show" style="opacity: 0;position: absolute;z-index:-1" type="text" value="%s"/>', _value));
-                	actions.push($.common.sprintf("<a href='###' class='tooltip-show' data-toggle='tooltip' title='%s'>%s</a>", _value, _text));
+                	actions.push($.common.sprintf("<a href='###' class='tooltip-show' data-toggle='tooltip' data-target='%s' title='%s'>%s</a>", _target, _value, _text));
 					return actions.join('');
 				} else {
 					_text = _value;

+ 1 - 1
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() {

+ 9 - 3
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);
                     }
                 },
                 {