import{d as p,E as r,ah as u,c as e,ag as h,x as g,l as d,ai as n,a as f}from"./vendor.f5bf56e4.js";import{i as m}from"./index.70f820ec.js";import{r as y}from"./index.ebd578f0.js";const b="_colUpload_or6a6_1",U="_uploadSection_or6a6_4",S="_uploadFile_or6a6_14",x="_fileUpload_or6a6_28",_="_uploadClass_or6a6_43";var a={colUpload:b,uploadSection:U,uploadFile:S,fileUpload:x,uploadClass:_},C=p({name:"col-upload",props:{modelValue:{type:String,default:""},uploadType:{type:String,default:"image"},disabled:{type:Boolean,default:!1},bucket:{type:String,default:"daya"},size:{type:Number,default:5},accept:{type:String,default:".png,.jpg,.jpeg"},tips:{type:String,default:"\u8BF7\u4E0A\u4F20\u56FE\u7247"},extraTips:{type:String,default:"\u56FE\u7247\u6700\u5927\u4E0D\u80FD\u8D85\u8FC75MB"},onChange:{type:Function,default:()=>{}}},data(){return{ossUploadUrl:`https://${this.bucket}.ks3-cn-beijing.ksyuncs.com/`,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""},fileList:[],loading:null}},methods:{handleSuccess(){var s;(s=this.loading)==null||s.close();let l=this.ossUploadUrl+this.dataObj.key;console.log(l),this.$emit("update:modelValue",l),this.onChange(l)},handleRemove(){console.log("remove")},handleChange(){console.log("handleChange")},handleProgress(){console.log("handleProgress")},handleError(){var l;(l=this.loading)==null||l.close()},async beforeUpload(l){console.log(l);let s=!0;if(this.size&&(s=l.size/1024/1024[e("div",{ref:"uploadDom",class:[a.uploadClass,"w-full"],style:{height:this.uploadType==="image"?"85px":"48px"}},[this.modelValue?this.uploadType==="image"?e(g,{src:this.modelValue,fit:"cover",class:a.uploadSection},null):e("div",{class:a.uploadFile},[e(d,null,{default:()=>[e(n,null,null)]}),e("span",{class:"whitespace-nowrap overflow-hidden text-ellipsis",style:{lineHeight:"1.2"}},[this.fileName(this.modelValue)])]):this.uploadType==="image"?e("div",{class:[a.uploadSection,"flex items-center flex-col justify-center"]},[e("img",{src:m,class:"w-8 h-7 mb-3"},null),e("p",null,[this.tips])]):e("div",{class:a.uploadFile},[e(d,null,{default:()=>[e(n,null,null)]}),f("\u4E0A\u4F20\u6587\u4EF6")])])]}),e("p",{class:"text-3 text-[#999999] leading-6 pt-1"},[this.extraTips])])}});export{C};