import{b as R,m as O}from"./index-b309bf9f-1782729249161v=1.0.0.js";import{E as b}from"./eleVendor-5008d1ec-1782729249161v=1.0.0.js";import{y as M,c as C,r as i,m as z,al as s,z as T,I as $,J as r,R as o,a8 as g,a9 as f,u as l,M as h,B as J,O as D}from"./vendor-1e24e3ad-1782729249161v=1.0.0.js";const L={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u59D3\u540D",trigger:"blur"},{message:"\u59D3\u540D\u6700\u591A10\u4E2A\u5B57\u7B26",max:10}],idNumber:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u53F7\u7801",trigger:"blur"}],phone:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",trigger:"blur"}],jobNumber:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B66\u5DE5\u53F7",trigger:"blur"}],organization:[{required:!0,message:"\u8BF7\u8F93\u5165\u6240\u5728\u5355\u4F4D",trigger:"blur"}],specialty:[{required:!0,message:"\u8BF7\u8F93\u5165\u64C5\u957F\u9879\u76EE",trigger:"blur"}],goodProject:[{required:!0,message:"\u8BF7\u8F93\u5165\u64C5\u957F\u9879\u76EE",trigger:"change"}],introduction:[{message:"\u4E2A\u4EBA\u4ECB\u7ECD\u6700\u591A200\u4E2A\u5B57\u7B26",max:200}],tsId:[{required:!0,message:"\u8BF7\u9009\u62E9\u7528\u6237",trigger:"change"}]},U={class:"pt20 mt30"},K=M({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(y,{emit:v}){R();let F=y;const c=v,a=C({get(){return I(F.value)},set(u){c("update:value",u)}}),A=C({get(){return F.loading},set(u){c("update:loading",u)}}),_=i(),p=i({xs:24,sm:22,md:20,lg:14,xl:13});i({xs:24,sm:24,md:12,lg:12,xl:12}),i({xs:24,sm:22,md:18,lg:16,xl:8});const B=i([]),x=async(u,e,m)=>{e.loading=!0;try{const t=await O({page:e.page,size:10,keyword:u,tsId:m});if(t.code===0)return B.value=t.data.listData.map(n=>({label:`${n.tsNo}-${n.name}-${n.collegeName}`,value:n.tsId})),[B.value,t.data.total];b.warning(t.msg)}catch{b.error("\u83B7\u53D6\u5B66\u5DE5\u53F7\u5931\u8D25")}finally{e.loading=!1}},I=u=>u,P=()=>{var e;let u=JSON.parse(JSON.stringify(a.value));return u.goodProject=((e=u.goodProject)==null?void 0:e.join(","))||"",u},j=u=>{u.validate(async(e,m)=>{if(e){let t=P();c("submit",t)}else{const t=Object.keys(m)[0];u.scrollToField(t)}})},V=()=>{c("cancel")};return z(()=>{}),(u,e)=>{const m=s("PageSelect"),t=s("el-form-item"),n=s("PaCol"),N=s("DictSelect"),S=s("el-input"),q=s("PaRow"),k=s("HZStepItem"),E=s("el-button"),w=s("el-form");return T(),$(w,{model:l(a),ref_key:"formRef",ref:_,rules:l(L)},{default:r(()=>[o(k,{title:"\u57FA\u7840\u4FE1\u606F"},{default:r(()=>[o(q,null,{default:r(()=>[o(n,g(f(l(p))),{default:r(()=>[o(t,{label:"\u7528\u6237",prop:"tsId"},{default:r(()=>[h(' 				:disabled="tsIdDisable" '),o(m,{ref:"pageSelectRef",value:l(a).tsId,"onUpdate:value":e[0]||(e[0]=d=>l(a).tsId=d),"remote-method":x,disabled:l(a).personId,placeholder:"\u8BF7\u8F93\u5165\u5B66\u5DE5\u53F7/\u624B\u673A\u53F7/\u59D3\u540D\u641C\u7D22"},null,8,["value","disabled"])]),_:1})]),_:1},16),o(n,g(f(l(p))),{default:r(()=>[o(t,{label:"\u64C5\u957F\u9879\u76EE",prop:"goodProject"},{default:r(()=>[o(N,{dictType:"sprot_project",modelValue:l(a).goodProject,"onUpdate:modelValue":e[1]||(e[1]=d=>l(a).goodProject=d),placeholder:"\u8BF7\u9009\u62E9\u64C5\u957F\u9879\u76EE",isAll:!1,style:{width:"100%"},multiple:""},null,8,["modelValue"])]),_:1})]),_:1},16),o(n,g(f(l(p))),{default:r(()=>[o(t,{label:"\u4E2A\u4EBA\u4ECB\u7ECD",prop:"introduction"},{default:r(()=>[o(S,{modelValue:l(a).introduction,"onUpdate:modelValue":e[2]||(e[2]=d=>l(a).introduction=d),type:"textarea",rows:3,placeholder:"\u8BF7\u8F93\u5165\u4E2A\u4EBA\u4ECB\u7ECD"},null,8,["modelValue"])]),_:1})]),_:1},16)]),_:1})]),_:1}),o(t,null,{default:r(()=>[J("div",U,[o(E,{onClick:V},{default:r(()=>e[4]||(e[4]=[D("\u8FD4\u56DE",-1)])),_:1,__:[4]}),o(E,{type:"primary",loading:l(A),onClick:e[3]||(e[3]=d=>j(l(_)))},{default:r(()=>e[5]||(e[5]=[D("\u4FDD\u5B58",-1)])),_:1,__:[5]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});export{K as _};
