Parcourir la source

提示滚动条

zhongzewei il y a 6 ans
Parent
commit
5fa0faf185
1 fichiers modifiés avec 12 ajouts et 2 suppressions
  1. 12 2
      public/scHintBox.html

+ 12 - 2
public/scHintBox.html

@@ -19,7 +19,7 @@
             </div>
 
             <div class="modal-body">
-                <div id = "hintBox_caption" style="margin:5px 10px 10px 10px;">提示明细</div>
+                <div id = "hintBox_caption" style="margin:5px 10px 10px 10px; max-height:300px; overflow: auto">提示明细</div>
                 <div style="margin:5px 10px 5px 10px;">
                     <input id="hintBox_value" type="text" class="form-control" value="" />
                     <p id="hintBox_error" style="margin-top:7px; color:red; display:none;">“xxx”已存在!</p>
@@ -77,6 +77,12 @@
         font: function(str){
             return `<span style='color:red;font-weight:bold;font-size:15px'> ${str} </span>`;
         },
+        fontRed: function(str){
+            return `<span style='color:red;'> ${str} </span>`;
+        },
+        fontBlue: function(str){
+            return `<span style='color:blue;'> ${str} </span>`;
+        },
         error: function (err) {   // 注意:该方法只能用在valueBox()的doOK回调函数中。
             $('#hintBox_error').text(err);
             $('#hintBox_error').show(200);
@@ -142,7 +148,11 @@
             $("#hintBox_form").modal('show');
 
         },
-        valueBox: function (title, value, doOK) {
+        valueBox: function (title, value, doOK,row) {
+            if(row && row>0){//默认为input,如果有row说明是要多行输入,把input换成textarea.
+                $('#hintBox_value').remove();
+                $("#hintBox_error").before(` <textarea id="hintBox_value" class="form-control" rows="${row}"></textarea>`);
+            }
             this.init();
             $('#hintBox_title').text(title);
             this.value = value;