text: define("bui/form",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){var i=e("bui/common"),n=i.namespace("Form"),o=e("bui/form/tips");i.mix(n,{Tips:o,TipItem:o.Item,FieldContainer:e("bui/form/fieldcontainer"),Form:e("bui/form/form"),Row:e("bui/form/row"),Group:e("bui/form/fieldgroup"),HForm:e("bui/form/hform"),Rules:e("bui/form/rules"),Field:e("bui/form/field"),FieldGroup:e("bui/form/fieldgroup")}),r.exports=n}),define("bui/form/tips",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("jquery"),n=e("bui/common"),o=n.prefix,a=e("bui/overlay").Overlay,l="data-tip",u=o+"form-tip-container",s=a.extend({initializer:function(){var e=this,t=e.get("render");if(!t){var r=i(e.get("trigger")).parent();e.set("render",r)}},renderUI:function(){var e=this;e.resetVisible()},resetVisible:function(){var e=this,t=i(e.get("trigger"));t.val()?e.set("visible",!1):(e.set("align",{node:i(e.get("trigger")),points:["cl","cl"]}),e.set("visible",!0))},bindUI:function(){var e=this,t=i(e.get("trigger"));e.get("el").on("click",function(){e.hide(),t.focus()}),t.on("click focus",function(){e.hide()}),t.on("blur",function(){e.resetVisible()})}},{ATTRS:{trigger:{},text:{},iconCls:{},tpl:{value:'<span class="{iconCls}"></span><span class="tip-text">{text}</span>'}}},{xclass:"form-tip"}),c=function(e){return this.constructor!==c?new c(e):(c.superclass.constructor.call(this,e),void this._init())};c.ATTRS={form:{},items:{valueFn:function(){return[]}}},n.extend(c,n.Base),n.augment(c,{_init:function(){var e=this,t=i(e.get("form"));t.length&&(n.each(i.makeArray(t[0].elements),function(t){var r=i(t).attr(l);r&&e._initFormElement(t,i.parseJSON(r))}),t.addClass(u))},_initFormElement:function(e,t){t&&(t.trigger=e);var r=this,i=r.get("items"),n=new s(t);i.push(n)},getItem:function(e){var t=this,r=t.get("items"),o=null;return n.each(r,function(t){return i(t.get("trigger")).attr("name")===e?(o=t,!1):void 0}),o},resetVisible:function(){var e=this,t=e.get("items");n.each(t,function(e){e.resetVisible()})},render:function(){var e=this,t=e.get("items");n.each(t,function(e){e.render()})},destroy:function(){var e=this,t=e.get(t);n.each(t,function(e){e.destroy()})}}),c.Item=s,r.exports=c}),define("bui/form/fieldcontainer",["jquery","bui/common","bui/overlay","bui/list","bui/data"],function(e,t,r){function i(e){return e.is(v)}function n(e,t){if(e!=t){if(i(e))return[e];var r=e.attr("class");if(r&&(-1!==r.indexOf(f)||-1!==r.indexOf(d)))return[e]}var l=[],u=e.children();return a.each(u,function(e){l=l.concat(n(o(e),t))}),l}var o=e("jquery"),a=e("bui/common"),l=e("bui/form/field"),u=e("bui/form/groupvalid"),s=a.prefix,c="form-field",d=s+c,f=s+"form-group",v="input,select,textarea",g=a.Component.View.extend([u.View]),m=a.Component.Controller.extend([u],{syncUI:function(){var e=this,t=e.getFields(),r=e.get("validators");a.each(t,function(e){var t=e.get("name");r[t]&&e.set("validator",r[t])}),a.each(r,function(t,r){if(0==r.indexOf("#")){var i=r.replace("#",""),n=e.getChild(i,!0);n&&n.set("validator",t)}})},getDecorateElments:function(){var e=this,t=e.get("el"),r=n(t,t);return r},findXClassByNode:function(e,t){return"checkbox"===e.attr("type")?c+"-checkbox":"radio"===e.attr("type")?c+"-radio":"number"===e.attr("type")?c+"-number":e.hasClass("calendar")?c+"-date":"SELECT"==e[0].tagName?c+"-select":i(e)?c:a.Component.Controller.prototype.findXClassByNode.call(this,e,t)},getRecord:function(){var e=this,t={},r=e.getFields();return a.each(r,function(r){var i=r.get("name"),n=e._getFieldValue(r);if(t[i]){if(a.isArray(t[i])&&null!=n)t[i].push(n);else if(null!=n){var o=[t[i]];o.push(n),t[i]=o}}else t[i]=n}),t},getFields:function(e){var t=this,r=[],i=t.get("children");return a.each(i,function(t){t instanceof l?e&&t.get("name")!=e||r.push(t):t.getFields&&(r=r.concat(t.getFields(e)))}),r},getField:function(e){var t=this,r=t.getFields(),i=null;return a.each(r,function(t){return t.get("name")===e?(i=t,!1):void 0}),i},getFieldAt:function(e){return this.getFields()[e]},setFieldValue:function(e,t){var r=this,i=r.getFields(e);a.each(i,function(e){r._setFieldValue(e,t)})},_setFieldValue:function(e,t){if(!e.get("disabled"))if(e instanceof l.Check){var r=e.get("value");t&&(r===t||a.isArray(t)&&a.Array.contains(r,t))?e.set("checked",!0):e.set("checked",!1)}else null==t&&(t=""),e.clearErrors(!0),e.set("value",t)},getFieldValue:function(e){var t=this,r=t.getFields(e),i=[];return a.each(r,function(e){var r=t._getFieldValue(e);r&&i.push(r)}),0===i.length?null:1===i.length?i[0]:i},_getFieldValue:function(e){return e instanceof l.Check&&!e.get("checked")?null:e.get("value")},clearFields:function(){this.clearErrors(!0),this.setRecord({})},setRecord:function(e){var t=this,r=t.getFields();a.each(r,function(r){var i=r.get("name");t._setFieldValue(r,e[i])})},updateRecord:function(e){var t=this,r=t.getFields();a.each(r,function(r){var i=r.get("name");e.hasOwnProperty(i)&&t._setFieldValue(r,e[i])})},focus:function(){var e=this,t=e.getFields(),r=t[0];r&&r.focus()},_uiSetDisabled:function(e){var t=this,r=t.get("children");a.each(r,function(t){t.set("disabled",e)})}},{ATTRS:{record:{setter:function(e){this.setRecord(e)},getter:function(){return this.getRecord()}},validators:{value:{}},defaultLoaderCfg:{value:{property:"children",dataType:"json"}},disabled:{sync:!1},isDecorateChild:{value:!0},xview:{value:g}}},{xclass:"form-field-container"});m.View=g,r.exports=m}),define("bui/form/field",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){var i=e("bui/common"),n=e("bui/form/fields/base");i.mix(n,{Text:e("bui/form/fields/text"),Date:e("bui/form/fields/date"),Select:e("bui/form/fields/select"),Hidden:e("bui/form/fields/hidden"),Number:e("bui/form/fields/number"),Check:e("bui/form/fields/check"),Radio:e("bui/form/fields/radio"),Checkbox:e("bui/form/fields/checkbox"),Plain:e("bui/form/fields/plain"),List:e("bui/form/fields/list"),TextArea:e("bui/form/fields/textarea"),Uploader:e("bui/form/fields/uploader"),CheckList:e("bui/form/fields/checklist"),RadioList:e("bui/form/fields/radiolist")}),r.exports=n}),define("bui/form/fields/base",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("jquery"),n=e("bui/common"),o=n.Component,a=e("bui/form/tips").Item,l=e("bui/form/valid"),u=e("bui/form/remote"),s=n.prefix+"form-field-error",c="bui-form-tip-container",d=o.View.extend([u.View,l.View],{renderUI:function(){var e=this,t=e.get("control");if(t)e.set("controlContainer",t.parent());else{var r=e.get("controlTpl"),n=e.getControlContainer();if(r){var t=i(r).appendTo(n);e.set("control",t)}}},clearErrors:function(){var e=this,t=e.get("msgEl");t&&(t.remove(),e.set("msgEl",null)),e.get("el").removeClass(s)},showError:function(e,t){var r=this,o=r.get("control"),a=n.substitute(t,{error:e}),l=i(a);l.appendTo(o.parent()),r.set("msgEl",l),r.get("el").addClass(s)},getControlContainer:function(){var e=this,t=e.get("el"),r=e.get("controlContainer");return r&&n.isString(r)&&(r=t.find(r)),r&&r.length?r:t},getLoadingContainer:function(){return this.getControlContainer()},_uiSetName:function(e){var t=this;t.get("control").attr("name",e)}},{ATTRS:{error:{},controlContainer:{},msgEl:{},control:{}}}),f=o.Controller.extend([u,l],{isField:!0,initializer:function(){var e=this;e.on("afterRenderUI",function(){var t=e.get("tip");if(t){var r=e.getTipTigger();r&&r.parent().addClass(c),t.trigger=r,t.autoRender=!0,t=new a(t),e.set("tip",t)}})},bindUI:function(){var e=this,t=e.get("validEvent"),r=e.get("changeEvent"),i=e.get("firstValidEvent"),n=e.getInnerControl();n.is("select")&&(t="change"),n.on(t,function(){var t=e.getControlValue(n);e.validControl(t)}),i&&n.on(i,function(){if(!e.get("hasValid")){var t=e.getControlValue(n);e.validControl(t)}}),e.on(r,function(){e.onValid()}),e.on("remotecomplete",function(t){e._setError(t.error)})},onValid:function(){var e=this,t=e.getControlValue();t=e.parseValue(t),e.isCurrentValue(t)||(e.setInternal("value",t),e.onChange())},onChange:function(){this.fire("change")},isCurrentValue:function(e){return e==this.get("value")},_clearError:function(){this.set("error",null),this.get("view").clearErrors()},_setError:function(e){this.set("error",e),this.showErrors()},getControlValue:function(e){var t=this;return e=e||t.getInnerControl(),e.val()},getControlContainer:function(){return this.get("view").getControlContainer()},getRemoteParams:function(){var e=this,t={};return t[e.get("name")]=e.getControlValue(),t},setControlValue:function(e){var t=this,r=t.getInnerControl();r.val(e)},parseValue:function(e){return e},valid:function(){var e=this;e.validControl()},validControl:function(e){var t,r=this;return e=e||r.getControlValue(),preError=r.get("error"),t=r.getValidError(e),r.setInternal("hasValid",!0),t?(r._setError(t),r.fire("error",{msg:t,value:e}),preError!==t&&r.fire("validchange",{valid:!1})):(r._clearError(),r.fire("valid"),preError&&r.fire("validchange",{valid:!0})),!t},focus:function(){this.getInnerControl().focus()},change:function(){var e=this.getInnerControl();e.change()},blur:function(){this.getInnerControl().blur()},isValid:function(){var e=this;return e.get("hasValid")||e.validControl(),!e.get("error")},getError:function(){return this.get("error")},getErrors:function(){var e=this.getError();return e?[e]:[]},clearErrors:function(e){var t=this;t._clearError(),e&&t.getControlValue()!=t.get("value")&&t.setControlValue(t.get("value"))},getInnerControl:function(){return this.get("view").get("control")},getTipTigger:function(){return this.getInnerControl()},destructor:function(){var e=this,t=e.get("tip");t&&t.destroy&&t.destroy()},setInnerWidth:function(e){var t=this,r=t.getInnerControl(),o=r.siblings(),a=r.outerWidth()-r.width();n.each(o,function(e){a+=i(e).outerWidth()}),r.width(e-a)},_resetTip:function(){var e=this,t=e.get("tip");t&&t.resetVisible()},resetTip:function(){this._resetTip()},_uiSetValue:function(e){var t=this;t.setControlValue(e),t.get("rendered")&&(t.validControl(),t.onChange()),t._resetTip()},_uiSetDisabled:function(e){var t=this,r=t.getInnerControl(),i=t.get("children");r.attr("disabled",e),t.get("rendered")&&(e&&t.clearErrors(),e||t.valid()),n.each(i,function(t){t.set("disabled",e)})},_uiSetWidth:function(e){var t=this;null!=e&&t.get("forceFit")&&t.setInnerWidth(e)}},{ATTRS:{hasValid:{value:!1},forceFit:{value:!1},tip:{},changeEvent:{value:"valid"},firstValidEvent:{value:"blur"},validEvent:{value:"keyup change"},name:{view:!0},showError:{view:!0,value:!0},value:{view:!0},label:{},controlContainer:{view:!0},control:{view:!0},controlTpl:{view:!0,value:'<input type="text"/>'},events:{value:{error:!1,valid:!1,change:!0,validchange:!0}},tpl:{value:"<label>{label}</label>"},xview:{value:d}},PARSER:{control:function(e){var t=e.find("input,select,textarea");return t.length?t:e},disabled:function(e){return!!e.attr("disabled")},value:function(e){var t=this,r="select,input,textarea",i=t.get("value");return i||(e.is(r)?(i=e.val(),!i&&e.is("select")&&(i=e.attr("value"))):i=e.find(r).val()),i},name:function(e){var t=this,r="select,input,textarea",i=t.get("name");return i||(i=e.is(r)?e.attr("name"):e.find(r).attr("name")),i}}},{xclass:"form-field"});f.View=d,r.exports=f}),define("bui/form/valid",["bui/common","jquery"],function(e,t,r){var i=e("bui/common"),n=e("bui/form/rules"),o=function(){};o.prototype={getErrorsContainer:function(){var e=this,t=e.get("errorContainer");return t?i.isString(t)?e.get("el").find(t):t:e.getContentElement()},showErrors:function(e){var t=this,r=t.getErrorsContainer(),n=t.get("errorTpl");return t.clearErrors(),t.get("showError")?t.get("showOneError")?void(e&&e.length&&t.showError(e[0],n,r)):void i.each(e,function(e){e&&t.showError(e,n,r)}):void 0},showError:function(e,t,r){},clearErrors:function(){}};var a=function(){};a.ATTRS={defaultRules:{value:{}},defaultMessages:{value:{}},rules:{shared:!1,value:{}},messages:{shared:!1,value:{}},validator:{},errorContainer:{view:!0},errorTpl:{view:!0,value:'<span class="x-field-error"><span class="x-icon x-icon-mini x-icon-error">!</span><label class="x-field-error-text">{error}</label></span>'},showError:{view:!0,value:!0},showOneError:{},error:{},pauseValid:{value:!1}},a.prototype={__bindUI:function(){var e=this;e.on("afterDisabledChange",function(t){var r=t.newVal;r?e.clearErrors(!1,!1):e.valid()})},isValid:function(){},valid:function(){},validControl:function(){},validRules:function(e,t){if(!e)return null;if(this.get("pauseValid"))return null;var r=this,i=r._getValidMessages(),o=null;for(var a in e)if(e.hasOwnProperty(a)){var l=e[a];if(o=n.valid(a,t,l,i[a],r))break}return o},_getValidMessages:function(){var e=this,t=e.get("defaultMessages"),r=e.get("messages");return i.merge(t,r)},getValidError:function(e){var t=this,r=t.get("validator"),i=null;return i=t.validRules(t.get("defaultRules"),e)||t.validRules(t.get("rules"),e),i||this.get("pauseValid")||(t.parseValue&&(e=t.parseValue(e)),i=r?r.call(this,e):""),i},getErrors:function(){},showErrors:function(e){var t=this,e=e||t.getErrors();t.get("view").showErrors(e)},clearErrors:function(e,t){t=null==t?!0:t;var r=this,n=r.get("children");t&&i.each(n,function(r){r.clearErrors&&(r.field?r.clearErrors(e):r.clearErrors(e,t))}),r.set("error",null),r.get("view").clearErrors()},addRule:function(e,t,r){var i=this,n=i.get("rules"),o=i.get("messages");n[e]=t,r&&(o[e]=r)},addRules:function(e,t){var r=this;i.each(e,function(e,i){var n=t?t[i]:null;r.addRule(i,e,n)})},removeRule:function(e){var t=this,r=t.get("rules");delete r[e]},clearRules:function(){var e=this;e.set("rules",{})}},a.View=o,r.exports=a}),define("bui/form/rules",["jquery","bui/common"],function(e,t,r){function i(e){return parseFloat(e)}function n(e){return BUI.Date.parse(e)}function o(e,t,r){var i=e&&e.equals!==!1;return i?t>=r:t>r}function a(e){return""==e||null==e}function l(e,t,r,i){for(var n=i.getFields(),l=!0,u=1;u<n.length;u++){var s,c,d=n[u],f=n[u-1];if(d&&f&&(s=d.get("value"),c=f.get("value"),!a(s)&&!a(c)&&!o(t,s,c))){l=!1;break}}return l?null:r}function u(e){var t=e.getFieldAt(0);return t?t.get("name"):""}function s(e,t){if(BUI.isArray(t)||(t=[t]),!e||!t.length)return!1;var r=e?BUI.isArray(e)?e.length:1:0;if(1==t.length){var i=t[0];if(!i)return!0;if(i>r)return!1}else{var n=t[0],o=t[1];if(n>r||r>o)return!1}return!0}var c=e("jquery"),d=e("bui/form/rule"),f={},v={add:function(e){var t;return c.isPlainObject(e)?(t=e.name,f[t]=new d(e)):e.get&&(t=e.get("name"),f[t]=e),f[t]},remove:function(e){delete f[e]},get:function(e){return f[e]},valid:function(e,t,r,i,n){var o=v.get(e);return o?o.valid(t,r,i,n):null},isValid:function(e,t,r,i){return null==v.valid(e,t,r,i)}};v.add({name:"required",msg:"\u4e0d\u80fd\u4e3a\u7a7a\uff01",validator:function(e,t,r){return t!==!1&&/^\s*$/.test(e)?r:void 0}}),v.add({name:"equalTo",msg:"\u4e24\u6b21\u8f93\u5165\u4e0d\u4e00\u81f4\uff01",validator:function(e,t,r){var i=c(t);return i.length&&(t=i.val()),e===t?void 0:r}}),v.add({name:"min",msg:"\u8f93\u5165\u503c\u4e0d\u80fd\u5c0f\u4e8e{0}\uff01",validator:function(e,t,r){return BUI.isString(e)&&(e=e.replace(/\,/g,"")),""!==e&&i(e)<i(t)?r:void 0}}),v.add({name:"max",msg:"\u8f93\u5165\u503c\u4e0d\u80fd\u5927\u4e8e{0}\uff01",validator:function(e,t,r){return BUI.isString(e)&&(e=e.replace(/\,/g,"")),""!==e&&i(e)>i(t)?r:void 0}}),v.add({name:"length",msg:"\u8f93\u5165\u503c\u957f\u5ea6\u4e3a{0}\uff01",validator:function(e,t,r){return null!=e&&(e=c.trim(e.toString()),t!=e.length)?r:void 0}}),v.add({name:"minlength",msg:"\u8f93\u5165\u503c\u957f\u5ea6\u4e0d\u5c0f\u4e8e{0}\uff01",validator:function(e,t,r){if(null!=e){e=c.trim(e.toString());var i=e.length;if(t>i)return r}}}),v.add({name:"maxlength",msg:"\u8f93\u5165\u503c\u957f\u5ea6\u4e0d\u5927\u4e8e{0}\uff01",validator:function(e,t,r){if(e){e=c.trim(e.toString());var i=e.length;if(i>t)return r}}}),v.add({name:"regexp",msg:"\u8f93\u5165\u503c\u4e0d\u7b26\u5408{0}\uff01",validator:function(e,t,r){return t?t.test(e)?void 0:r:void 0}}),v.add({name:"email",msg:"\u4e0d\u662f\u6709\u6548\u7684\u90ae\u7bb1\u5730\u5740\uff01",validator:function(e,t,r){return e=c.trim(e),e?/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)?void 0:r:void 0}}),v.add({name:"date",msg:"\u4e0d\u662f\u6709\u6548\u7684\u65e5\u671f\uff01",validator:function(e,t,r){return BUI.isNumber(e)||BUI.isDate(e)?void 0:(e=c.trim(e),e?BUI.Date.isDateString(e)?void 0:r:void 0)}}),v.add({name:"minDate",msg:"\u8f93\u5165\u65e5\u671f\u4e0d\u80fd\u5c0f\u4e8e{0}\uff01",validator:function(e,t,r){if(e){var i=n(e);if(i&&i<n(t))return r}}}),v.add({name:"maxDate",msg:"\u8f93\u5165\u65e5\u671f\u4e0d\u80fd\u5927\u4e8e{0}\uff01",validator:function(e,t,r){if(e){var i=n(e);if(i&&i>n(t))return r}}}),v.add({name:"mobile",msg:"\u4e0d\u662f\u6709\u6548\u7684\u624b\u673a\u53f7\u7801\uff01",validator:function(e,t,r){return e=c.trim(e),e?/^\d{11}$/.test(e)?void 0:r:void 0}}),v.add({name:"number",msg:"\u4e0d\u662f\u6709\u6548\u7684\u6570\u5b57\uff01",validator:function(e,t,r){return BUI.isNumber(e)?void 0:(e=e.replace(/\,/g,""),isNaN(e)?r:void 0)}}),v.add({name:"dateRange",msg:"\u7ed3\u675f\u65e5\u671f\u4e0d\u80fd\u5c0f\u4e8e\u8d77\u59cb\u65e5\u671f\uff01",validator:l}),v.add({name:"numberRange",msg:"\u7ed3\u675f\u6570\u5b57\u4e0d\u80fd\u5c0f\u4e8e\u5f00\u59cb\u6570\u5b57\uff01",validator:l}),v.add({name:"checkRange",msg:"\u5fc5\u987b\u9009\u4e2d{0}\u9879\uff01",validator:function(e,t,r,i){var n,o=u(i),a=t;return o&&a&&(n=e[o],!s(n,a))?r:null}});r.exports=v}),define("bui/form/rule",["jquery","bui/common"],function(e,t,r){function i(e,t,r,i,n){l.isArray(r)&&l.isString(r[1])&&(r[1]&&(i=r[1]),r=r[0]);var a=e,u=a.get("validator"),s=o(e,r,i);return t=null==t?"":t,u.call(a,t,r,s,n)}function n(e){if(null==e)return{};if(a.isPlainObject(e))return e;var t=e,r={};if(l.isArray(e)){for(var i=0;i<t.length;i++)r[i]=t[i];return r}return{0:e}}function o(e,t,r){var i=n(t);return r=r||e.get("msg"),l.substitute(r,i)}var a=e("jquery"),l=e("bui/common"),u=function(e){u.superclass.constructor.call(this,e)};l.extend(u,l.Base),u.ATTRS={name:{},msg:{},validator:{value:function(e,t,r,i){}}},l.augment(u,{valid:function(e,t,r,n){var o=this;return i(o,e,t,r,n)}}),r.exports=u}),define("bui/form/remote",["jquery","bui/common"],function(e,t,r){var i=e("jquery"),n=e("bui/common"),o=function(){};o.ATTRS={isLoading:{},loadingEl:{}},o.prototype={getLoadingContainer:function(){},_setLoading:function(){var e=this,t=e.get("loadingEl"),r=e.get("loadingTpl");r&&!t&&(t=i(r).appendTo(e.getLoadingContainer()),e.setInternal("loadingEl",t))},_clearLoading:function(){var e=this,t=e.get("loadingEl");t&&(t.remove(),e.setInternal("loadingEl",null))},_uiSetIsLoading:function(e){var t=this;e?t._setLoading():t._clearLoading()}};var a=function(){};a.ATTRS={defaultRemote:{value:{method:"GET",cache:!0,callback:function(e){return e}}},remoteDaly:{value:500},cacheMap:{value:{}},loadingTpl:{view:!0,value:'<img src="http://img02.taobaocdn.com/tps/i2/T1NU8nXCVcXXaHNz_X-16-16.gif" alt="loading"/>'},isLoading:{view:!0,value:!1},remote:{setter:function(e){return n.isString(e)&&(e={url:e}),e}},remoteHandler:{},events:{value:{remotecomplete:!1,remotestart:!1}}},a.prototype={__bindUI:function(){var e=this;e.on("valid",function(t){if(e.get("remote")&&e.isValid()&&!e.get("pauseValid")){var r=e.getControlValue(),i=e.getRemoteParams();e._startRemote(i,r)}}),e.on("error",function(t){e.get("remote")&&e._cancelRemote()})},_startRemote:function(e,t){function r(){i._remoteValid(e,n,t),i.set("isLoading",!0)}var i=this,n=i.get("remoteHandler"),o=i.get("cacheMap"),a=i.get("remoteDaly");return n&&i._cancelRemote(n),null!=o[t]?void i._validResult(i._getCallback(),o[t]):(n=setTimeout(r,a),void i.setInternal("remoteHandler",n))},_validResult:function(e,t){var r=this,i=e(t);r.onRemoteComplete(i,t)},onRemoteComplete:function(e,t,r){var i=this;r==i.get("remoteHandler")&&(i.fire("remotecomplete",{error:e,data:t}),i.set("isLoading",!1),i.setInternal("remoteHandler",null))},_getOptions:function(e){var t=this,r=t.get("remote"),i=t.get("defaultRemote"),o=n.merge(i,r,{data:e});return o},_getCallback:function(){return this._getOptions().callback},_remoteValid:function(e,t,r){var n=this,o=n.get("cacheMap"),a=n._getOptions(e);a.success=function(e){var i=a.callback,l=i(e);o[r]=e,n.onRemoteComplete(l,e,t)},a.error=function(e,r,i){n.onRemoteComplete(i,null,t)},n.fire("remotestart",{data:e}),i.ajax(a)},getRemoteParams:function(){},clearCache:function(){this.set("cacheMap",{})},_cancelRemote:function(e){var t=this;e=e||t.get("remoteHandler"),e&&(clearTimeout(e),t.setInternal("remoteHandler",null)),t.set("isLoading",!1)}},a.View=o,r.exports=a}),define("bui/form/fields/text",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("bui/form/fields/base"),n=i.extend({},{xclass:"form-field-text"});r.exports=n}),define("bui/form/fields/date",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("jquery"),n=e("bui/common"),o=e("bui/form/fields/base"),a=n.Date,l=o.extend({renderUI:function(){var e=this,t=e.get("datePicker");i.isPlainObject(t)&&e.initDatePicker(t),(t.get&&t.get("showTime")||t.showTime)&&e.getInnerControl().addClass("calendar-time")},initDatePicker:function(t){var r=this;e.async("bui/calendar",function(e){t.trigger=r.getInnerControl(),t.autoRender=!0,t=new e.DatePicker(t),r.set("datePicker",t),r.set("isCreatePicker",!0),r.get("children").push(t)})},setControlValue:function(e){var t=this,r=t.getInnerControl();n.isDate(e)&&(e=a.format(e,t._getFormatMask())),r.val(e)},_getFormatMask:function(){var e=this,t=e.get("datePicker");return t.showTime||t.get&&t.get("showTime")?"yyyy-mm-dd HH:MM:ss":"yyyy-mm-dd"},parseValue:function(e){return n.isNumber(e)?new Date(e):a.parse(e)},isCurrentValue:function(e){return a.isEquals(e,this.get("value"))},_uiSetMax:function(e){this.addRule("max",e);var t=this,r=t.get("datePicker");r&&(r.set?r.set("maxDate",e):r.maxDate=e)},_uiSetMin:function(e){this.addRule("min",e);var t=this,r=t.get("datePicker");r&&(r.set?r.set("minDate",e):r.minDate=e)}},{ATTRS:{controlTpl:{value:'<input type="text" class="calendar"/>'},defaultRules:{value:{date:!0}},max:{},min:{},value:{setter:function(e){return n.isNumber(e)?new Date(e):e}},datePicker:{shared:!1,value:{}},isCreatePicker:{value:!0}},PARSER:{datePicker:function(e){var t=this,r=t.get("datePicker")||{};return e.hasClass("calendar-time")&&n.mix(r,{showTime:!0}),r}}},{xclass:"form-field-date"});r.exports=l}),define("bui/form/fields/select",["jquery","bui/common","bui/overlay"],function(e,t,r){function i(e,t,r){e.children().remove();var i=r.get("emptyText");i&&r.get("showBlank")&&n("",i,e),a.each(t,function(t){n(t.value,t.text,e)})}function n(e,t,r){var i=new Option(t,e),n=r[0].options;n[n.length]=i}var o=e("jquery"),a=e("bui/common"),l=e("bui/form/fields/base"),u=l.extend({renderUI:function(){var e=this,t=e.getInnerControl(),r=e.get("select");e.get("srcNode")&&t.is("select")||o.isPlainObject(r)&&e._initSelect(r)},_initSelect:function(t){var r=this;r.get("items");e.async("bui/select",function(e){t.render=r.getControlContainer(),t.valueField=r.getInnerControl(),t.autoRender=!0,t=new e.Select(t),r.set("select",t),r.set("isCreate",!0),r.get("children").push(t),t.on("change",function(e){var i=t.getSelectedValue();r.set("value",i)})})},setItems:function(e){var t=this,r=t.get("select");if(o.isPlainObject(e)){var n=[];a.each(e,function(e,t){n.push({value:t,text:e})}),e=n}var l=t.getInnerControl();l.is("select")&&(i(l,e,t),t.setControlValue(t.get("value")),t.getControlValue()||t.setInternal("value","")),r&&(r.set?r.set("items",e):r.items=e)},setControlValue:function(e){var t=this,r=t.get("select"),i=t.getInnerControl();i.val(e),r&&r.set&&r.getSelectedValue()!==e&&r.setSelectedValue(e)},getSelectedText:function(){var e=this,t=e.get("select"),r=e.getInnerControl();if(r.is("select")){var i=r[0],n=i.options[i.selectedIndex];return n?n.text:""}return t.getSelectedText()},getTipTigger:function(){var e=this,t=e.get("select");return t&&t.rendered?t.get("el").find("input"):e.get("el")},_uiSetItems:function(e){e&&this.setItems(e)},setInnerWidth:function(e){var t=this,r=t.getInnerControl(),i=t.get("select"),n=r.outerWidth()-r.width();r.width(e-n),i&&i.set&&i.set("width",e)}},{ATTRS:{items:{},controlTpl:{value:'<input type="hidden"/>'},showBlank:{value:!0},emptyText:{value:"\u8bf7\u9009\u62e9"},select:{shared:!1,value:{}}},PARSER:{emptyText:function(e){if(!this.get("showBlank"))return"";var t=e.find("option"),r=this.get("emptyText");return t.length&&(r=o(t[0]).text()),r}}},{xclass:"form-field-select"});r.exports=u}),define("bui/form/fields/hidden",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("bui/form/fields/base"),n=i.extend({},{ATTRS:{controlTpl:{value:'<input type="hidden"/>'},tpl:{value:""}}},{xclass:"form-field-hidden"});r.exports=n}),define("bui/form/fields/number",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("bui/form/fields/base"),n=i.extend({parseValue:function(e){if(""==e||null==e)return null;if(BUI.isNumber(e))return e;var t=this,r=t.get("allowDecimals");return e=e.replace(/\,/g,""),r?parseFloat(parseFloat(e).toFixed(t.get("decimalPrecision"))):parseInt(e,10)},_uiSetMax:function(e){this.addRule("max",e)},_uiSetMin:function(e){this.addRule("min",e)}},{ATTRS:{max:{},min:{},decorateCfgFields:{value:{min:!0,max:!0}},validEvent:{value:"keyup change"},defaultRules:{value:{number:!0}},allowDecimals:{value:!0},decimalPrecision:{value:2},step:{value:1}}},{xclass:"form-field-number"});r.exports=n}),define("bui/form/fields/check",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=(e("jquery"),e("bui/form/fields/base")),n=i.extend({onValid:function(){var e=this,t=e._getControlChecked();e.setInternal("checked",t),e.fire("change"),t?e.fire("checked"):e.fire("unchecked")},_setControlChecked:function(e){var t=this,r=t.getInnerControl();r.attr("checked",!!e)},_getControlChecked:function(){var e=this,t=e.getInnerControl();return!!t.attr("checked")},_uiSetValue:function(e){this.setControlValue(e)},_uiSetWidth:function(e){},_uiSetChecked:function(e){var t=this;t._setControlChecked(e),t.get("rendered")&&t.onValid()}},{ATTRS:{validEvent:{value:"click"},checked:{value:!1},events:{value:{checked:!1,unchecked:!1}}},PARSER:{checked:function(e){return!!e.attr("checked")}}},{xclass:"form-check-field"});r.exports=n}),define("bui/form/fields/radio",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("bui/form/fields/check"),n=i.extend({bindUI:function(){var e=this,t=e.get("parent"),r=e.get("name");t&&e.getInnerControl().on("click",function(i){var n=t.getFields(r);BUI.each(n,function(t){t!=e&&t.set("checked",!1)})})}},{ATTRS:{controlTpl:{view:!0,value:'<input type="radio"/>'},controlContainer:{value:".radio"},tpl:{value:'<label><span class="radio"></span>{label}</label>'}}},{xclass:"form-field-radio"});r.exports=n}),define("bui/form/fields/checkbox",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("bui/form/fields/check"),n=i.extend({},{ATTRS:{controlTpl:{view:!0,value:'<input type="checkbox"/>'},controlContainer:{value:".checkbox"},tpl:{value:'<label><span class="checkbox"></span>{label}</label>'}}},{xclass:"form-field-checkbox"});r.exports=n}),define("bui/form/fields/plain",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("jquery"),n=e("bui/form/fields/base"),o=n.View.extend({_uiSetValue:function(e){var t,r=this,n=r.get("textEl"),o=r.getControlContainer(),a=r.get("renderer"),l=a?a(e):e,u=r.get("width"),s=0;n&&n.remove(),l=l||"&nbsp;",t=BUI.substitute(r.get("textTpl"),{text:l}),n=i(t).appendTo(o),s=n.outerWidth()-n.width(),n.width(u-s),r.set("textEl",n)}},{ATTRS:{textEl:{},value:{}}},{xclass:"form-field-plain-view"}),a=n.extend({},{ATTRS:{controlTpl:{value:'<input type="hidden"/>'},textTpl:{view:!0,value:'<span class="x-form-text">{text}</span>'},renderer:{view:!0,value:function(e){return e}},tpl:{value:""},xview:{value:o}}},{xclass:"form-field-plain"});r.exports=a}),define("bui/form/fields/list",["jquery","bui/common","bui/list","bui/data","bui/overlay"],function(e,t,r){function i(e){var t=e;return n.isPlainObject(e)&&(t=[],o.each(e,function(e,r){t.push({text:e,value:r})})),t}var n=e("jquery"),o=e("bui/common"),a=e("bui/list"),l=e("bui/form/fields/base"),a=l.extend({initializer:function(){var e=this;e._initList()},_getList:function(){var e=this,t=e.get("children");return t[0]},bindUI:function(){var e=this,t=e._getList();t&&t.on("selectedchange",function(){var r=e._getListValue(t);e.set("value",r)})},_getListValue:function(e){var t=this;return e=e||t._getList(),e.getSelectionValues().join(",")},setControlValue:function(e){var t=this,r=t.getInnerControl(),i=t._getList();r.val(e),t._getListValue(i)!==e&&i.getCount()&&(i.get("multipleSelect")&&i.clearSelection(),i.setSelectionByField(e.split(",")))},syncUI:function(){this.set("list",this._getList())},_initList:function(){var e=this,t=e.get("defaultListCfg"),r=e.get("children"),i=e.get("list")||{};r[0]||(n.isPlainObject(i)&&o.mix(i,t),r.push(i))},setItems:function(e){var t=this,r=t.get("value"),n=t._getList();n.set("items",i(e)),n.setSelectionByField(r.split(","))},_uiSetItems:function(e){e&&this.setItems(e)}},{ATTRS:{controlTpl:{value:'<input type="hidden"/>'},defaultListCfg:{value:{xclass:"simple-list"}},items:{setter:function(e){if(n.isPlainObject(e)){var t=[];o.each(e,function(e,r){t.push({value:r,text:e})}),e=t}return e}},list:{}},PARSER:{list:function(e){var t=e.find(".bui-simple-list");return t.length?{srcNode:t}:void 0}}},{xclass:"form-field-list"});r.exports=a}),define("bui/form/fields/textarea",["jquery","bui/common","bui/overlay"],function(e,t,r){var i=e("bui/form/fields/base"),n=i.extend({_uiSetRows:function(e){var t=this,r=t.getInnerControl();e&&r.attr("rows",e)},_uiSetCols:function(e){var t=this,r=t.getInnerControl();e&&r.attr("cols",e)}},{ATTRS:{controlTpl:{value:"<textarea></textarea>"},rows:{},cols:{},decorateCfgFields:{value:{rows:!0,cols:!0}}}},{xclass:"form-field-textarea"});r.exports=n}),define("bui/form/fields/uploader",["bui/common","jquery","bui/overlay"],function(e,t,r){var i=e("bui/common"),n=i.JSON,o=e("bui/form/fields/base"),a=e("bui/form/rules"),l=o.extend({renderUI:function(){var e=this,t=e.getInnerControl();e.get("srcNode")&&"file"===t.get(0).type||(e._initControlValue(),e._initUpload())},_initUpload:function(){var t=this,r=(t.get("children"),t.get("uploader")||{});e.async("bui/uploader",function(e){r.render=t.getControlContainer(),r.autoRender=!0,r=new e.Uploader(r),t.set("uploader",r),t.set("isCreate",!0),t.get("children").push(r),t._initQueue(r.get("queue")),r.on("success",function(e){var r=t._getUploaderResult();t.setControlValue(r)}),r.get("queue").on("itemremoved",function(){var e=t._getUploaderResult();t.setControlValue(e)})})},_getUploaderResult:function(){var e=this,t=e.get("uploader"),r=t.get("queue"),n=r.getItems(),o=[];return i.each(n,function(e){e.result&&o.push(e.result)}),o},setControlValue:function(e){var t=this,r=t.getInnerControl();r.val(n.stringify(e))},_initControlValue:function(){var e,t=this,r=t.getControlValue();r&&(e=i.JSON.parse(r),t.set("value",e))},_initQueue:function(e){var t=this,r=t.get("value"),n=[];i.each(r,function(e){var t=i.cloneObject(e);t.success=!0,t.result=e,n.push(t)}),e&&e.setItems(n)}},{ATTRS:{controlTpl:{value:'<input type="hidden"/>'},uploader:{setter:function(e){var t=this.get("disabled");return e&&e.isController&&e.set("disabled",t),e}},disabled:{setter:function(e){var t=this,r=t.get("uploader");r&&r.isController&&r.set("disabled",e)}},value:{shared:!1,value:[]},defaultRules:function(){}}},{xclass:"form-field-uploader"});a.add({name:"uploader",msg:"\u4e0a\u4f20\u6587\u4ef6\u9009\u62e9\u6709\u8bef\uff01",validator:function(e,t,r,i){var n=i.get("uploader");return n&&!n.isValid()?r:void 0}}),r.exports=l}),define("bui/form/fields/checklist",["bui/common","jquery","bui/list","bui/data","bui/overlay"],function(e,t,r){"use strict";var i=(e("bui/common"),e("bui/form/fields/list")),n=i.extend({},{ATTRS:{defaultListCfg:{value:{itemTpl:'<li><span class="x-checkbox"></span>{text}</li>',multipleSelect:!0,allowTextSelection:!1}}}},{xclass:"form-field-checklist"
  });r.exports=n}),define("bui/form/fields/radiolist",["bui/common","jquery","bui/list","bui/data","bui/overlay"],function(e,t,r){"use strict";var i=(e("bui/common"),e("bui/form/fields/list")),n=i.extend({},{ATTRS:{defaultListCfg:{value:{itemTpl:'<li><span class="x-radio"></span>{text}</li>',allowTextSelection:!1}}}},{xclass:"form-field-radiolist"});r.exports=n}),define("bui/form/groupvalid",["jquery","bui/common"],function(e,t,r){function i(){}function n(){}var o=e("jquery"),a="x-form-error",l=e("bui/form/valid");BUI.augment(i,l.View,{showError:function(e,t,r){var i=BUI.substitute(t,{error:e}),n=o(i);n.appendTo(r),n.addClass(a)},clearErrors:function(){var e=this,t=e.getErrorsContainer();t.children("."+a).remove()}}),n.ATTRS=ATTRS=BUI.merge(!0,l.ATTRS,{events:{value:{validchange:!0,change:!0}}}),BUI.augment(n,l,{__bindUI:function(){var e=this,t="validchange change";e.on(t,function(t){var r=t.target;if(r!=this&&e.get("showError")){var i=r.isValid();e._hasAllChildrenValid()&&(i=i&&e.isChildrenValid(),i&&(e.validControl(e.getRecord()),i=e.isSelfValid())),i?e.clearErrors():e.showErrors()}})},isValid:function(){if(this.get("disabled"))return!0;var e=this,t=e.isChildrenValid();return t&&e.isSelfValid()},valid:function(){var e=this,t=e.get("children");e.get("disabled")||BUI.each(t,function(e){e.get("disabled")||e.valid()})},_hasAllChildrenValid:function(){var e=this,t=e.get("children"),r=!0;return BUI.each(t,function(e){return e.get("disabled")||e.get("hasValid")!==!1?void 0:(r=!1,!1)}),r},isChildrenValid:function(){var e=this,t=e.get("children"),r=!0;return BUI.each(t,function(e){return e.get("disabled")||e.isValid()?void 0:(r=!1,!1)}),r},isSelfValid:function(){return!this.get("error")},validControl:function(e){var t=this,r=t.getValidError(e);t.set("error",r)},getErrors:function(){var e=this,t=e.get("children"),r=e.get("showChildError"),i=null,n=[];return r&&BUI.each(t,function(e){e.getErrors&&(n=n.concat(e.getErrors()))}),e._hasAllChildrenValid()&&e.isChildrenValid()&&(i=e.get("error"),i&&n.push(i)),n},_uiSetErrorTpl:function(e){var t=this,r=t.get("children");BUI.each(r,function(t){t.get("userConfig").errorTpl||t.set("errorTpl",e)})}}),n.View=i,r.exports=n}),define("bui/form/form",["jquery","bui/common","bui/overlay","bui/list","bui/data"],function(e,t,r){var i=e("jquery"),n=e("bui/common"),o=e("bui/form/fieldcontainer"),a=(n.Component,{NORMAL:"normal",AJAX:"ajax",IFRAME:"iframe"}),l=o.View.extend({_uiSetMethod:function(e){this.get("el").attr("method",e)},_uiSetAction:function(e){this.get("el").attr("action",e)}},{ATTRS:{method:{},action:{}}},{xclass:"form-view"}),u=o.extend({renderUI:function(){var e,t=this,r=t.get("buttonBar");i.isPlainObject(r)&&t.get("buttons")&&(e=n.merge(t.getDefaultButtonBarCfg(),r),t._initButtonBar(e)),t._initSubmitMask()},_initButtonBar:function(t){var r=this;e.async("bui/toolbar",function(e){buttonBar=new e.Bar(t),r.set("buttonBar",buttonBar)})},bindUI:function(){var e=this,t=e.get("el");t.on("submit",function(t){return e.valid(),e.isValid()&&e.onBeforeSubmit()!==!1?void(e.isValid()&&e.get("submitType")===a.AJAX&&(t.preventDefault(),e.ajaxSubmit())):(t.preventDefault(),void e.focusError())})},getDefaultButtonBarCfg:function(){var e=this,t=e.get("buttons");return{autoRender:!0,elCls:"toolbar",render:e.get("el"),items:t,defaultChildClass:"bar-item-button"}},focusError:function(){var e=this,t=e.getFields();n.each(t,function(e){if(e.get("visible")&&!e.get("disabled")&&!e.isValid()){try{e.focus()}catch(t){n.log(t)}return!1}})},submit:function(e){var t=this,r=t.get("submitType");if(t.valid(),t.isValid()){if(0==t.onBeforeSubmit())return;r===a.NORMAL?t.get("el")[0].submit():r===a.AJAX&&t.ajaxSubmit(e)}else t.focusError()},ajaxSubmit:function(e){var t,r=this,o=r.get("method"),a=r.get("action"),l=r.get("callback"),u=r.get("submitMask"),s=r.serializeToObject(),c=n.merge(!0,{url:a,type:o,dataType:"json",data:s},e);e&&e.success&&(t=e.success),c.success=function(e){u&&u.hide&&u.hide(),t&&t(e),l&&l.call(r,e)},u&&u.show&&u.show(),i.ajax(c)},_initSubmitMask:function(){var t=this,r=t.get("submitType"),o=t.get("submitMask");r===a.AJAX&&o&&e.async("bui/mask",function(e){var r=i.isPlainObject(o)?o:{};o=new e.LoadMask(n.mix({el:t.get("el")},r)),t.set("submitMask",o)})},serializeToObject:function(){return n.FormHelper.serializeToObject(this.get("el")[0])},toObject:function(){return this.serializeToObject()},onBeforeSubmit:function(){return this.fire("beforesubmit")},reset:function(){var e=this,t=e.get("initRecord");e.setRecord(t)},resetTips:function(){var e=this,t=e.getFields();n.each(t,function(e){e.resetTip()})},destructor:function(){var e=this,t=e.get("buttonBar"),r=e.get("submitMask");t&&t.destroy&&t.destroy(),r&&r.destroy&&r.destroy()},_uiSetInitRecord:function(e){this.setRecord(e)}},{ATTRS:{action:{view:!0,value:""},allowTextSelection:{value:!0},events:{value:{beforesubmit:!1}},method:{view:!0,value:"get"},defaultLoaderCfg:{value:{autoLoad:!0,property:"record",dataType:"json"}},submitMask:{value:{msg:"\u6b63\u5728\u63d0\u4ea4\u3002\u3002\u3002"}},submitType:{value:"normal"},focusError:{value:!0},callback:{},decorateCfgFields:{value:{method:!0,action:!0}},defaultChildClass:{value:"form-field"},elTagName:{value:"form"},buttons:{},buttonBar:{shared:!1,value:{}},childContainer:{value:".x-form-fields"},initRecord:{},showError:{value:!1},xview:{value:l},tpl:{value:'<div class="x-form-fields"></div>'}}},{xclass:"form"});u.View=l,r.exports=u}),define("bui/form/row",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){var i=(e("bui/common"),e("bui/form/fieldcontainer")),n=i.extend({},{ATTRS:{elCls:{value:"row"},defaultChildCfg:{value:{tpl:' <label class="control-label">{label}</label>              <div class="controls">              </div>',childContainer:".controls",showOneError:!0,controlContainer:".controls",elCls:"control-group span8",errorTpl:'<span class="valid-text"><span class="estate error"><span class="x-icon x-icon-mini x-icon-error">!</span><em>{error}</em></span></span>'}},defaultChildClass:{value:"form-field-text"}}},{xclass:"form-row"});r.exports=n}),define("bui/form/fieldgroup",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){var i=e("bui/common"),n=e("bui/form/group/base");return i.mix(n,{Range:e("bui/form/group/range"),Check:e("bui/form/group/check"),Select:e("bui/form/group/select")}),n}),define("bui/form/group/base",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){var i=(e("bui/common"),e("bui/form/fieldcontainer")),n=i.extend({},{ATTRS:{label:{view:!0},defaultChildClass:{value:"form-field"}}},{xclass:"form-group"});r.exports=n}),define("bui/form/group/range",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){function i(e,t,r){var i=e.get("allowEqual");return i?t>=r:t>r}var n=e("bui/form/group/base"),o=n.extend({},{ATTRS:{rangeText:{value:"\u5f00\u59cb\u4e0d\u80fd\u5927\u4e8e\u7ed3\u675f\uff01"},allowEqual:{value:!0},validator:{value:function(e){for(var t=this,r=t.getFields(),n=!0,o=1;o<r.length;o++){var a,l,u=r[o],s=r[o-1];if(u&&s&&(a=u.get("value"),l=s.get("value"),!i(t,a,l))){n=!1;break}}return n?null:t.get("rangeText")}}}},{xclass:"form-group-range"});r.exports=o}),define("bui/form/group/check",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){function i(e){var t=e.getFieldAt(0);return t?t.get("name"):""}var n=e("bui/form/group/base"),o=n.extend({bindUI:function(){var e=this;e.on("change",function(t){var r=i(e),n=e.get("range"),o=e.getRecord(),a=o[r],l=n[1];a&&a.length>=l?e._setFieldsEnable(r,!1):e._setFieldsEnable(r,!0)})},_setFieldsEnable:function(e,t){var r=this,i=r.getFields(e);BUI.each(i,function(e){t?e.enable():e.get("checked")||e.disable()})},_uiSetRange:function(e){this.addRule("checkRange",e)}},{ATTRS:{range:{setter:function(e){return(BUI.isString(e)||BUI.isNumber(e))&&(e=[parseInt(e,10)]),e}}}},{xclass:"form-group-check"});r.exports=o}),define("bui/form/group/select",["bui/common","jquery","bui/overlay","bui/list","bui/data"],function(e,t,r){function i(e){var t=[];return BUI.each(e,function(e){t.push({text:e.text,value:e.id})}),t}var n=e("bui/form/group/base"),o=e("bui/data"),a=BUI.Component.UIBase.Bindable,l=n.extend([a],{initializer:function(){var e=this,t=e.get("url"),r=e.get("store")||e._getStore();r.isStore||(r.autoLoad=!0,t&&(r.url=t),r=new o.TreeStore(r)),e.set("store",r)},bindUI:function(){var e=this;e.on("change",function(t){var r=t.target;if(r!=e){var i=r,n=i.get("value"),o=e._getFieldIndex(i)+1;e._valueChange(n,o)}})},onLoad:function(e){var t=this,r=e?e.node:t.get("store").get("root");t._setFieldItems(r.level,r.children)},_getStore:function(){var e=this,t=e.get("type");return t&&u[t]?u[t]:{}},_valueChange:function(e,t){var r=this,i=r.get("store");if(e){var n=i.findNode(e);if(!n)return;i.isLoaded(n)?r._setFieldItems(t,n.children):i.loadNode(n)}else r._setFieldItems(t,[])},_setFieldItems:function(e,t){var r=this,n=r.getFieldAt(e),o=i(t);n&&(n.setItems(o),r._valueChange(n.get("value"),e+1))},_getFieldIndex:function(e){var t=this,r=t.getFields();return BUI.Array.indexOf(e,r)}},{ATTRS:{type:{},store:{}}},{xclass:"form-group-select"}),u={};l.addType=function(e,t){u[e]=t},l.addType("city",{proxy:{url:"http://lp.taobao.com/go/rgn/citydistrictdata.php",dataType:"jsonp"},map:{isleaf:"leaf",value:"text"}}),r.exports=l}),define("bui/form/hform",["jquery","bui/common","bui/overlay","bui/list","bui/data"],function(e,t,r){var i=(e("jquery"),e("bui/common"),e("bui/form/form")),n=i.extend({getDefaultButtonBarCfg:function(){var e=this,t=e.get("buttons");return{autoRender:!0,elCls:"actions-bar toolbar row",tpl:'<div class="form-actions span21 offset3"></div>',childContainer:".form-actions",render:e.get("el"),items:t,defaultChildClass:"bar-item-button"}}},{ATTRS:{defaultChildClass:{value:"form-row"},errorTpl:{value:'<span class="valid-text"><span class="estate error"><span class="x-icon x-icon-mini x-icon-error">!</span><em>{error}</em></span></span>'},elCls:{value:"form-horizontal"}},PARSER:{}},{xclass:"form-horizontal"});r.exports=n});