12 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[34],{611:function(e,t,o){e.exports={}},653:function(e,t,o){"use strict";o(611)},732:function(e,t,o){"use strict";o.r(t);o(39);var l={name:"GlobalForm",props:{showDeleteBtn:{type:Boolean,default:!0},showLoginBtn:{type:Boolean,default:!0},showRegisterBtn:{type:Boolean,default:!0},formConfig:{type:Array,required:!0},formData:{type:Object,required:!0},rules:{type:Object},submitLoading:{type:Boolean}},data:function(){return{flag:!1}},methods:{submit:function(){var e=this;this.$refs.ruleForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.$emit("handleSubmit")}))},close:function(){this.$emit("handleClose")},showPassword:function(){this.flag=!this.flag}}},n=(o(653),o(22)),component=Object(n.a)(l,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"form global-form"},[t("el-form",{ref:"ruleForm",staticClass:"form-list",attrs:{model:e.formData,rules:e.rules}},e._l(e.formConfig,(function(o){return t("el-form-item",{key:o.label,attrs:{prop:o.prop}},["input"===o.type?t("el-input",{style:{width:o.width},attrs:{disabled:o.disabled,placeholder:o.placeholder,clearable:""},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}}):e._e(),e._v(" "),"password"===o.type?t("el-input",{style:{width:o.width},attrs:{type:e.flag?"text":"password",autocomplete:"off",placeholder:o.placeholder,clearable:""},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}},[e.flag?t("i",{staticClass:"el-input__icon iconfont",staticStyle:{"font-size":"22px"},attrs:{slot:"suffix"},on:{click:e.showPassword},slot:"suffix"},[e._v("")]):t("i",{staticClass:"el-input__icon iconfont",staticStyle:{"font-size":"22px"},attrs:{slot:"suffix"},on:{click:e.showPassword},slot:"suffix"},[e._v("")])]):e._e(),e._v(" "),"textarea"===o.type?t("el-input",{style:{width:o.width},attrs:{type:"textarea",disabled:o.disabled,maxlength:o.maxlength,rows:o.rows,"show-word-limit":o.showWordLimit},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}}):e._e(),e._v(" "),"select"===o.type?t("el-select",{style:{width:o.width},attrs:{disabled:o.disabled,clearable:"",multiple:e.multiple,placeholder:o.placeholder},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}},e._l(o.selectList,(function(option){return t("el-option",{key:option.id,attrs:{label:option.name,value:option.id}})})),1):e._e(),e._v(" "),"selectObj"===o.type?t("el-select",{style:{width:o.width},attrs:{disabled:o.disabled,filterable:"",clearable:"",placeholder:o.placeholder},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}},e._l(o.selectList,(function(e,o){return t("el-option",{key:parseInt(o),attrs:{label:e,value:parseInt(o)}})})),1):e._e(),e._v(" "),"radio"===o.type?t("el-radio-group",{attrs:{disabled:o.disabled},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}},e._l(o.radios,(function(e){return t("el-radio",{key:e.label,attrs:{label:e.label}})})),1):e._e(),e._v(" "),"checkbox"===o.type?t("el-checkbox-group",{attrs:{disabled:o.disabled},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}},e._l(o.checkboxs,(function(o){return t("el-checkbox",{key:o.label,attrs:{label:o.label}},[e._v(e._s(o.label))])})),1):e._e(),e._v(" "),"switch"===o.type?t("el-switch",{attrs:{disabled:o.disabled},on:{change:function(t){o.change&&o.change(e.formData[o.prop])}},model:{value:e.formData[o.prop],callback:function(t){e.$set(e.formData,o.prop,t)},expression:"formData[item.prop]"}}):e._e(),e._v(" "),"slot"===o.type?[e._t(o.slotName)]:e._e()],2)})),1),e._v(" "),t("div",{staticClass:"submit-btn"},[e.showLoginBtn?t("el-button",{attrs:{loading:e.submitLoading},nativeOn:{click:function(t){return e.submit.apply(null,arguments)}}},[e._v("\n LOGIN\n ")]):e._e(),e._v(" "),e.showRegisterBtn?t("el-button",{attrs:{loading:e.submitLoading},nativeOn:{click:function(t){return e.submit.apply(null,arguments)}}},[e._v("\n REGISTER\n ")]):e._e(),e._v(" "),e.showDeleteBtn?t("el-button",{nativeOn:{click:function(t){return e.close.apply(null,arguments)}}},[e._v("取 消")]):e._e()],1)],1)}),[],!1,null,null,null);t.default=component.exports}}]);
- //# sourceMappingURL=a5f7640.js.map
|