import D from"./BaseForm-7a053dce-1782572373740v=1.0.0.js";import{u as R,g as _,a as L}from"./scoreReleaseApi-a2bdf2d9-1782572373740v=1.0.0.js";import{u as S}from"./useFormEdit-e67d5b61-1782572373740v=1.0.0.js";import{a as b}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{E as s}from"./eleVendor-48a7d3b8-1782572373740v=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-866bb149-1782572373740v=1.0.0.js";import"./scoreCertificateApi-e42b5e9e-1782572373740v=1.0.0.js";import"./eleValidate-aae13e4d-1782572373740v=1.0.0.js";import"./index.vue_vue_type_script_setup_true_lang-aea23a9b-1782572373740v=1.0.0.js";import"./keepAlive-0ac97bbd-1782572373740v=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};
