(function(){var e=function(l,k){return Object.prototype.toString.call(l)===("[object "+k+"]")};var g=function(k){if(!k){return[]}k.forEach(function(n){var m=n.type?(""+n.type).toLocaleLowerCase():"",l=e(k.children,"Array")?k.children:[];if((m==="cascader"||m==="tree")&&n.props){if(n.props.data&&e(n.props.data,"String")&&n.props.data.indexOf("js.")===0){n.props.data=window[n.props.data.substr(3)]}else{if(n.props.options&&e(n.props.options,"String")&&n.props.options.indexOf("js.")===0){n.props.options=window[n.props.options.substr(3)]}}}else{if(m==="group"){if(n.props.rules){g(n.props.rules)}if(n.props.rule){g([n.props.rule])}}else{if(n.control && n.control.length){n.control.forEach(function(o){g(o.rule)})}}}if(l.length){g(l)}});return k};var i=function(k,l,m,n){$.ajax({url:k,type:(""+l).toLocaleUpperCase(),dataType:"json",headers:c,contentType:j,data:m,success:function(o){n(1,o)},error:function(){n(0,{})}})};var h=g(<?=$form->parseFormRule()?>),c=<?=$form->parseHeaders()?>,d=<?=$form->parseFormConfig()?>,j="<?=$form->getFormContentType()?>",f="<?=$form->getAction()?>",a="<?=$form->getMethod()?>",b=new Vue();if(!b.$Message&&b.$message){Vue.prototype.$Message=b.$message}return function(l){if(!l){l={}}if(l.el){d.el=l.el}d.onSubmit=function(o,n){n.submitBtnProps({loading:true,disabled:true});i(f,a,o,function(p,q){if(l.callback){return l.callback(p,q,n)}n.submitBtnProps({loading:false,disabled:false});if(p&&q.code===200){b.$Message.success(q.msg||"表单提交成功")}else{b.$Message.error(q.msg||"表单提交失败")}})};if(!d.global){d.global={}}if(!d.global.upload){d.global.upload={}}if(!d.global.upload.props){d.global.upload.props={}}var k=d.global.upload.props;k.onExceededSize=function(n){b.$Message.error(n.name+"超出指定大小限制")};k.onFormatError=function(n){b.$Message.error(n.name+"格式验证失败")};k.onError=function(n,o){b.$Message.error(o.name+"上传失败,("+n+")")};k.onSuccess=function(o,n){if(o.code===200){n.url=o.data.filePath}else{b.$Message.error(o.msg)}};var m=function(){return formCreate.create(h,d)};return l.filter?l.filter(m):m()}})();