You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
137 KiB
1 line
137 KiB
3 months ago
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-home-home"],{"011f":function(e,t,n){"use strict";var a=n("4ea4");n("99af"),n("4de4"),n("c975"),n("d81d"),n("a434"),n("a9e3"),n("b64b"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n("ade3")),i=a(n("bbba")),r=a(n("9176"));r.default.warning=function(){};var c={name:"u-form-item",mixins:[i.default],inject:{uForm:{default:function(){return null}}},props:{label:{type:String,default:""},prop:{type:String,default:""},borderBottom:{type:[String,Boolean],default:""},labelPosition:{type:String,default:""},labelWidth:{type:[String,Number],default:""},labelStyle:{type:Object,default:function(){return{}}},labelAlign:{type:String,default:""},rightIcon:{type:String,default:""},leftIcon:{type:String,default:""},leftIconStyle:{type:Object,default:function(){return{}}},rightIconStyle:{type:Object,default:function(){return{}}},required:{type:Boolean,default:!1}},data:function(){return{initialValue:"",validateState:"",validateMessage:"",errorType:["message"],fieldValue:"",parentData:{borderBottom:!0,labelWidth:90,labelPosition:"left",labelStyle:{},labelAlign:"left"}}},watch:{validateState:function(e){this.broadcastInputError()},"uForm.errorType":function(e){this.errorType=e,this.broadcastInputError()}},computed:{uLabelWidth:function(){return"left"==this.elLabelPosition?"true"===this.label||""===this.label?"auto":this.$u.addUnit(this.elLabelWidth):"100%"},showError:function(){var e=this;return function(t){return!(e.errorType.indexOf("none")>=0)&&e.errorType.indexOf(t)>=0}},elLabelWidth:function(){return 0!=this.labelWidth||""!=this.labelWidth?this.labelWidth:this.parentData.labelWidth?this.parentData.labelWidth:90},elLabelStyle:function(){return Object.keys(this.labelStyle).length?this.labelStyle:this.parentData.labelStyle?this.parentData.labelStyle:{}},elLabelPosition:function(){return this.labelPosition?this.labelPosition:this.parentData.labelPosition?this.parentData.labelPosition:"left"},elLabelAlign:function(){return this.labelAlign?this.labelAlign:this.parentData.labelAlign?this.parentData.labelAlign:"left"},elBorderBottom:function(){return""!==this.borderBottom?this.borderBottom:!this.parentData.borderBottom||this.parentData.borderBottom}},methods:{broadcastInputError:function(){this.broadcast("u-input","on-form-item-error","error"===this.validateState&&this.showError("border"))},setRules:function(){var e=this;this.$on("on-form-blur",e.onFieldBlur),this.$on("on-form-change",e.onFieldChange)},getRules:function(){var e=this.parent.rules;return e=e?e[this.prop]:[],[].concat(e||[])},onFieldBlur:function(){this.validation("blur")},onFieldChange:function(){this.validation("change")},getFilteredRule:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.getRules();return e?t.filter((function(t){return t.trigger&&-1!==t.trigger.indexOf(e)})):t},validation:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.fieldValue=this.parent.model[this.prop];var a=this.getFilteredRule(e);if(!a||0===a.length)return n("");this.validateState="validating";var i=new r.default((0,o.default)({},this.prop,a));i.validate((0,o.default)({},this.prop,this.fieldValue),{firstFields:!0},(function(e,a){t.validateState=e?"error":"success",t.validateMessage=e?e[0].message:"",n(t.validateMessage)}))},resetField:function(){this.parent.model[this.prop]=this.initialValue,this.validateState="success"}},mounted:function(){var e=this;this.parent=this.$u.$parent.call(this,"u-form"),this.parent&&(Object.keys(this.parentData).map((function(t){e.parentData[t]=e.parent[t]})),this.prop&&(this.parent.fields.push(this),this.errorType=this.parent.errorType,this.initialValue=this.fieldValue,this.$nextTick((function(){e.setRules()}))))},beforeDestroy:function(){var e=this;this.parent&&this.prop&&this.parent.fields.map((function(t,n){t===e&&e.parent.fields.splice(n,1)}))}};t.default=c},"012b":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return a}));var a
|