import{D as e}from"./Document-61a10b68-1780912037814v=1.0.0.js";import{d as l,s as a,a as i,b as s,h as t,k as f,t as u,c as n,f as d,e as m,w as r,j as p,l as o,ac as _,_ as c}from"./index-d052b22f-1780912037814v=1.0.0.js";import"./upload-f9f23203-1780912037814v=1.0.0.js";const v={class:"plan-container"},x={class:"else-plan mb20"},y={class:"flex mr10"},b={class:"title"},k={key:1,style:{"min-width":"25vw"},class:"flex1"},w={class:"flex flex-s ml20"},L={key:1,class:"flex flex-s ml10"},U=c(l({__name:"UploadFile",props:{value:{default:()=>null},inputName:{default:null},mode:{default:"edit"}},emits:["update:value"],setup(l,{emit:c}){const U=l,h=c,N=e=>{let l={file_url:e[0].url,file_name:e[0].name,realUrl:e[0].file_url};h("update:value",l)},j=a((()=>U.value.file_url&&U.value.file_name)),V=a({get:()=>D(U.value),set(e){h("update:value",e)}}),D=e=>{let l=e;return l.fileList=[],l.file_url&&l.file_name&&(l.fileList=[{url:l.file_name,name:l.file_name,file_path:l.file_url,file_type_id:l.file_type_id}]),l},F=()=>{V.value.file_url="",V.value.file_name=""};return(l,a)=>{const c=i("el-input"),U=i("el-button"),h=i("View"),D=i("el-icon"),g=i("el-link"),C=i("Delete");return s(),t("div",v,[f("div",x,[f("div",y,[f("span",b,u(l.inputName?l.inputName:"文件名称："),1),"view"!==l.mode?(s(),n(c,{key:0,modelValue:d(V).file_name,"onUpdate:modelValue":a[0]||(a[0]=e=>d(V).file_name=e),rows:1,class:"flex1",type:"textarea",placeholder:l.inputName?`请输入${l.inputName.slice(0,-1)}`:"请输入方案名称"},null,8,["modelValue","placeholder"])):(s(),t("div",k,u(d(V).file_name||"-"),1))]),f("div",w,[a[5]||(a[5]=f("span",{calss:"title"},"文件附件：",-1)),m(e,{fileList:d(V).fileList,"onUpdate:fileList":a[1]||(a[1]=e=>d(V).fileList=e),onUploadFile:N,limit:1,disabled:"view"===l.mode,showFileList:!1},{default:r((()=>[m(U,null,{default:r((()=>a[3]||(a[3]=[p("点击上传")]))),_:1})])),_:1},8,["fileList","disabled"]),o(" {{ elsePlan }} "),d(V).realUrl?(s(),n(g,{key:0,style:{"margin-left":"10px"},type:"primary",onClick:a[2]||(a[2]=e=>d(_)(d(V).realUrl))},{default:r((()=>[a[4]||(a[4]=p(" 文件预览 ")),m(D,{class:"ml5"},{default:r((()=>[m(h)])),_:1})])),_:1})):o("v-if",!0),d(j)?(s(),t("div",L,[m(D,{onClick:F,class:"icon"},{default:r((()=>[m(C)])),_:1})])):o("v-if",!0)])])])}}}),[["__scopeId","data-v-f1a9b23e"]]);export{U as default};
