(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-582ae076"],{"48f5":function(t,e,i){"use strict";var s=i("e6d7"),a=i.n(s);a.a},af1a:function(t,e,i){"use strict";var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{class:["img-upload-box",{"img-upload-box-disabled":t.opt.f_json.name_disabled}]},[t._l(t.uploadList,(function(e,s){return i("div",{key:s,staticClass:"img-upload-list"},["finished"===e.status?[i("a",{staticClass:"file",attrs:{href:e.url}},[t._v(t._s(t.ext(e.url)))]),i("div",{staticClass:"tool"},[t.opt.f_json.upload_quantity[1]>1?i("Icon",{attrs:{type:"ios-arrow-round-back"},nativeOn:{click:function(e){return t.handleBack(s)}}}):t._e(),t.opt.f_json.upload_quantity[1]>1?i("Icon",{attrs:{type:"ios-arrow-round-forward"},nativeOn:{click:function(e){return t.handleForward(s)}}}):t._e(),i("Icon",{attrs:{type:"ios-trash-outline"},nativeOn:{click:function(i){return t.handleRemove(e)}}})],1),t.opt.f_json.name_disabled?t._e():i("div",{staticClass:"name"},[i("Input",{attrs:{size:"default"},on:{"on-change":t.change},model:{value:e.name,callback:function(i){t.$set(e,"name",i)},expression:"item.name"}})],1)]:[e.showProgress?i("Progress",{attrs:{percent:t.percentage(e.percentage),"text-inside":""}}):t._e()]],2)})),i("Upload",{ref:"upload",staticClass:"img-upload-btn",attrs:{"show-upload-list":!1,"default-file-list":t.defaultList,"on-success":t.handleSuccess,"before-upload":t.handleBeforeUpload,multiple:"",type:"drag",action:t.action}},[i("Icon",{attrs:{type:"ios-cloud-upload",size:"20"}})],1)],2),i("div",{staticClass:"ivu-form-item-tips"},[t._v(t._s(t.opt.f_json.tips))]),i("Modal",{attrs:{title:"查看图片"},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[i("img",{staticStyle:{width:"100%"},attrs:{src:t.imgItem.url}}),i("div",{attrs:{slot:"footer"},slot:"footer"},[i("Button",{attrs:{size:"large",icon:"md-close"},on:{click:function(e){t.visible=!1}}},[t._v("关闭")])],1)])],1)},a=[],n={props:{value:Array,opt:Object},data:function(){return{action:"aspapi/inc/upload.asp",imgItem:{},visible:!1,defaultList:[],uploadList:[],select:0}},created:function(){this.initUrl()},mounted:function(){this.uploadList=this.$refs.upload.fileList,this.change()},methods:{ext:function(t){return t.replace(/.+\./,"")},percentage:function(t){return parseInt(t)},initUrl:function(){this.value?(this.defaultList=this.value,this.select=this.defaultList.length):this.defaultList=[]},change:function(){this.$emit("input",this.$refs.upload.fileList.map((function(t){return{name:t.name,url:t.url}})))},handleView:function(t){this.imgItem=t,this.visible=!0},handleRemove:function(t){var e=this;this.$Modal.confirm({title:"删除这个文件",content:"",onOk:function(){var i=e.$refs.upload.fileList;e.$refs.upload.fileList.splice(i.indexOf(t),1),e.select--,e.change()},onCancel:function(){}})},handleBack:function(t){this.uploadList[t]=this.uploadList.splice(t-1,1,this.uploadList[t])[0],this.change()},handleForward:function(t){this.uploadList[t]=this.uploadList.splice(t+1===this.uploadList.length?0:t+1,1,this.uploadList[t])[0],this.change()},handleSuccess:function(t,e){e.url=t.url,e.name=e.name.replace(/(.*\/)*([^.]+).*/gi,"$2"),this.change()},handleBeforeUpload:function(t){if(this.select-this.opt.f_json.upload_quantity[1]>-1)return this.$Message.error("只可以上传".concat(this.opt.f_json.upload_quantity[1],"个文件")),!1;var e=this.opt.f_json.upload_ext.split(",");if(e.length){var i=t.name.split(".").pop().toLocaleLowerCase(),s=e.some((function(t){return t.toLocaleLowerCase()===i}));if(!s)return this.$Message.error("只允许上传[".concat(this.opt.f_json.upload_ext,"]类型文件")),!1}if(t.size/1024<this.opt.f_json.upload_size[0]||t.size/1024>this.opt.f_json.upload_size[1])return this.$Message.error("".concat(t.name,"大小不符合要求(").concat(this.opt.f_json.upload_size.join("-"),"kb)")),!1;this.select++}}},o=n,l=(i("48f5"),i("9ca4")),u=Object(l["a"])(o,s,a,!1,null,"0763f6bf",null);e["a"]=u.exports},e6d7:function(t,e,i){}}]);