Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

2 lignes
11KB

  1. import{d as O,D as c,G as N,r as I,o as X,H as Z,c as s,e as p,I as v,i as t,h as e,f as g,J as V,u as _,F as x,k as q,g as S,j as Q}from"./index.d340e473.js";import{a as D,f as ee}from"./uploadAction.95992a5e.js";import{z as le}from"./expertStore.5c886727.js";const ae=["onClick"],oe={class:"addGhostBtn mt-8 w-full"},te=["src"],re={key:1,class:"el-icon-plus avatar-uploader-icon"},ne=S("div",{class:"limit-name ml-4"},"\u8BF7\u4E0A\u4F20\u84DD\u5E951\u5BF8\u514D\u51A0\u7167\u7247\uFF0C\u5C0F\u4E8E500Kb",-1),ue=O({name:"basicInfo"}),fe=Object.assign(ue,{setup(de,{expose:F}){const $=c.dictStore.uploadUrl,B=N(c.userStore).userInfo,{nationList:T}=c.dictStore.globalDicts,{tagList:ie}=N(c.dictStore),a=I({expertIntentionWorkRegions:[{}],avatarFile:{fileId:""}}),w=I(),W=(r,o,d)=>{if(o==="")return d(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7"));if(/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(o))d();else return d(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7"))},E=(r,o,d)=>{const n=/^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,u=/^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;n.test(o)||u.test(o)?d():d("\u8BF7\u8F93\u5165\u6B63\u786E\u683C\u5F0F")},L={phoneNo:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",trigger:"blur"},{validator:W,trigger:"blur"}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u59D3\u540D",trigger:"blur"}],gender:[{required:!0,message:"\u8BF7\u9009\u62E9\u6027\u522B",trigger:"blur"}],hometown:[{required:!0,message:"\u8BF7\u9009\u62E9\u7C4D\u8D2F",trigger:"blur"}],nationality:[{required:!0,message:"\u8BF7\u9009\u62E9\u6C11\u65CF",trigger:"blur"}],political:[{required:!0,message:"\u8BF7\u9009\u62E9\u653F\u6CBB\u9762\u8C8C",trigger:"blur"}],idCard:[{required:!0,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8EAB\u4EFD\u8BC1\u53F7",trigger:"blur"},{validator:E,tigger:"blur"}],birth:[{required:!0,message:"\u8BF7\u9009\u62E9\u51FA\u751F\u5E74\u6708",trigger:"blur"}],bankNo:[{required:!0,message:"\u8BF7\u8F93\u5165\u94F6\u884C\u5361\u53F7",trigger:"blur"}],bank:[{required:!1,message:"\u8BF7\u8F93\u5165\u5F00\u6237\u884C",trigger:"blur"}],email:[{required:!1,message:"\u8BF7\u8F93\u5165\u7535\u5B50\u90AE\u7BB1",trigger:"blur"},{pattern:/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u90AE\u7BB1",trigger:"blur"}],expertSource:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E13\u5BB6\u6765\u6E90"}],expertRegionInfo:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E13\u5BB6\u7EA7\u522B"}],expertIntentionWorkRegions:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5C65\u804C\u610F\u5411"}],expertType:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E13\u5BB6\u7C7B\u578B",trigger:"blur"}],avatarUrl:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u514D\u51A0\u7167"}]},j=r=>{w.value.validate(o=>{r(o)})},z=async r=>{var o,d,n,u,m,f;a.value={...r,political:((o=r.political)==null?void 0:o[0])||void 0,expertSource:((d=r.expertSource)==null?void 0:d[0])||void 0,expertType:((n=r.expertType)==null?void 0:n[0])||void 0,expertRegionInfo:(u=r.expertRegionInfo.regionName)==null?void 0:u.split("@@").slice(1),expertIntentionWorkRegions:(m=r.expertIntentionWorkRegions)==null?void 0:m.map(y=>({unionCode:y.regionName.split("@@").slice(1)})),avatarUrl:((f=r==null?void 0:r.avatarFile)==null?void 0:f.fileId)&&await D(r.avatarFile.fileId),avatarFile:(r==null?void 0:r.avatarFile)||{fileId:""}}},k=I(),h=(r,o)=>{r==="add"?a.value.expertIntentionWorkRegions.push({id:new Date().getTime()}):a.value.expertIntentionWorkRegions.splice(o,1)},P=r=>{a.value.avatarFile.fileId=r.data.id,D(r.data.id).then(o=>{a.value.avatarUrl=o})},Y=async()=>{const r=await le({phoneNo:a.value.phoneNo});a.value.isDingUser=r.data.isDingUser,r.data.isDingUser&&(a.value.name=r.data.name)};return F({validForm:j,formData:a,setFormData:z}),X(async()=>{const r=await Z({regionCode:330500,regionLevel:2});k.value=[r.data]}),(r,o)=>{const d=s("el-input"),n=s("el-form-item"),u=s("el-col"),m=s("el-option"),f=s("el-select"),y=s("el-date-picker"),C=s("el-cascader"),M=s("Delete"),U=s("el-icon"),R=s("el-row"),G=s("el-button"),A=s("Camera"),H=s("el-upload"),J=s("el-form");return p(),v(J,{ref_key:"formRef",ref:w,model:a.value,rules:L,"label-position":"right","label-width":"120px","label-suffix":":","scroll-to-error":"",class:"basicInfo"},{default:t(()=>[e(R,{gutter:8},{default:t(()=>[e(u,{span:8},{default:t(()=>[e(n,{label:"\u624B\u673A\u53F7",prop:"phoneNo"},{default:t(()=>[e(d,{modelValue:a.value.phoneNo,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value.phoneNo=l),placeholder:"\u8BF7\u8F93\u5165",maxlength:11,disabled:!!r.$route.query.id||r.$route.name==="selfEditExpertInfo",onBlur:Y},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u59D3\u540D",prop:"name"},{default:t(()=>[e(d,{modelValue:a.value.name,"onUpdate:modelValue":o[1]||(o[1]=l=>a.value.name=l),placeholder:"\u8BF7\u8F93\u5165",disabled:!!r.$route.query.id||r.$route.name==="selfEditExpertInfo"},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u6027\u522B",prop:"gender"},{default:t(()=>[e(f,{modelValue:a.value.gender,"onUpdate:modelValue":o[2]||(o[2]=l=>a.value.gender=l),class:"w-full",placeholder:"\u8BF7\u9009\u62E9"},{default:t(()=>[e(m,{value:"1",label:"\u7537"}),e(m,{value:"0",label:"\u5973"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u7C4D\u8D2F",prop:"hometown"},{default:t(()=>[e(d,{modelValue:a.value.hometown,"onUpdate:modelValue":o[3]||(o[3]=l=>a.value.hometown=l),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u6C11\u65CF",prop:"nationality"},{default:t(()=>[e(f,{modelValue:a.value.nationality,"onUpdate:modelValue":o[4]||(o[4]=l=>a.value.nationality=l),class:"m-2 w-full",placeholder:"\u8BF7\u9009\u62E9"},{default:t(()=>[(p(!0),g(x,null,V(_(T),l=>(p(),v(m,{key:l.id,label:l.info,value:l.info},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u653F\u6CBB\u9762\u8C8C",prop:"political"},{default:t(()=>[e(f,{modelValue:a.value.political,"onUpdate:modelValue":o[5]||(o[5]=l=>a.value.political=l),class:"w-full",placeholder:"\u8BF7\u9009\u62E9","value-key":"dictionaryCode"},{default:t(()=>[(p(!0),g(x,null,V(_(c).dictStore.politicalDict,(l,i)=>(p(),v(m,{key:i,label:l.dictionaryName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u8EAB\u4EFD\u8BC1",prop:"idCard"},{default:t(()=>[e(d,{modelValue:a.value.idCard,"onUpdate:modelValue":o[6]||(o[6]=l=>a.value.idCard=l),placeholder:"\u8BF7\u8F93\u5165",maxlength:18},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u529E\u516C\u7535\u8BDD",prop:"officePhone"},{default:t(()=>[e(d,{modelValue:a.value.officePhone,"onUpdate:modelValue":o[7]||(o[7]=l=>a.value.officePhone=l),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u51FA\u751F\u5E74\u6708",prop:"birth"},{default:t(()=>[e(y,{modelValue:a.value.birth,"onUpdate:modelValue":o[8]||(o[8]=l=>a.value.birth=l),type:"month",placeholder:"\u8BF7\u9009\u62E9",format:"YYYY-MM"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u94F6\u884C\u5361\u53F7",prop:"bankNo"},{default:t(()=>[e(d,{modelValue:a.value.bankNo,"onUpdate:modelValue":o[9]||(o[9]=l=>a.value.bankNo=l),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u5F00\u6237\u94F6\u884C",prop:"bank"},{default:t(()=>[e(d,{modelValue:a.value.bank,"onUpdate:modelValue":o[10]||(o[10]=l=>a.value.bank=l),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u7535\u5B50\u90AE\u7BB1",prop:"email"},{default:t(()=>[e(d,{modelValue:a.value.email,"onUpdate:modelValue":o[11]||(o[11]=l=>a.value.email=l),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),q("",!0),e(u,{span:8},{default:t(()=>[e(n,{label:"\u4E13\u5BB6\u7EA7\u522B",prop:"expertRegionInfo"},{default:t(()=>{var l,i,b;return[e(C,{modelValue:a.value.expertRegionInfo,"onUpdate:modelValue":o[13]||(o[13]=K=>a.value.expertRegionInfo=K),options:k.value,props:{value:"unionCode",label:"name"},clearable:"",placeholder:"\u8BF7\u9009\u62E9",class:"w-full",disabled:r.$route.name==="selfEditExpertInfo"||r.$route.query.id&&_(B).regionCode!==((b=(l=a.value)==null?void 0:l.expertRegionInfo)==null?void 0:b[((i=a.value.expertRegionInfo)==null?void 0:i.length)-1].split("##")[0])},null,8,["modelValue","options","disabled"])]}),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u4E13\u5BB6\u6765\u6E90"},{default:t(()=>[e(f,{modelValue:a.value.expertSource,"onUpdate:modelValue":o[14]||(o[14]=l=>a.value.expertSource=l),class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:"","value-key":"tagCode"},{default:t(()=>[(p(!0),g(x,null,V(_(c).dictStore.expertSourceDict,(l,i)=>(p(),v(m,{key:i,label:l.tagName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u4E13\u5BB6\u7C7B\u578B",prop:"expertType"},{default:t(()=>[e(f,{modelValue:a.value.expertType,"onUpdate:modelValue":o[15]||(o[15]=l=>a.value.expertType=l),class:"w-full",placeholder:"\u8BF7\u9009\u62E9","value-key":"dictionaryCode"},{default:t(()=>[(p(!0),g(x,null,V(_(c).dictStore.expertTypeDict,(l,i)=>(p(),v(m,{key:i,label:l.dictionaryName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(u,{span:8},{default:t(()=>[e(n,{label:"\u5C65\u804C\u610F\u5411",prop:"expertIntentionWorkRegions"},{default:t(()=>[(p(!0),g(x,null,V(a.value.expertIntentionWorkRegions,(l,i)=>(p(),v(R,{key:l.id,class:"intention-item w-full"},{default:t(()=>[e(u,{span:24},{default:t(()=>[e(C,{modelValue:a.value.expertIntentionWorkRegions[i].unionCode,"onUpdate:modelValue":b=>a.value.expertIntentionWorkRegions[i].unionCode=b,options:k.value,props:{value:"unionCode",label:"name"},clearable:"",style:{width:"100%"},class:"mb-4"},null,8,["modelValue","onUpdate:modelValue","options"]),i>0?(p(),g("span",{key:0,style:{position:"absolute",right:"-20px"},onClick:b=>h("del",i)},[e(U,null,{default:t(()=>[e(M,{color:"#D40000"})]),_:1})],8,ae)):q("",!0)]),_:2},1024)]),_:2},1024))),128)),S("p",oe,[e(G,{class:"w-full",type:"primary",plain:"",style:{margin:"0"},onClick:o[16]||(o[16]=l=>h("add"))},{default:t(()=>[Q(" + \u589E\u52A0\u5C65\u804C\u610F\u5411\u5730\u533A ")]),_:1})])]),_:1})]),_:1}),e(u,{span:24},{default:t(()=>[e(n,{class:"avatarForm",label:"\u4E00\u5BF8\u514D\u51A0\u7167",prop:"avatarUrl",style:{"margin-bottom":"32px"}},{default:t(()=>[e(H,{class:"avatar-uploader",action:_($),"show-file-list":!1,"on-success":P,"before-upload":l=>_(ee)(l,{size:500,types:["png","jpg","jpeg"]}),accept:"image/png,image/jpeg"},{default:t(()=>[a.value.avatarUrl?(p(),g("img",{key:0,src:a.value.avatarUrl,class:"avatar"},null,8,te)):(p(),g("i",re,[e(U,null,{default:t(()=>[e(A)]),_:1})]))]),_:1},8,["action","before-upload"]),ne]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])}}});export{fe as default};