(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{584:function(e,t,n){e.exports={}},627:function(e,t,n){"use strict";n(584)},654:function(e,t,n){"use strict";n.r(t);n(65),n(521),n(216),n(46),n(11),n(32),n(79);var l=n(676),o={name:"ImageUpload",components:{draggable:n.n(l).a},props:{list:{type:Array,default:function(){return[]}},max:{type:Number,default:16},disablePreview:{type:Boolean,default:!1},width:{type:String,default:"150px"},height:{type:String,default:"150px"}},data:function(){return{imageList:[],loading:!1,uploadPercent:0,imageDialogVisible:!1,imageUrl:""}},computed:{fulled:function(){return 0}},watch:{list:function(){this.imageList=JSON.parse(JSON.stringify(this.list))}},mounted:function(){this.updateList()},methods:{handleUpload:function(e,t){var n=this;if(this.fileList=[],"ready"===e.status){this.loading=!0;var l=setInterval((function(){n.uploadPercent>=99?clearInterval(l):n.uploadPercent+=1}),100)}var o=new FormData;t.forEach((function(e){o.append("file",e.raw)})),o.append("type",1),this.$axios.post("/user_base/imagesUpload",o).then((function(t){if(200===t.result.code)return n.imageList.push({url:t.result.data,uid:e.uid}),void n.updateList();n.$message({message:t.result.message,type:"warning"})})).catch((function(e){console.log(e,"component upload image error"),n.$message.error(e.response.data.msg)})).finally((function(){n.loading=!1,n.uploadPercent=0}))},handleRemove:function(e){this.imageList.splice(e,1),this.updateList()},handlePictureCardPreview:function(e){this.imageUrl=e.url,this.imageDialogVisible=!0},updateList:function(){this.$emit("update:list",JSON.parse(JSON.stringify(this.imageList)))},end:function(){this.updateList()}}},r=(n(627),n(22)),component=Object(r.a)(o,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"com-image-upload"},[t("draggable",{staticClass:"flex start wrap",attrs:{draggable:".image-item"},on:{end:e.end},model:{value:e.imageList,callback:function(t){e.imageList=t},expression:"imageList"}},[e._l(e.imageList,(function(n,l){return t("div",{key:n.uid||l,staticClass:"image-item flex",style:{width:e.width,height:e.height}},[t("img",{attrs:{src:n.url,alt:""}}),e._v(" "),t("div",{staticClass:"action-area flex center"},[e.disablePreview?e._e():t("span",{staticClass:"action-icon",on:{click:function(t){return e.handlePictureCardPreview(n)}}},[t("i",{staticClass:"el-icon-zoom-in"})]),e._v(" "),t("span",{staticClass:"action-icon",on:{click:function(t){return e.handleRemove(l)}}},[t("i",{staticClass:"el-icon-delete"})])])])})),e._v(" "),t("el-progress",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticStyle:{margin:"8px"},attrs:{type:"circle",percentage:e.uploadPercent,width:Number(e.width.slice(0,e.width.length-2))}}),e._v(" "),t("div",{staticClass:"upload-wrap",class:{hide:e.loading||e.imageList.length>=e.max},style:{width:e.width,height:e.height}},[t("el-upload",{ref:"pictureUpload",staticClass:"custom-upload-item",attrs:{multiple:!0,limit:e.max,action:"",drag:"",accept:".jpg,.png,.jpeg","list-type":"picture-card","file-list":e.imageList,"show-file-list":!1,"auto-upload":!1,"on-remove":e.handleRemove,"on-preview":e.handlePictureCardPreview,"on-change":function(t,n){e.handleUpload(t,n)}}},[t("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)],2),e._v(" "),t("el-dialog",{attrs:{visible:e.imageDialogVisible},on:{"update:visible":function(t){e.imageDialogVisible=t}}},[t("img",{attrs:{width:"100%",src:e.imageUrl,alt:""}})])],1)}),[],!1,null,"049aaa02",null);t.default=component.exports}}]);
//# sourceMappingURL=25f98ad.js.map