|
1 |
- import{d as X,B as c,C as N,r as I,o as Z,D as J,c as s,e as p,G as _,i as t,h as e,f as g,H as V,u as v,F as x,k as q,g as D,j as Q}from"./index.0018c8ef.js";import{a as S,f as ee}from"./uploadAction.60337e0f.js";import{z as le}from"./expertStore.63f217cf.js";const ae=["onClick"],oe={class:"addGhostBtn mt-8 w-full"},te=["src"],re={key:1,class:"el-icon-plus avatar-uploader-icon"},ne=X({name:"basicInfo"}),me=Object.assign(ne,{setup(ue,{expose:F}){const $=c.dictStore.uploadUrl,B=N(c.userStore).userInfo,{nationList:T}=c.dictStore.globalDicts,{tagList:de}=N(c.dictStore),o=I({expertIntentionWorkRegions:[{}],avatarFile:{fileId:""}}),w=I(),W=(r,l,d)=>{if(l==="")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(l))d();else return d(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7"))},E=(r,l,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(l)||u.test(l)?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(l=>{r(l)})},z=async r=>{var l,d,n,u,m,f;o.value={...r,political:((l=r.political)==null?void 0:l[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 S(r.avatarFile.fileId),avatarFile:(r==null?void 0:r.avatarFile)||{fileId:""}}},k=I(),C=(r,l)=>{r==="add"?o.value.expertIntentionWorkRegions.push({id:new Date().getTime()}):o.value.expertIntentionWorkRegions.splice(l,1)},P=r=>{o.value.avatarFile.fileId=r.data.id,S(r.data.id).then(l=>{o.value.avatarUrl=l})},Y=async()=>{const r=await le({phoneNo:o.value.phoneNo});o.value.isDingUser=r.data.isDingUser,r.data.isDingUser&&(o.value.name=r.data.name)};return F({validForm:j,formData:o,setFormData:z}),Z(async()=>{const r=await J({regionCode:330500,regionLevel:2});k.value=[r.data]}),(r,l)=>{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"),U=s("el-cascader"),M=s("Delete"),h=s("el-icon"),R=s("el-row"),G=s("el-button"),A=s("Camera"),H=s("el-upload"),K=s("el-form");return p(),_(K,{ref_key:"formRef",ref:w,model:o.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:o.value.phoneNo,"onUpdate:modelValue":l[0]||(l[0]=a=>o.value.phoneNo=a),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:o.value.name,"onUpdate:modelValue":l[1]||(l[1]=a=>o.value.name=a),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:o.value.gender,"onUpdate:modelValue":l[2]||(l[2]=a=>o.value.gender=a),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:o.value.hometown,"onUpdate:modelValue":l[3]||(l[3]=a=>o.value.hometown=a),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:o.value.nationality,"onUpdate:modelValue":l[4]||(l[4]=a=>o.value.nationality=a),class:"m-2 w-full",placeholder:"\u8BF7\u9009\u62E9"},{default:t(()=>[(p(!0),g(x,null,V(v(T),a=>(p(),_(m,{key:a.id,label:a.info,value:a.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:o.value.political,"onUpdate:modelValue":l[5]||(l[5]=a=>o.value.political=a),class:"w-full",placeholder:"\u8BF7\u9009\u62E9","value-key":"dictionaryCode"},{default:t(()=>[(p(!0),g(x,null,V(v(c).dictStore.politicalDict,(a,i)=>(p(),_(m,{key:i,label:a.dictionaryName,value:a},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:o.value.idCard,"onUpdate:modelValue":l[6]||(l[6]=a=>o.value.idCard=a),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:o.value.officePhone,"onUpdate:modelValue":l[7]||(l[7]=a=>o.value.officePhone=a),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:o.value.birth,"onUpdate:modelValue":l[8]||(l[8]=a=>o.value.birth=a),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:o.value.bankNo,"onUpdate:modelValue":l[9]||(l[9]=a=>o.value.bankNo=a),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:o.value.bank,"onUpdate:modelValue":l[10]||(l[10]=a=>o.value.bank=a),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:o.value.email,"onUpdate:modelValue":l[11]||(l[11]=a=>o.value.email=a),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 a,i,b;return[e(U,{modelValue:o.value.expertRegionInfo,"onUpdate:modelValue":l[13]||(l[13]=O=>o.value.expertRegionInfo=O),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&&v(B).regionCode!==((b=(a=o.value)==null?void 0:a.expertRegionInfo)==null?void 0:b[((i=o.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:o.value.expertSource,"onUpdate:modelValue":l[14]||(l[14]=a=>o.value.expertSource=a),class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:"","value-key":"tagCode"},{default:t(()=>[(p(!0),g(x,null,V(v(c).dictStore.expertSourceDict,(a,i)=>(p(),_(m,{key:i,label:a.tagName,value:a},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:o.value.expertType,"onUpdate:modelValue":l[15]||(l[15]=a=>o.value.expertType=a),class:"w-full",placeholder:"\u8BF7\u9009\u62E9","value-key":"dictionaryCode"},{default:t(()=>[(p(!0),g(x,null,V(v(c).dictStore.expertTypeDict,(a,i)=>(p(),_(m,{key:i,label:a.dictionaryName,value:a},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(o.value.expertIntentionWorkRegions,(a,i)=>(p(),_(R,{key:a.id,class:"intention-item w-full"},{default:t(()=>[e(u,{span:24},{default:t(()=>[e(U,{modelValue:o.value.expertIntentionWorkRegions[i].unionCode,"onUpdate:modelValue":b=>o.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=>C("del",i)},[e(h,null,{default:t(()=>[e(M,{color:"#D40000"})]),_:1})],8,ae)):q("",!0)]),_:2},1024)]),_:2},1024))),128)),D("p",oe,[e(G,{class:"w-full",type:"primary",plain:"",style:{margin:"0"},onClick:l[16]||(l[16]=a=>C("add"))},{default:t(()=>l[17]||(l[17]=[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:v($),"show-file-list":!1,"on-success":P,"before-upload":a=>v(ee)(a,{size:500,types:["png","jpg","jpeg"]}),accept:"image/png,image/jpeg"},{default:t(()=>[o.value.avatarUrl?(p(),g("img",{key:0,src:o.value.avatarUrl,class:"avatar"},null,8,te)):(p(),g("i",re,[e(h,null,{default:t(()=>[e(A)]),_:1})]))]),_:1},8,["action","before-upload"]),l[18]||(l[18]=D("div",{class:"limit-name ml-4"},"\u8BF7\u4E0A\u4F20\u84DD\u5E951\u5BF8\u514D\u51A0\u7167\u7247\uFF0C\u5C0F\u4E8E500Kb",-1))]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])}}});export{me as default};
|