From 8e8b310e5b699d6b32d9b01af9b94e7859100531 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 10 七月 2020 10:25:53 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/pdaCe/index.html |   18 ++++++++++++------
 src/main/webapp/views/pdaCe/login.html |    9 +--------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/src/main/webapp/views/pdaCe/index.html b/src/main/webapp/views/pdaCe/index.html
index a253204..0552383 100644
--- a/src/main/webapp/views/pdaCe/index.html
+++ b/src/main/webapp/views/pdaCe/index.html
@@ -134,7 +134,7 @@
 
 <div id="btn-con">
     <button style="margin-right: 20px" onclick="reset()">閲嶇疆</button>
-    <button onclick="comb()">缁勬墭</button>
+    <button id="comb" onclick="comb()">缁勬墭</button>
     <span id="tips"></span>
 </div>
 
@@ -171,11 +171,13 @@
     var ttbody = document.getElementById("ttbody");
     var btnCon = document.getElementById("btn-con");
     var tipDom = document.getElementById("tips");
+    var combBtn = document.getElementById("comb");
 
     var matDetail = document.getElementById("mat-detail");
     var matName = document.getElementById("matName");
     var str1 = document.getElementById("str1");
     var count = document.getElementById("count");
+    var confirmBtn = document.getElementById("confirm");
 
     matDetail.style.display = 'none';
     var initMatCount = 1;
@@ -200,6 +202,7 @@
                     matName.value = res.data.matName;
                     str1.value = res.data.str1;
                     count.value = initMatCount;
+                    document.getElementById("confirm").focus();
                 } else {
                     matMsg.style.display = 'block';
                     btnCon.style.display = 'block';
@@ -410,7 +413,6 @@
             requestData += name + '='+ paramData[name] + '&';
         }
         requestData = requestData === '' ? '' : requestData.substring(0,requestData.length - 1);
-        console.log(requestData)
         /*璇锋眰鎺ユ敹*/
         xmlhttp.onreadystatechange = function() {
             if(xmlhttp.readyState === 4 && xmlhttp.status === 200) {
@@ -445,12 +447,16 @@
         }
     }
 
-    document.onkeyup = function (e) {
+    document.onkeydown = function (e) {
         if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯
             e = window.event;
-        var code = e.charCode || e.keyCode;
-        if (code === 13) {
-            comb()
+        var code1 = e.charCode || e.keyCode;
+        if (code1 === 13) {
+            if (window.getComputedStyle(matDetail).display === 'block') {
+                confirm()
+            } else if (window.getComputedStyle(btnCon).display === 'block') {
+                comb()
+            }
         }
     }
 
diff --git a/src/main/webapp/views/pdaCe/login.html b/src/main/webapp/views/pdaCe/login.html
index 1db6f01..4e56302 100644
--- a/src/main/webapp/views/pdaCe/login.html
+++ b/src/main/webapp/views/pdaCe/login.html
@@ -26,7 +26,7 @@
             <input type="password" id="password" value="xltys1995">
         </div>
         <div>
-            <button onclick="login()">鐧诲綍</button>
+            <button id="login" onclick="login()">鐧诲綍</button>
         </div>
 
     </div>
@@ -34,13 +34,6 @@
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
 <script type="text/javascript" src="../../static/js/tools/md5.js"></script>
 <script type="text/javascript">
-    document.onkeydown = function(e) {
-        //鎹曟崏鍥炶溅浜嬩欢
-        var ev = (typeof event!= 'undefined') ? window.event : e;
-        if(ev.keyCode === 13 && document.activeElement.id === "key") {
-            login()
-        }
-    }
     document.onkeyup = function (e) {
         if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯
             e = window.event;

--
Gitblit v1.9.1