| | |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">风险管控措施:</label> |
| | | <div class="col-sm-8"> |
| | | <select name="controlMeasureId" class="form-control m-b"> |
| | | <div class="col-sm-8" id="container"> |
| | | <select id="mySelect" name="controlMeasureId" class="form-control m-b"> |
| | | <option value="">--请选择风险管控措施--</option> |
| | | <option th:each="u :${measureList}" th:value="${u.id}" th:text="${u.checkContent}"></option> |
| | | </select> |
| | |
| | | $.operate.save(prefix + "/add", $('#form-baseCheckPoint-add').serialize()); |
| | | } |
| | | } |
| | | |
| | | var select = document.getElementById("mySelect"); |
| | | var options = select.options; |
| | | var input = document.createElement("input"); |
| | | var container = document.getElementById("container"); |
| | | container.insertBefore(input, select); |
| | | |
| | | input.addEventListener("keyup", function() { |
| | | var value = input.value.toLowerCase().trim(); |
| | | for(var i=0; i<options.length; i++) { |
| | | var option = options[i]; |
| | | if(option.value.toLowerCase().indexOf(value) > -1 || option.text.toLowerCase().indexOf(value) > -1) { |
| | | option.style.display = ""; |
| | | } else { |
| | | option.style.display = "none"; |
| | | } |
| | | } |
| | | }); |
| | | input.style.width = "100%" |
| | | input.style.height = "34px" |
| | | input.style.paddingLeft = "20px" |
| | | input.style.marginBottom = "10px" |
| | | input.placeholder = "输入关键词以缩小选择范围" |
| | | </script> |
| | | </body> |
| | | </html> |