layui.define(["element","form","jquery"],function(N){var j=layui.element,g=layui.form,u=layui.jquery,C={render:function(l){var n=this,a=l.elem;n.selectValues=new Array,(l.type==null||l.type==null)&&(l.type="get"),l.data?l.data=JSON.stringify(data):l.data={},l.url==null||l.url==""||l.url==null?((l.option==null||l.option==null)&&(l.option=new Array),n._init(a,l,l.option)):u.ajax({url:l.url,type:l.type,data:l.data,async:"false",dataType:"json",headers:l.headers||{Accept:"application/json; charset=utf-8"},contentType:l.contentType||"application/json",success:function(t){n._init(a,l,t)},error:function(t){console.log("Ajax request "+l.url+" error! "),l.fail&&l.fail(t)}}),n._init=function(t,c,r){u(t).empty(),u(t).prepend("");var o=new Array;if(c.format)for(var e=0;e0)d=!0,u(t).append("");else{d=!1;var v="",V="",x="",A="";o[e].status&&o[e].status=="0"&&(v="disabled='disabled'"),u(t).append(""),o[e].select!=null&&(o[e].select=="true"||o[e].select==!0)&&o[e].status!="0"&&n.selectValues.push(o[e])}if(n.selectValues.length==0&&c.select!=null){var f,p=c.select+"";if(d&&p.indexOf("-")>0){var y=p.split("-");f=o[y[0]].groupChildren[y[1]]}else f=o[p];f&&f.status!="0"&&n.selectValues.push(f)}var q=u(t).attr("multiple");n.selectValues.length>0&&n.selectValues.forEach(function(h,s){u(t).find("option[value = '"+h.code+"']").attr("selected","selected")}),c.success&&(c.success(o),o=null),g.render("select"),g.on("select("+t.replace("#","")+")",function(h){c.onselect&&c.onselect(h.value)})}}};N("layselect",C)});