소스 검색

针对性屏蔽Enter

RuoYi 5 년 전
부모
커밋
2c8365b605
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 3
      ruoyi-admin/src/main/resources/static/ruoyi/js/common.js
  2. 1 1
      ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

+ 5 - 3
ruoyi-admin/src/main/resources/static/ruoyi/js/common.js

@@ -55,9 +55,11 @@ $(function() {
 	});
 	
 	// 取消回车自动提交表单
-	$(document).on("keypress", "form", function(event) { 
-	    return event.keyCode != 13;
-	});
+	$(document).on("keypress", ":input:not(textarea):not([type=submit])", function(event) {
+        if (event.keyCode == 13) {
+            event.preventDefault();
+        }
+    });
 	 
 	// laydate 时间控件绑定
 	if ($(".select-time").length > 0) {

+ 1 - 1
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -289,7 +289,7 @@ var table = {
 					_value = _value.replace(/\'/g,"'");
 					_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('<input 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" data-target="%s" title="%s">%s</a>', _target, _value, _text));
 					return actions.join('');
 				} else {