import{r as u,w as g,v as U,e as x}from"./vendor-39c32a1b.js";import{q as y}from"./qiNiu.config-a8af251c.js";import{n as w,g as S}from"./index-8fa791df.js";const C={__name:"LJUploadFiles",props:{value:{type:String,default:null},accept:{type:String,default:"."},autoUpload:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},limit:{type:Number,default:10}},emits:["input"],setup(r,{emit:e}){const s=r,a="http://sms.9haoai.com/api/upload_qiniu/",d=u(y.uploadFileField),f=u(),n=u(c(s.value));g(()=>n.value,t=>{e("input",p(t))},{deep:!0});function p(t){return t.filter(l=>l.status==="success").map(l=>l.urls).join(",")}function c(t){function l(o){return{name:o,url:o,urls:o,status:"success",uid:U()}}return t?t.indexOf(",")>-1?t.split(",").map(o=>l(o)):[l(t)]:[]}function m(t,l,o){n.value=o,n.value.filter(i=>i.status==="success"&&!i.urls).map(i=>{i.urls=i.response.data})}function _(t,l){n.value=l}function v(t){}function h(){return{Authorization:"token "+S("token")}}function F(t,l){x.exports.Message.warning(`\u5F53\u524D\u9650\u5236\u9009\u62E9 ${s.limit} \u4E2A\u6587\u4EF6\uFF0C\u672C\u6B21\u9009\u62E9\u4E86 ${l.length} \u4E2A\u6587\u4EF6`)}return{__sfc:!0,props:s,uploadUrl:a,uploadFileNameField:d,emits:e,LJUploadFilesRef:f,modelFiles:n,formatValueStr:p,formatValueArray:c,handleUploadSuccess:m,handleRemove:_,handlePreview:v,setHeaders:h,handleExceed:F}}};var L=function(){var e=this,s=e._self._c,a=e._self._setupProxy;return s("div",{staticClass:"lj-upload-files"},[s("el-upload",{ref:"LJUploadFilesRef",attrs:{action:a.uploadUrl,accept:e.accept,headers:a.setHeaders(),"auto-upload":e.autoUpload,name:a.uploadFileNameField,"file-list":a.modelFiles,"on-success":a.handleUploadSuccess,"on-remove":a.handleRemove,"on-preview":a.handlePreview,"on-exceed":a.handleExceed,multiple:e.multiple,limit:e.limit}},[s("div",{staticClass:"uploadFile"},[s("i",{staticClass:"el-icon-upload2",staticStyle:{"margin-right":"10px"}}),e._v("\u4E0A\u4F20\u6587\u4EF6 ")]),s("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" \u9009\u62E9"+e._s(e.accept!=="."?e.accept:"")+"\u6587\u4EF6 ")])])],1)},J=[],R=w(C,L,J,!1,null,"f6872968",null,null);const q=R.exports;export{q as L};
