|
1 |
- import{E as u,r as f,o as I,b as t,c as m,L as _,h as l,f as r,d as B,H as C,u as i,F as N,e as U,i as D,k as E,s as L}from"./index-dd5fae99.js";import{h as S,c as q,f as M}from"./uploadAction-3962500e.js";const R=E({name:"recommendInfo"}),T=Object.assign(R,{setup(h,{expose:g}){const v=u.dictStore.uploadUrl,{proxy:y}=L(),a=f({}),d=f(),F={recommendedWay:[{required:!0,message:"请选择推荐类型",trigger:"blur"}],recommendationProofFile:[{required:!0,message:"请上传推荐证明",trigger:"blur"}]},b=n=>{d.value.validate(e=>{n(e)})},x=(n,e)=>{y.$message.warning("仅限上传一个文件")};return g({validForm:b,formData:a,setFormData:n=>{var e;a.value={...n,recommendedWay:((e=n.recommendedWay)==null?void 0:e[0])||void 0,recommendationProofFile:n.recommendationProofFile&&n.recommendationProofFile.map(s=>({name:s.fileName,response:{data:{id:s.fileId}},fileUrlById:s.url}))}}}),I(async()=>{}),(n,e)=>{const s=t("el-option"),w=t("el-select"),c=t("el-form-item"),p=t("el-col"),P=t("el-button"),k=t("el-upload"),V=t("el-row"),W=t("el-form");return m(),_(W,{ref_key:"formRef",ref:d,model:a.value,rules:F,"label-position":"right","label-width":"120px","label-suffix":":","scroll-to-error":"",class:"recommendInfo"},{default:l(()=>[r(V,{gutter:8},{default:l(()=>[r(p,{span:8},{default:l(()=>[r(c,{label:"推荐类型",prop:"recommendedWay"},{default:l(()=>[r(w,{modelValue:a.value.recommendedWay,"onUpdate:modelValue":e[0]||(e[0]=o=>a.value.recommendedWay=o),class:"w-full",placeholder:"请选择","value-key":"dictionaryCode"},{default:l(()=>[(m(!0),B(N,null,C(i(u).dictStore.recommendedWayDict,(o,j)=>(m(),_(s,{key:j,label:o.dictionaryName,value:o},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),r(p,{span:24},{default:l(()=>[r(c,{label:"推荐证明",prop:"recommendationProofFile"},{default:l(()=>[r(k,{"file-list":a.value.recommendationProofFile,"onUpdate:fileList":e[1]||(e[1]=o=>a.value.recommendationProofFile=o),class:"w-full",action:i(v),limit:1,"on-exceed":x,"on-success":o=>i(S)(o,a.value.recommendationProofFile),"on-preview":i(q),accept:"application/pdf,image/png,image/jpeg,image/jpg","before-upload":o=>i(M)(o,{types:["png","jpg","jpeg","pdf"],size:1024})},{tip:l(()=>e[3]||(e[3]=[U("div",{class:"el-upload__tip"}," 支持扩展名:.pdf .png .jpg .pdf ,文件大小不超过1M ",-1)])),default:l(()=>[r(P,{type:"primary",plain:""},{default:l(()=>e[2]||(e[2]=[D("选择文件")])),_:1})]),_:1},8,["file-list","action","on-success","on-preview","before-upload"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])}}});export{T as default};
|