You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.7KB

  1. import{E as c,r as m,o as z,V as R,b as d,c as s,L as g,h as a,f as t,d as w,H as x,u,F as k,e as U,i as j,k as H,s as O}from"./index-dd5fae99.js";import{h as D,c as I,f as Y}from"./uploadAction-3962500e.js";const P=H({name:"eduInfo"}),K=Object.assign(P,{setup($,{expose:M}){const _=c.dictStore.uploadUrl,{proxy:N}=O(),o=m({}),v=m(),B={edu:[{required:!0,message:"请选择学历",trigger:"blur"}],degree:[{required:!0,message:"请选择学位",trigger:"blur"}]},L=r=>{v.value.validate(e=>{r(e)})},b=(r,e)=>{N.$message.warning("仅限上传一个文件")},T=async r=>{var e,p;o.value={...r,edu:((e=r.edu)==null?void 0:e[0])||void 0,degree:((p=r.degree)==null?void 0:p[0])||void 0,degreeCertificateFile:r.degreeCertificateFile&&r.degreeCertificateFile.map(i=>({name:i.fileName,response:{data:{id:i.fileId}},fileUrlById:i.url})),graduationCertificateFile:r.graduationCertificateFile&&r.graduationCertificateFile.map(i=>({name:i.fileName,response:{data:{id:i.fileId}},fileUrlById:i.url}))}},S=m();return M({validForm:L,formData:o,setFormData:T}),z(async()=>{const r=await R({regionCode:330500,regionLevel:2});S.value=[r.data]}),(r,e)=>{const p=d("el-input"),i=d("el-form-item"),n=d("el-col"),A=d("el-date-picker"),y=d("el-option"),F=d("el-select"),C=d("el-button"),V=d("el-upload"),E=d("el-row"),q=d("el-form");return s(),g(q,{ref_key:"formRef",ref:v,model:o.value,rules:B,"label-position":"right","label-width":"100px","label-suffix":":","scroll-to-error":"",class:"eduInfo"},{default:a(()=>[t(E,{gutter:8},{default:a(()=>[t(n,{span:8},{default:a(()=>[t(i,{label:"毕业学校",prop:"school"},{default:a(()=>[t(p,{modelValue:o.value.school,"onUpdate:modelValue":e[0]||(e[0]=l=>o.value.school=l),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),t(n,{span:8},{default:a(()=>[t(i,{label:"毕业时间",prop:"graduatedAt"},{default:a(()=>[t(A,{modelValue:o.value.graduatedAt,"onUpdate:modelValue":e[1]||(e[1]=l=>o.value.graduatedAt=l),type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",placeholder:"请选择"},null,8,["modelValue"])]),_:1})]),_:1}),t(n,{span:8},{default:a(()=>[t(i,{label:"所学专业",prop:"academicTitle"},{default:a(()=>[t(p,{modelValue:o.value.academicTitle,"onUpdate:modelValue":e[2]||(e[2]=l=>o.value.academicTitle=l),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),t(n,{span:8},{default:a(()=>[t(i,{label:"学历",prop:"edu"},{default:a(()=>[t(F,{modelValue:o.value.edu,"onUpdate:modelValue":e[3]||(e[3]=l=>o.value.edu=l),placeholder:"请选择学历","value-key":"dictionaryCode",clearable:"",class:"w-full"},{default:a(()=>[(s(!0),w(k,null,x(u(c).dictStore.eduDict,(l,f)=>(s(),g(y,{key:f,label:l.dictionaryName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),t(n,{span:8},{default:a(()=>[t(i,{label:"学位",prop:"degree"},{default:a(()=>[t(F,{modelValue:o.value.degree,"onUpdate:modelValue":e[4]||(e[4]=l=>o.value.degree=l),placeholder:"请选择学位","value-key":"dictionaryCode",class:"w-full"},{default:a(()=>[(s(!0),w(k,null,x(u(c).dictStore.degreeDict,(l,f)=>(s(),g(y,{key:f,label:l.dictionaryName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),t(n,{span:24},{default:a(()=>[t(i,{label:"毕业证书",prop:"graduationCertificateFile"},{default:a(()=>[t(V,{"file-list":o.value.graduationCertificateFile,"onUpdate:fileList":e[5]||(e[5]=l=>o.value.graduationCertificateFile=l),class:"w-full",action:u(_),limit:1,"on-exceed":b,"on-success":l=>u(D)(l,o.value.graduationCertificateFile),"on-preview":u(I),accept:"application/pdf,image/png,image/jpeg","before-upload":l=>u(Y)(l,{size:1024,types:["png","jpg","jpeg","pdf"]})},{tip:a(()=>e[8]||(e[8]=[U("div",{class:"el-upload__tip"}," 支持扩展名:.pdf.png .jpg .pdf ,文件大小不超过1M ",-1)])),default:a(()=>[t(C,{type:"primary",plain:""},{default:a(()=>e[7]||(e[7]=[j("选择文件")])),_:1})]),_:1},8,["file-list","action","on-success","on-preview","before-upload"])]),_:1})]),_:1}),t(n,{span:24},{default:a(()=>[t(i,{label:"学位证书",prop:"degreeCertificateFile"},{default:a(()=>[t(V,{"file-list":o.value.degreeCertificateFile,"onUpdate:fileList":e[6]||(e[6]=l=>o.value.degreeCertificateFile=l),class:"w-full",action:u(_),"on-exceed":b,limit:1,"on-success":l=>u(D)(l,o.value.degreeCertificateFile),"before-upload":l=>u(Y)(l,{size:1024,types:["png","jpg","jpeg","pdf"]}),accept:"application/pdf,image/png,image/jpeg,image/jpg","on-preview":u(I)},{tip:a(()=>e[10]||(e[10]=[U("div",{class:"el-upload__tip"}," 支持扩展名:.pdf.png .jpg .pdf,文件大小不超过1M ",-1)])),default:a(()=>[t(C,{type:"primary",plain:""},{default:a(()=>e[9]||(e[9]=[j("选择文件")])),_:1})]),_:1},8,["file-list","action","on-success","before-upload","on-preview"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])}}});export{K as default};