import D from"./BaseForm-222e253c-1782729249161v=1.0.0.js";import{u as R,g as _,a as L}from"./scoreReleaseApi-72c5cd84-1782729249161v=1.0.0.js";import{u as S}from"./useFormEdit-fb8b8504-1782729249161v=1.0.0.js";import{a as b}from"./index-b309bf9f-1782729249161v=1.0.0.js";import{E as s}from"./eleVendor-5008d1ec-1782729249161v=1.0.0.js";import{y as m,r as n,m as C,al as w,z as G,I as A,J as B,R as P,u as i,k as c}from"./vendor-1e24e3ad-1782729249161v=1.0.0.js";import"./scoreCertificateApi-f6373181-1782729249161v=1.0.0.js";import"./eleValidate-2ce2196e-1782729249161v=1.0.0.js";import"./index.vue_vue_type_script_setup_true_lang-07f392b0-1782729249161v=1.0.0.js";import"./keepAlive-20a782c5-1782729249161v=1.0.0.js";const F=m({name:"scoreAdd"}),Z=m({...F,setup(M){const{closeCurrent:u}=S(),t=n({type:"",name:"",dictTypeSign:"",status:"",creatorOrganUnitType:"",gradeRecordList:[],eventGradeConf:"ts",certificateId:"",deleteIdList:[],eventApplyMode:""}),r=n(!1),p=()=>{u()};n("");const f=b(),g=async a=>{r.value=!0;try{let e=R,l="\u65B0\u589E\u6210\u529F",o=await e(a);o.code==0?(s({type:"success",message:`${l}!`}),u()):s.warning(o.msg),r.value=!1}catch{r.value=!1}},v=(a=[])=>{t.value.gradeRecordList=a},y=async a=>{let e=await _(a);if(e.code!=0){s.warning(e.msg);return}e.data.certificateId=e.data.certificateId?e.data.certificateId:"",e.data.eventGradePidDictId=e.data.eventGradePidDictId?e.data.eventGradePidDictId:"",e.data.gradeRecordList=await I(e.data.eventGradeId),t.value=e.data,(t.value.eventApplyMode==="double"||t.value.eventApplyMode==="person")&&(t.value.eventGradeConf="ts")},I=async a=>{try{const e=await L({eventGradeId:a,page:1,size:999});return e.code===0?e.data.listData:[]}catch{return s.error("\u83B7\u53D6\u8FD0\u52A8\u5458\u5931\u8D25"),[]}},d=n({});return C(()=>{d.value=JSON.parse(sessionStorage.getItem("scoreReleaseAdd")||"{}"),y(d.value.eventGradeId)}),(a,e)=>{const l=w("HZPageLayout");return G(),A(l,{isBack:!0,title:i(f).meta.title},{default:B(()=>[P(D,{value:i(t),"onUpdate:value":e[0]||(e[0]=o=>c(t)?t.value=o:null),loading:i(r),"onUpdate:loading":e[1]||(e[1]=o=>c(r)?r.value=o:null),onCancel:p,onSubmit:g,isDetail:Number(i(d).isDetail),onUpdatedetail:v},null,8,["value","loading","isDetail"])]),_:1},8,["title"])}}});export{Z as default};
