import{b as G,_ as K}from"./index-b309bf9f-1782729249161v=1.0.0.js";import{y as Q,c as V,r as i,m as $,al as r,z as c,A as B,R as a,J as n,Q as v,a4 as k,u,I as h,a8 as b,a9 as F,B as y,M as T,O as H}from"./vendor-1e24e3ad-1782729249161v=1.0.0.js";import"./eleVendor-5008d1ec-1782729249161v=1.0.0.js";const W={eventLevel:[{required:!0,message:"\u8BF7\u9009\u62E9\u8D5B\u4E8B\u5C42\u7EA7",trigger:"change"}],eventTypeId:[{required:!0,message:"\u8BF7\u9009\u62E9\u8D5B\u4E8B\u7C7B\u578B",trigger:"change"}],gradeType:[{required:!0,message:"\u8BF7\u9009\u62E9\u8D5B\u4E8B\u7C7B\u578B",trigger:"change"}],gradeRecordIdentity:[{required:!0,message:"\u8BF7\u9009\u62E9\u4EE3\u8868\u8EAB\u4EFD",trigger:"change"}],teamMemberType:[{required:!0,message:"\u8BF7\u9009\u62E9\u961F\u5458\u8981\u6C42",trigger:"change"}],campus:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5728\u6821\u533A",trigger:"change"}],gradeDemandType:[{required:!0,message:"\u8BF7\u9009\u62E9\u6210\u7EE9\u8981\u6C42",trigger:"change"}],grade:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u6B21",trigger:"blur"},{type:"number",min:1,message:"\u540D\u6B21\u5FC5\u987B\u4E3A\u5927\u4E8E0\u7684\u6574\u6570",trigger:"blur"}]},X={class:"flexBox"},Y={class:"referee"},Z={class:"pt20 mt30"},ee=Q({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit","tabChange"],setup(U,{emit:A}){const R=G();let C=U;const p=A,t=V({get(){return w(C.value)},set(l){p("update:value",l)}}),N=V({get(){return C.loading},set(l){p("update:loading",l)}}),E=i(),_=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}),i("champion");const q=i(R.getEnumListByKey("gradeDetermBaseRuleType")),L=async()=>{p("tabChange",t.value.gradeDetermBaseRuleType)},D=[{label:"\u8BC1\u4E66\u7F16\u53F7",value:"isNumber",example:""},{label:"\u5B66\u751F\u5934\u50CF",value:"isAvatar",example:""},{label:"\u7BA1\u7406\u529E\u6CD5",value:"isManagement",example:"",exampleKey:"management"},{label:"\u8FD0\u52A8\u5458\u59D3\u540D",value:"isName",example:""},{label:"\u5B66\u53F7",value:"isTsNo",example:""},{label:"\u9879\u76EE",value:"isProject",example:""},{label:"\u83B7\u5F97\u7B49\u7EA7",value:"isGradeDeterm",example:""}],w=l=>l,M=()=>{var e;let l=JSON.parse(JSON.stringify(t.value)||"{}");return D.forEach(m=>{var s;(s=l.content)!=null&&s.includes(m.value)?l[m.value]=1:l[m.value]=0}),l.certificateCoverUrl=(e=JSON.parse(l.certificateCoverUrl||"[]")[0])==null?void 0:e.url,l},O=l=>{l.validate(async(e,m)=>{if(e){let s=M();p("submit",s)}else{const s=Object.keys(m)[0];l.scrollToField(s)}})};return $(()=>{}),(l,e)=>{const m=r("el-tab-pane"),s=r("el-tabs"),P=r("DocumentMul"),g=r("el-form-item"),f=r("PaCol"),S=r("el-checkbox"),I=r("el-checkbox-group"),x=r("el-input"),j=r("PaRow"),J=r("el-button"),z=r("el-form");return c(),B(v,null,[a(s,{modelValue:u(t).gradeDetermBaseRuleType,"onUpdate:modelValue":e[0]||(e[0]=o=>u(t).gradeDetermBaseRuleType=o),onTabChange:L},{default:n(()=>[(c(!0),B(v,null,k(u(q),o=>(c(),h(m,{key:o.value,label:o.label,name:o.value},null,8,["label","name"]))),128))]),_:1},8,["modelValue"]),a(z,{model:u(t),ref_key:"formRef",ref:E,rules:u(W)},{default:n(()=>[a(j,null,{default:n(()=>[a(f,b(F(u(_))),{default:n(()=>[a(g,{label:"\u8BC1\u4E66\u5C01\u9762",prop:"certificateCoverUrl"},{default:n(()=>[a(P,{fileList:u(t).certificateCoverUrl,"onUpdate:fileList":e[1]||(e[1]=o=>u(t).certificateCoverUrl=o),showFileList:!0,fileSize:5,limit:1,drag:!1,mutiple:!1,uploadType:"img",accept:".png,.jpg"},null,8,["fileList"])]),_:1})]),_:1},16),a(f,b(F(u(_))),{default:n(()=>[a(g,{label:"\u8BC1\u4E66\u5185\u5BB9\uFF1A",prop:"content"},{default:n(()=>{var o;return[y("div",X,[a(I,{modelValue:u(t).content,"onUpdate:modelValue":e[2]||(e[2]=d=>u(t).content=d),min:0},{default:n(()=>[(c(),B(v,null,k(D,d=>a(S,{key:d.value,label:d.label,value:d.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),y("div",Y,[(o=u(t).content)!=null&&o.includes("isManagement")?(c(),h(x,{key:0,modelValue:u(t).management,"onUpdate:modelValue":e[3]||(e[3]=d=>u(t).management=d),placeholder:"\u8BF7\u8F93\u5165\u7BA1\u7406\u529E\u6CD5\u540D\u79F0"},null,8,["modelValue"])):T("v-if",!0)])])]}),_:1})]),_:1},16),a(f,b(F(u(_))),{default:n(()=>[a(g,{label:"\u9881\u53D1\u5355\u4F4D\uFF1A",prop:"awardUnit"},{default:n(()=>[a(x,{modelValue:u(t).awardUnit,"onUpdate:modelValue":e[4]||(e[4]=o=>u(t).awardUnit=o),placeholder:"\u8BF7\u8F93\u5165\u9881\u53D1\u5355\u4F4D"},null,8,["modelValue"])]),_:1})]),_:1},16)]),_:1}),a(g,null,{default:n(()=>[y("div",Z,[T(' <el-button @click="handleBack">\u8FD4\u56DE</el-button> '),a(J,{type:"primary",loading:u(N),onClick:e[5]||(e[5]=o=>O(u(E)))},{default:n(()=>e[6]||(e[6]=[H("\u4FDD\u5B58",-1)])),_:1,__:[6]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])],64)}}});const te=K(ee,[["__scopeId","data-v-75c685dd"]]);export{te as default};
