import{a as e,G as a,H as s,o as l,j as t,ax as u,ay as o}from"./index-d4baa715.js";import{_ as i}from"./uv-upload.078c67d5.js";import{_ as m}from"./_plugin-vue_export-helper.1b428a4d.js";const p=m({__name:"upload-file",props:["modelValue"],emits:["update:modelValue"],setup(m,{emit:p}){const n=e(m.modelValue),r=e=>{n.value.splice(e.index,1),p("update:modelValue",n.value)},d=async e=>{let a=[].concat(e.file),s=n.value.length;a.map((e=>{n.value.push({...e,status:"uploading",message:"上传中"})}));for(let l=0;l<a.length;l++){const e=await c(a[l].url);let t=n.value[s];n.value.splice(s,1,Object.assign(t,{status:"success",message:"",url:e})),s++}p("update:modelValue",n.value)},c=e=>new Promise(((a,s)=>{u({url:o,filePath:e,name:"file",formData:{user:"test"},success:e=>{setTimeout((()=>{a(JSON.parse(e.data).data)}),10)}})}));return(e,u)=>{const o=a(s("uv-upload"),i);return l(),t(o,{fileList:n.value,name:"1",multiple:"",maxCount:10,onAfterRead:d,onDelete:r},null,8,["fileList"])}}},[["__scopeId","data-v-be36f99c"]]);export{p as _};
