import{A as R}from"./AddFormItemLine-e50f30dc-1782572373740v=1.0.0.js";import{y as S,r as T,c as v,al as i,z as s,I as g,J as n,R as f,O as L,u,A as V,Q as O,a4 as C,M as w,k as I}from"./vendor-866bb149-1782572373740v=1.0.0.js";const z=S({__name:"SignUpUnitDialog",props:{visible:{type:Boolean,default:!1},title:{default:""},loading:{type:Boolean,default:!1},questionList:{default:[]},rules:{default:{}},value:{default:{}},editType:{default:""},selectedUnitListOption:{default:()=>[]},selectedUnitListOptionKey:{default:"eventApplyUnitTypeName"},eventProjectType:{default:null}},emits:["update:visible","update:value","submit","update:loading"],setup(k,{emit:B}){const o=k,d=B,b=T(),a=v({get:()=>o.value,set:e=>{d("update:value",e)}}),F=v(()=>({[o.selectedUnitListOptionKey]:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5C5E\u5355\u4F4D",trigger:"change"}],...o.rules})),_=v({get:()=>o.visible,set:e=>{d("update:visible",e)}}),q=v({get:()=>o.loading,set:e=>{d("update:loading",e)}}),N=e=>{var c,r;o.selectedUnitListOption,o.questionList;const l=(c=o.selectedUnitListOption.find(p=>p.value===e))==null?void 0:c.collegeSimpleName,m=(r=o.questionList.find(p=>p.fieldName==="\u5355\u4F4D\u7B80\u79F0"))==null?void 0:r.fieldValue;m&&(a.value[m]=l)},y=()=>{d("update:visible",!1)},D=()=>{var e;(e=b.value)==null||e.validate(l=>{l&&d("submit",a.value)})};return(e,l)=>{const m=i("el-option"),c=i("el-select"),r=i("el-form-item"),p=i("el-form"),U=i("el-button"),E=i("el-dialog");return s(),g(E,{modelValue:u(_),"onUpdate:modelValue":l[1]||(l[1]=t=>I(_)?_.value=t:null),width:"800px",title:o.title,"before-close":y},{footer:n(()=>[f(U,{onClick:y},{default:n(()=>l[2]||(l[2]=[L("\u53D6\u6D88",-1)])),_:1,__:[2]}),f(U,{type:"primary",loading:u(q),onClick:D},{default:n(()=>l[3]||(l[3]=[L("\u786E\u5B9A",-1)])),_:1,__:[3]},8,["loading"])]),default:n(()=>[f(p,{model:u(a),ref_key:"formRef",ref:b,rules:u(F)},{default:n(()=>[e.selectedUnitListOption.length>0?(s(),g(r,{key:0,label:"\u6240\u5C5E\u5355\u4F4D",prop:e.selectedUnitListOptionKey},{default:n(()=>[f(c,{modelValue:u(a)[e.selectedUnitListOptionKey],"onUpdate:modelValue":l[0]||(l[0]=t=>u(a)[e.selectedUnitListOptionKey]=t),placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u5355\u4F4D",onChange:N,filterable:""},{default:n(()=>[(s(!0),V(O,null,C(e.selectedUnitListOption,t=>(s(),g(m,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["prop"])):w("v-if",!0),(s(!0),V(O,null,C(o.questionList,(t,K)=>(s(),g(r,{key:K,label:t.fieldName+":",prop:t.fieldValue,required:Boolean(t.isFill)},{default:n(()=>[f(R,{info:t,value:u(a)[t.fieldValue],"onUpdate:value":A=>u(a)[t.fieldValue]=A},null,8,["info","value","onUpdate:value"])]),_:2},1032,["label","prop","required"]))),128))]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])}}});export{z as _};
