import C from"./BaseForm-a9a9e24f-1782572373740v=1.0.0.js";import{u as b,g as x}from"./scoreCertificateApi-e42b5e9e-1782572373740v=1.0.0.js";import{u as w}from"./useFormEdit-e67d5b61-1782572373740v=1.0.0.js";import F from"./CertificatePreview-99f9e868-1782572373740v=1.0.0.js";import{a as U,_ as h}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{E as u}from"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";import{y as p,r as i,m as B,al as E,z as L,A as S,R as n,J as f,u as l,k as c,M as D}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./keepAlive-0ac97bbd-1782572373740v=1.0.0.js";const R={class:"outerContainer"},M=p({name:"scoreAdd"}),N=p({...M,setup(O){const{closeCurrent:v}=w(),o=i({creatorOrganUnitType:"",content:[],gradeDetermBaseRuleType:"champion"}),a=i(!1),_=()=>{v()},g=i(""),m=U(),y=async r=>{a.value=!0;try{let e=b,s="\u4FDD\u5B58\u6210\u529F",t=await e(r);t.code==0?u({type:"success",message:`${s}!`}):u.warning(t.msg),a.value=!1}catch{a.value=!1}},d=async(r="champion")=>{a.value=!0;try{let e=await x(r);if(e.code==0){if(e.data){const s=[];Object.keys(e.data).forEach(t=>{t.startsWith("is")&&e.data[t]==1&&s.push(t)}),e.data.content=s,e.data.certificateCoverUrl=JSON.stringify([{url:e.data.certificateCoverUrl}])}o.value=e.data||{},o.value}else u.warning(e.msg);a.value=!1}catch{a.value=!1}};return B(async()=>{g.value=m.query.id,await d()}),(r,e)=>{const s=E("HZPageLayout");return L(),S("div",R,[n(s,{title:l(m).meta.title,style:{flex:"4"}},{default:f(()=>[n(C,{value:l(o),"onUpdate:value":e[0]||(e[0]=t=>c(o)?o.value=t:null),loading:l(a),"onUpdate:loading":e[1]||(e[1]=t=>c(a)?a.value=t:null),onTabChange:d,onCancel:_,onSubmit:y},null,8,["value","loading"])]),_:1},8,["title"]),n(s,{title:"\u6548\u679C\u9884\u89C8",style:{flex:"2"}},{default:f(()=>[D(" {{ baseForm }} "),n(F,{value:l(o),"onUpdate:value":e[2]||(e[2]=t=>c(o)?o.value=t:null)},null,8,["value"])]),_:1})])}}});const Z=h(N,[["__scopeId","data-v-3dc0995c"]]);export{Z as default};
