/** 级联选择器模块 date:2020-03-11 License By http://easyweb.vip */ layui.define(["jquery"],function(a){var e=layui.jquery;if(e("#ew-css-cascader").length<=0){layui.link(layui.cache.base+"cascader/cascader.css")}var f=[];var b={render:function(q){var E={renderFormat:function(J,i){return J.join(" / ")},clearable:true,clearAllActive:false,disabled:false,trigger:"click",changeOnSelect:false,filterable:false,notFoundText:"没有匹配数据"};q=e.extend(E,q);var B=q.elem;var A=q.data;var F=q.renderFormat;var I=q.clearable;var l=q.clearAllActive;var p=q.disabled;var u=q.trigger;var v=q.changeOnSelect;var s=q.reqData;var n=q.filterable;var m=q.notFoundText;var D=q.reqSearch;var y=q.onChange;var H=q.onVisibleChange;var x=q.itemHeight;var t=true;var h=e(B);if(h.next().hasClass("ew-cascader-group")){h.next().remove();for(var z=0;z-1){L.label=L.label.replace(new RegExp(N,"g"),''+N+"");O.push(L)}}c(w,O,m);G.addClass("show-search-list")}});w.off("click").on("click",".ew-cascader-search-list-item",function(O){O.stopPropagation();if(e(this).hasClass("ew-cascader-disabled")){return}var N=e(this).data("value").toString();g.hide();g.setValue(N);var J=N.split(",");var M=g.getData();for(var L=0;Lb.getPageWidth()){g.parent().addClass("dropdown-show-left")}else{g.parent().removeClass("dropdown-show-left")}},checkHeightPosition:function(g){if(g.offset().top+g.outerHeight()>b.getPageHeight()){g.parent().addClass("dropdown-show-top");if(g.offset().top<0){g.parent().removeClass("dropdown-show-top")}}}};b.getCityData=function(h){for(var g=0;g";for(var k=0;k'+q.label+''}g+=" ";n.append(g);b.checkWidthPosition(n)};var c=function(m,h,l){var n="";if(h.length==0){n='
'+l+"
"}else{for(var g=0;g'+k.label+""}}m.html(n)};e(document).off("click.cascader").on("click.cascader",function(l){try{var m=l.target.className.split(" ");var k=["ew-cascader-group","ew-cascader-input","ew-icon-arrow","ew-cascader-dropdown","ew-cascader-dropdown-list","ew-cascader-dropdown-list-item","ew-icon-right","ew-cascader-input-search","ew-cascader-search-list","ew-cascader-search-list-item"];for(var h in m){for(var g in k){if(m[h]==k[g]){return}}}}catch(l){}b.hideAll()});a("cascader",b)});