(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22e146"],{f9da:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("el-upload",{attrs:{action:e.action,"list-type":"picture-card","http-request":e.httpRequest,limit:e.limit,"file-list":e.fileList,disabled:e.disabled,"on-exceed":e.exceed,"on-success":e.success,headers:{token:e.token},multiple:e.multiple,"on-preview":e.handlePictureCardPreview,"on-remove":e.handleRemove,"before-upload":e.beforeUpload}},[i("i",{staticClass:"el-icon-plus"})]),i("el-dialog",{attrs:{visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("img",{attrs:{width:"100%",src:e.dialogImageUrl,alt:""}})])],1)},o=[],a=i("f374"),l=(i("7479"),i("5880")),s={name:"elx-upload",props:{limit:null,multiple:{type:Boolean,default:!0},fileList:{type:Array,default:[]},value:[Array,String],disabled:Boolean,category:Array},data:function(){var e=this.$service.common.upload();return{action:e.url,list:[],index:0,dialogImageUrl:"",dialogVisible:!1}},computed:Object(a["a"])({},Object(l["mapGetters"])(["token"])),mounted:function(){this.init()},methods:{init:function(){},httpRequest:function(e){var t=this,i=e.file;this.getBase64(i).then((function(i){t.$service.common.uploadImg({content:i,categoryId:t.category}).then((function(t){e.onSuccess(t)}))}))},beforeUpload:function(e){if(e.size/1024/1024>1)return this.$message.warning("上传的图片不能超过1M"),!1},handleRemove:function(e,t){this.$emit("handleRemove",{file:e,fileList:t})},handlePictureCardPreview:function(e){this.dialogImageUrl=e.showBBGG||e.url,this.dialogVisible=!0},exceed:function(){this.$message.warning("最多只能上传".concat(this.limit,"张图片"))},success:function(e,t,i){this.$emit("update:fileList",i),this.$emit("success",{response:e,file:t,fileList:i})},getBase64:function(e){return new Promise((function(t,i){var n=new FileReader,o="";n.readAsDataURL(e),n.onload=function(){o=n.result},n.onerror=function(e){i(e)},n.onloadend=function(){t(o)}}))}}},r=s,c=i("5d22"),u=Object(c["a"])(r,n,o,!1,null,"34293a5c",null);t["default"]=u.exports}}]);