dever 3 years ago
parent
commit
5dd7f92a29
1 changed files with 27 additions and 1 deletions
  1. 27 1
      assets/lib/layui/admin/modules/plugin/formselects/formselects.js

+ 27 - 1
assets/lib/layui/admin/modules/plugin/formselects/formselects.js

@@ -429,6 +429,32 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
         var ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax;
         var ajaxData = $.extend(true, {}, ajaxConfig.data);
         ajaxData[ajaxConfig.searchName] = inputValue;
+        if (searchUrl.indexOf('{') != -1) {
+            var start = searchUrl.split('{');
+            var end = start[1].split('}');
+            searchUrl = start[0] + end[1];
+            if (end[0].indexOf(',')) {
+                var param = end[0].split(',');
+            } else {
+                var param = [];
+                param[0] = end[0];
+            }
+            
+            for (var i in param) {
+                if (typeof(param[i]) == 'string') {
+                    var e = $('.update_'+param[i]);
+                    if (e.length > 1) {
+                        e.each(function() {
+                            if ($(this).get(0).checked) {
+                                ajaxData[param[i]] = $(this).val();
+                            }
+                        })
+                    } else {
+                        ajaxData[param[i]] = e.val();
+                    }
+                }
+            }
+        }
         //是否需要对ajax添加随机时间
         //ajaxData['_'] = Date.now();
         $.ajax({
@@ -716,7 +742,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
                 dl.parents('.' + FORM_SELECT).attr(SEARCH_TYPE, data[id].config.searchType);
                 dl.find('.' + CZ_GROUP).css('max-width', dl.prev().width() - 54 + 'px');
             }, 10);
-            arr.push(['<dd lay-value="" class="' + FORM_SELECT_TIPS + '" style="background-color: #FFF!important;">', this.renderBtns(id, null, '30px'), '</dd>', '<dd lay-value="" class="' + FORM_SELECT_TIPS + ' ' + FORM_DL_INPUT + '" style="background-color: #FFF!important;">', '<i class="xm-iconfont icon-sousuo"></i>', '<input type="text" class="' + FORM_INPUT + ' ' + INPUT + '" placeholder="\u8BF7\u641C\u7D22"/>', '</dd>'].join(''));
+            arr.push(['<dd lay-value="" class="' + FORM_SELECT_TIPS + '" style="background-color: #FFF!important;display:none;">', this.renderBtns(id, null, '30px'), '</dd>', '<dd lay-value="" class="' + FORM_SELECT_TIPS + ' ' + FORM_DL_INPUT + '" style="background-color: #FFF!important;">', '<i class="xm-iconfont icon-sousuo"></i>', '<input type="text" class="' + FORM_INPUT + ' ' + INPUT + '" placeholder="\u8BF7\u641C\u7D22"/>', '</dd>'].join(''));
         } else {
             arr.push('<dd lay-value="" class="' + FORM_SELECT_TIPS + '">' + tips + '</dd>');
         }