import{c as W}from"./eleValidate-aae13e4d-1782572373740v=1.0.0.js";import{b as X}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{u as ee}from"./useGetYear-5b3908a7-1782572373740v=1.0.0.js";import{g as te}from"./eventListApi-0bc79350-1782572373740v=1.0.0.js";import{f as ue}from"./eventProjectAndTypeApi-0c7a84fc-1782572373740v=1.0.0.js";import{E as x}from"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";import{y as le,c as D,r as c,m as oe,al as s,z as p,I as f,J as o,R as l,a8 as B,a9 as v,u as t,A as E,Q as I,a4 as C,M as j,F as ae,B as re,O as h}from"./vendor-866bb149-1782572373740v=1.0.0.js";const ne={type:[{required:!0,message:"\u8BF7\u8F93\u5165\u7C7B\u578B",trigger:"blur"}],schoolYearId:[{required:!0,message:"\u8BF7\u9009\u62E9\u5B66\u5E74",trigger:"change"}],eventId:[{required:!0,message:"\u8BF7\u9009\u62E9\u8D5B\u4E8B\u540D\u79F0",trigger:"change"}],eventProjectTypeIds:[{required:!0,message:"\u8BF7\u9009\u62E9\u9879\u76EE\u7C7B\u578B",trigger:"change"}],standard:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BA4\u5B9A\u6807\u51C6",trigger:"change"}],recordNum:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BA4\u5B9A\u6B21\u6570",trigger:"blur"},{pattern:W,trigger:"blur",message:"\u8BF7\u8F93\u5165\u6B63\u6574\u6570"}],remark:[]},se={class:"pt20 mt30"},fe=le({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(T,{emit:N}){const O=X();let V=T;const _=N,r=D({get(){return Y(V.value)},set(a){_("update:value",a)}}),S=D({get(){return V.loading},set(a){_("update:loading",a)}}),k=c(),i=c({xs:24,sm:22,md:20,lg:14,xl:13});c({xs:24,sm:24,md:12,lg:12,xl:12}),c({xs:24,sm:22,md:18,lg:16,xl:8});const{academicYearOptions:w}=ee(),L=c(O.getEnumListByKey("standard")),y=c({}),R=a=>{U(a)},q=async(a,e,m)=>{try{const n=await te({page:e.page,size:10,name:a,eventId:m});if(n.code==0)return y.value=n.data.listData.map(d=>({label:d.name,value:d.eventId})),[y.value,n.data.total];y.value=[],x.warning(n.msg)}catch{x.warning("\u83B7\u53D6\u8D5B\u4E8B\u5217\u8868\u5931\u8D25")}},b=c([]),U=async a=>{try{const e=await ue({page:1,size:100,eventId:a});e.code==0&&(b.value=e.data.listData.map(m=>({label:m.name,value:m.eventProjectTypeId})))}catch{}},Y=a=>a,z=()=>{var e;let a=JSON.parse(JSON.stringify(r.value));return a.eventProjectTypeIds=(e=a.eventProjectTypeIds)==null?void 0:e.join(","),a},J=a=>{a.validate(async(e,m)=>{if(e){let n=z();_("submit",n)}else{const n=Object.keys(m)[0];a.scrollToField(n)}})},M=()=>{_("cancel")};return oe(()=>{}),(a,e)=>{const m=s("el-option"),n=s("el-select"),d=s("el-form-item"),g=s("PaCol"),H=s("PageSelect"),Z=s("el-checkbox"),G=s("el-checkbox-group"),A=s("el-input"),K=s("PaRow"),Q=s("HZStepItem"),P=s("el-button"),$=s("el-form");return p(),f($,{model:t(r),ref_key:"formRef",ref:k,rules:t(ne)},{default:o(()=>[l(Q,{title:"\u57FA\u7840\u4FE1\u606F"},{default:o(()=>[l(K,null,{default:o(()=>{var F;return[l(g,B(v(t(i))),{default:o(()=>[l(d,{label:"\u5B66\u5E74",prop:"schoolYearId"},{default:o(()=>[l(n,{modelValue:t(r).schoolYearId,"onUpdate:modelValue":e[0]||(e[0]=u=>t(r).schoolYearId=u),placeholder:"\u8BF7\u9009\u62E9\u5B66\u5E74"},{default:o(()=>[(p(!0),E(I,null,C(t(w),u=>(p(),f(m,{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16),l(g,B(v(t(i))),{default:o(()=>[l(d,{label:"\u8D5B\u4E8B\u540D\u79F0",prop:"eventId"},{default:o(()=>[l(H,{ref:"pageSelectRef",onChange:R,value:t(r).eventId,"onUpdate:value":e[1]||(e[1]=u=>t(r).eventId=u),"remote-method":q},null,8,["value"]),j(` <el-select v-model="form.eventId" placeholder="\u8BF7\u9009\u62E9\u8D5B\u4E8B\u540D\u79F0">\r
							<el-option v-for="item in eventOptions" :key="item.value" :label="item.label" :value="item.value" />\r
						</el-select> `)]),_:1})]),_:1},16),t(r).eventId&&((F=t(b))==null?void 0:F.length)>0?(p(),f(g,B(ae({key:0},t(i))),{default:o(()=>[l(d,{label:"\u9879\u76EE\u7C7B\u578B ",prop:"eventProjectTypeIds"},{default:o(()=>[l(G,{modelValue:t(r).eventProjectTypeIds,"onUpdate:modelValue":e[2]||(e[2]=u=>t(r).eventProjectTypeIds=u)},{default:o(()=>[(p(!0),E(I,null,C(t(b),u=>(p(),f(Z,{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16)):j("v-if",!0),l(g,B(v(t(i))),{default:o(()=>[l(d,{label:"\u8BA4\u5B9A\u6807\u51C6",prop:"standard"},{default:o(()=>[l(n,{modelValue:t(r).standard,"onUpdate:modelValue":e[3]||(e[3]=u=>t(r).standard=u),placeholder:"\u8BF7\u9009\u62E9\u8BA4\u5B9A\u6807\u51C6"},{default:o(()=>[(p(!0),E(I,null,C(t(L),u=>(p(),f(m,{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16),l(g,B(v(t(i))),{default:o(()=>[l(d,{label:"\u8BA4\u5B9A\u6B21\u6570",prop:"recordNum"},{default:o(()=>[l(A,{modelValue:t(r).recordNum,"onUpdate:modelValue":e[4]||(e[4]=u=>t(r).recordNum=u),placeholder:"\u8BF7\u8F93\u5165\u8BA4\u5B9A\u6B21\u6570"},null,8,["modelValue"])]),_:1})]),_:1},16),l(g,B(v(t(i))),{default:o(()=>[l(d,{label:"\u8BA4\u5B9A\u8BF4\u660E",prop:"description"},{default:o(()=>[l(A,{modelValue:t(r).description,"onUpdate:modelValue":e[5]||(e[5]=u=>t(r).description=u),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u8BA4\u5B9A\u8BF4\u660E"},null,8,["modelValue"])]),_:1})]),_:1},16)]}),_:1})]),_:1}),l(d,null,{default:o(()=>[re("div",se,[l(P,{onClick:M},{default:o(()=>e[7]||(e[7]=[h("\u8FD4\u56DE",-1)])),_:1,__:[7]}),l(P,{type:"primary",loading:t(S),onClick:e[6]||(e[6]=F=>J(t(k)))},{default:o(()=>e[8]||(e[8]=[h("\u4FDD\u5B58",-1)])),_:1,__:[8]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});export{fe as _};
