From 27991963196d5d59fe2ccb73d28bb25faaa15177 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 09 七月 2020 12:55:15 +0800 Subject: [PATCH] # --- src/main/webapp/views/pdaCe/index.html | 220 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 216 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/views/pdaCe/index.html b/src/main/webapp/views/pdaCe/index.html index 4af95da..c9535d5 100644 --- a/src/main/webapp/views/pdaCe/index.html +++ b/src/main/webapp/views/pdaCe/index.html @@ -5,14 +5,226 @@ <meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no"/> <title>涓壃鐗╂祦</title> <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> + <style> + .mat-msg { + overflow: auto; + margin-top: 10px; + height: 100px; + background-color: #fff; + border-radius: 5px; + box-shadow: 0 0 3px rgba(0,0,0,.3); + } + /* 鍫嗗灈鏈虹姸鎬佷俊鎭〃 */ + #mat-msg-table { + font-size: 12px; + border-collapse: collapse; + margin: 0 auto; + text-align: center; + } + #mat-msg-table td, #mat-msg-table th { + border: 1px solid #f1f1f1; + color: #666; + height: 15px; + line-height: 15px; + } + #mat-msg-table thead th { + background-color: #fff; + width: 400px; + font-weight: normal; + } + #mat-msg-table tr:nth-child(odd) { + background: #fff; + } + #mat-msg-table tr:nth-child(even) { + background: #fff; + } + + .btn-con { + padding-left: 10px; + position: absolute; + bottom: 10px; + width: 100%; + } + .btn-con button { + display: inline-block; + vertical-align: middle; + } + #tips { + font-size: 12px; + margin-left: 10px; + display: inline-block; + vertical-align: middle; + width: 90px; + overflow:hidden; + white-space:nowrap; + text-overflow:ellipsis; + } + </style> </head> <body> - Hello World -<!-- <button onclick="her()">椤甸潰璺宠浆</button>--> +<div> + <span>鏉$爜</span> + <input type="text" id="code"> +</div> +<div> + <span>鐗╂枡</span> + <input type="text" id="matnr" onkeyup="find(this)" autocomplete="off"> +</div> + +<!-- 鍫嗗灈鏈虹姸鎬� --> +<div class="mat-msg" id="mat-msg-id"> + <table id="mat-msg-table"> + <thead> + <tr> + <th>缂栫爜</th> + <th>鍚嶇О</th> + <th>鍗曚綅</th> + <th>鏁伴噺</th> + </tr> + </thead> + <tbody> + </tbody> + </table> +</div> + +<div class="btn-con"> + <button style="margin-right: 20px" onclick="reset()">閲嶇疆</button> + <button >缁勬墭</button> + <span id="tips"></span> +</div> </body> <script> - function her() { - window.location.href="login.html"; + // initCrnMsgTable() + var code = document.getElementById("code") + var matnr = document.getElementById("matnr") + var matMsg = document.getElementById("mat-msg-id"); + var tipDom = document.getElementById("tips"); + + // 鏌ヨ鐗╂祦 + function find(el) { + httpRequest({ + httpUrl: baseUrl + "/matCode/auth", + type: 'post', + data: { + id: el.value + }, + }, function (res) { + if (res.code === 200) { + if (res.data != null) { + matMsg.style.display = 'none'; + } else { + matMsg.style.display = 'block'; + } + } else { + alert(res.msg); + } + + }) + } + + // 鍫嗗灈鏈烘暟鎹〃鑾峰彇 ----- 琛ㄤ簩 + function initCrnMsgTable(row) { + var line; + if (row === undefined){ + var one = $('#crn-msg-table thead').height(); + var total = $('.crn-msg').height(); + var count = total / one; + count = parseInt(count) - 1; + crnMsgTableBlankRows = count; + line = count; + } else { + line = row; + } + var html = ""; + for (var i = 0; i < line; i ++){ + html += " <tr>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " <td></td>\n" + + " </tr>\n"; + } + $('#crn-msg-table tbody').after(html); + } + + // 閲嶇疆 + function reset() { + code.value = ""; + matnr.value = ""; + } + + /** + * 鎻愮ず淇℃伅 + * @param msg 鎻愮ず鍐呭 + * @param warn true锛氱孩鑹插瓧浣� + */ + function tips(msg, warn) { + tipDom.innerText = msg; + if (warn) { + tipDom.style.color = "red"; + } else { + tipDom.style.color = "#000"; + } + } + + function httpRequest(paramObj,fun,errFun) { + var xmlhttp = null; + /*鍒涘缓XMLHttpRequest瀵硅薄锛� + *鑰佺増鏈殑 Internet Explorer锛圛E5 鍜� IE6锛変娇鐢� ActiveX 瀵硅薄锛歯ew ActiveXObject("Microsoft.XMLHTTP") + * */ + if(window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + }else if(window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + /*鍒ゆ柇鏄惁鏀寔璇锋眰*/ + if(xmlhttp == null) { + alert('浣犵殑娴忚鍣ㄤ笉鏀寔XMLHttp'); + return; + } + /*璇锋眰鏂瑰紡锛屽苟涓旇浆鎹负澶у啓*/ + var httpType = (paramObj.type || 'GET').toUpperCase(); + /*鏁版嵁绫诲瀷*/ + var dataType = paramObj.dataType || 'json'; + /*璇锋眰鎺ュ彛*/ + var httpUrl = paramObj.httpUrl || ''; + /*鏄惁寮傛璇锋眰*/ + var async = paramObj.async || true; + /*璇锋眰鍙傛暟--post璇锋眰鍙傛暟鏍煎紡涓猴細foo=bar&lorem=ipsum*/ + var paramData = paramObj.data || []; + var requestData = ''; + for(var name in paramData) { + requestData += name + '='+ paramData[name] + '&'; + } + requestData = requestData === '' ? '' : requestData.substring(0,requestData.length - 1); + + /*璇锋眰鎺ユ敹*/ + xmlhttp.onreadystatechange = function() { + if(xmlhttp.readyState === 4 && xmlhttp.status === 200) { + /*鎴愬姛鍥炶皟鍑芥暟*/ + fun(JSON.parse(xmlhttp.responseText)); + }else{ + /*澶辫触鍥炶皟鍑芥暟*/ + errFun; + } + } + + /*鎺ュ彛杩炴帴锛屽厛鍒ゆ柇杩炴帴绫诲瀷鏄痯ost杩樻槸get*/ + if(httpType === 'GET') { + xmlhttp.open("GET",httpUrl,async); + xmlhttp.send(null); + }else if(httpType === 'POST'){ + xmlhttp.open("POST",httpUrl,async); + //鍙戦�佸悎閫傜殑璇锋眰澶翠俊鎭� + xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xmlhttp.send(requestData); + } } </script> </html> \ No newline at end of file -- Gitblit v1.9.1