var te=Object.defineProperty;var ae=(r,e,a)=>e in r?te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a;var x=(r,e,a)=>(ae(r,typeof e!="symbol"?e+"":e,a),a);import{W as ne}from"./index-1dbedb0f-1782729249161v=1.0.0.js";import{g as re,u as ue}from"./eventManualApi-fbaa4712-1782729249161v=1.0.0.js";import{h as le}from"./eventListApi-caa95bfe-1782729249161v=1.0.0.js";import{E as y,g as se}from"./eleVendor-5008d1ec-1782729249161v=1.0.0.js";import{s as S,r as G,y as Q,c as ie,h as oe,m as de,al as A,z as k,I as ce,J as E,M as T,u as g,A as I,B,R as F,Q as W,O as V,k as me}from"./vendor-1e24e3ad-1782729249161v=1.0.0.js";import{u as pe}from"./useEventManualExport-eb5039d1-1782729249161v=1.0.0.js";import{u as ve,a as fe,C as Z,_ as ge}from"./index-b309bf9f-1782729249161v=1.0.0.js";import{c as q,e as he}from"./scoreApi-3180feaf-1782729249161v=1.0.0.js";import{u as Fe}from"./useScoreBook-db29ce49-1782729249161v=1.0.0.js";import"./style-368a93d4-1782729249161v=1.0.0.js";import"./index-d7758263-1782729249161v=1.0.0.js";class Ee{constructor(e){x(this,"basicInformation","");x(this,"organizingCommittees",[]);x(this,"participatingTeams",[]);x(this,"eventStatistics",[]);x(this,"leaderParticipants",[]);x(this,"personalParticipants",[]);this.basicInformation=e.basicInformation,this.organizingCommittees=e.organizingCommittees,this.participatingTeams=e.participatingTeams,this.eventStatistics=e.eventStatistics,this.leaderParticipants=e.leaderParticipants,this.personalParticipants=e.personalParticipants}createHtmlContent(){let e="";return this.basicInformation,e+=this.basicInformation,e+=this.createOrganizingCommittees(),e+=this.createParticipatingTeams(),e+=this.createEventStatistics(),e+=this.createParticipants(),e}createBasicInformation(){}createOrganizingCommittees(){let e="";return e+=this._createModuleTitle("\u7EC4\u7EC7\u59D4\u5458\u4F1A"),this.organizingCommittees.forEach(a=>{e+=this._createParagraph(`${a.label}:${a.value}`)}),e}createParticipatingTeams(){let e="";return e+=this._createModuleTitle("\u53C2\u4E0E\u961F\u4F0D"),this.participatingTeams.forEach(a=>{e+=this._createTable(a),e+="<p></p>"}),e}createEventStatistics(){let e="";return e+=this._createModuleTitle("\u9879\u76EE\u7EDF\u8BA1"),this.eventStatistics.forEach(a=>{e+=this._createTable(a),e+="<p></p>"}),e}createParticipants(){let e="";return e+=this._createModuleTitle("\u53C2\u8D5B\u4EBA\u5458\u4FE1\u606F"),this.leaderParticipants.forEach(a=>{e+=`<p>\u7EC4\u522B\u5C0F\u9879\uFF1A${a.groupName}</p>`,a.unitDataList.forEach(u=>{e+=`<p>\u5355\u4F4D\u540D\u79F0\uFF1A${u.eventApplyUnitTypeName}</p>`,e+=`<p>\u9886\u961F\u59D3\u540D\uFF1A${u.leaderName}</p>`,e+=`<p>\u6559\u7EC3\u59D3\u540D\uFF1A${u.coachName}</p>`,e+=this._createTable(u,!1),e+="<p></p>"})}),this.personalParticipants.forEach(a=>{e+=`<p>${a.title}</p>`,e+=this._createTable(a,!1),e+="<p></p>"}),e}_createModuleTitle(e){return`<h3>${e}</h3>`}_createParagraph(e){return`<p style="text-indent: 2em;">${e}</p>`}_createTable(e,a=!0){let u="",s="",c="";return a?(e.headers.forEach(C=>{c+=this._createTableDataCell(C.fieldName,!1)}),u+=this._createTableMergeHeader(e.title,e.headers.length),s+=this._createTableDataRow(c)):(e.headers.forEach(C=>{c+=this._createTableNormalHeader(C.fieldName)}),u+=this._createTableDataRow(c)),e.datas.forEach(C=>{let m="";e.headers.forEach($=>{m+=this._createTableDataCell(C[$.fieldValue],$.fieldType=="img")}),s+=this._createTableDataRow(m)}),`<table border="1" cellpadding="8" cellspacing="0"
            style="width: 100%; border-collapse: collapse; font-size: 14px;">
            <thead>
            ${u}
            </thead>
            <tbody>
            ${s}
            </tbody>
        </table>`}_createTableMergeHeader(e,a){return`<tr>
            <th colspan="${a}"
                style="text-align: center; padding: 12px; font-size: 16px;">${e}</th>
            </tr>`}_createTableNormalHeader(e){return`<th style="border: 1px solid #ddd; padding: 8px;">${e||""}</th>`}_createTableDataCell(e,a=!1){let u=`<td style="width: 80px; text-align: center; border: 1px solid #ddd; padding: 8px;">
                <img src="${e||""}" alt="\u56FE\u7247"
                    style="width: 60px; height: 60px; border-radius: 4px;" />
                </td>`,s=`<td style="border: 1px solid #ddd; padding: 8px;">${e||""}</td>`;return a?u:s}_createTableDataRow(e){return`<tr>${e}</tr>`}}const Ce=r=>{const e=S({});S([]);const a=S({}),u=S({}),s=S({}),c=S([]),o=S([]),C=G(""),m={name:"\u59D3\u540D",gender:"\u6027\u522B",ts_no:"\u5B66\u5DE5\u53F7",identity_card:"\u8EAB\u4EFD\u8BC1\u53F7",unit_type:"\u6240\u5728\u5355\u4F4D",birth:"\u51FA\u751F\u65E5\u671F",avatar:"\u4E2A\u4EBA\u7167\u7247",unit_name:"\u5355\u4F4D\u540D\u79F0",unit_simple:"\u5355\u4F4D\u7B80\u79F0"},$=p=>{let l=[{label:"\u4E3B\u529E\u5355\u4F4D",value:p.main||""},{label:"\u627F\u529E\u5355\u4F4D",value:p.undertake||""},{label:"\u534F\u529E\u5355\u4F4D",value:p.assist||""},{label:"\u8D5E\u52A9\u5355\u4F4D",value:p.sponsor||""}];a.value=l},D=p=>{let l=[];p.forEach(v=>{let f={title:"",headers:[{fieldName:"\u5E8F\u53F7",fieldValue:"index"},{fieldName:"\u5355\u4F4D\u540D\u79F0",fieldValue:"eventApplyUnitTypeName"},{fieldName:"\u9886\u961F",fieldValue:"eventLeaderNames"},{fieldName:"\u6559\u7EC3",fieldValue:"eventCoachNames"},{fieldName:"\u8FD0\u52A8\u5458\u6570\u91CF",fieldValue:"totalNum"},{fieldName:"\u7537\u8FD0\u52A8\u5458\u6570",fieldValue:"manSportNum"},{fieldName:"\u5973\u8FD0\u52A8\u5458\u6570",fieldValue:"girlSportNum"}],datas:[]};f.title=`\u7EC4\u522B\u5C0F\u9879\uFF1A${v.eventApplyListDto.eventGroupName} ${v.eventApplyListDto.eventTermName}`;let i=v.leaderReportListPo.map((d,h)=>({index:h+1,...d}));f.datas=i,l.push(f)}),u.value=l},H=p=>{let l=[];p.forEach(v=>{let f={title:"",headers:[{fieldName:"\u5E8F\u53F7",fieldValue:"index"},{fieldName:"\u5355\u4F4D\u540D\u79F0",fieldValue:"eventApplyUnitTypeName"}],datas:[]};f.title=`\u7EC4\u522B\u5C0F\u9879\uFF1A${v.eventApplyListBase.eventGroupName} ${v.eventApplyListBase.eventTermName}`;let i=v.vertical2TransverseDTO.idNameMap,d=[];for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)){const _=i[t];d.push({fieldName:_,fieldValue:String(t)})}f.headers=[...f.headers,...d];let h=f.headers.reduce((t,_)=>(t[_.fieldValue]="",t),{}),P=v.vertical2TransverseDTO.list,n=[];P.forEach((t,_)=>{let b={index:null,...h};for(const O in b)b[O]=t[O];b.index=_+1,n.push(b)}),f.datas=n,l.push(f)}),s.value=l},z=p=>{o.value=J(p.leaderDetailInfoDTOList),c.value=U(p.personReportDTOList)},J=p=>{let l={leaderName:"",coachName:"",headers:[],eventApplyUnitTypeName:"",datas:[]},v={groupName:"",unitDataList:[]},f=[];return p.map(i=>{v.groupName=i.name;let d=JSON.parse(JSON.stringify(l));i.leaderDetailDTOList.forEach(h=>{d.leaderName=h.eventLeaderName,d.eventApplyUnitTypeName=h.eventApplyUnitTypeName,d.coachName=h.eventCoachName;let{headers:P,datas:n}=N(h.customFieldDataBizDTO);d.headers=P,d.datas=n}),v.unitDataList.push(d),f.push(v)}),f},U=p=>{let l=[],v={title:"",headers:[],datas:[]};return p.map(f=>{let i=JSON.parse(JSON.stringify(v));i.title=f.tableName;let{headers:d,datas:h}=N(f.customFieldDataDTO);i.headers=d,i.datas=h,l.push(i)}),l},N=p=>{let l=[{fieldName:"\u5E8F\u53F7",fieldValue:"index"}],v=[];p.customFieldConfList.map(i=>{l.push({fieldName:i.fieldName,fieldValue:i.fieldValue,fieldType:i.fieldType})});let f=l.reduce((i,d)=>(i[d.fieldValue]="",i),{});return p.customFieldEntityMap.map((i,d)=>{let h={index:null,...f};for(const P in h)h[P]=i[P];h.index=d+1,v.push(h)}),{headers:l,datas:v}};return{getEventProgramInfo:async(p="")=>{let l=await re(r);if(l.code!=0){y.warning(l.msg);return}e.value=l.data,e.value,$(l.data.eventPo||{}),D(l.data.leaderReportDTOList||[]),H(l.data.projectStatDTOList||[]),z(l.data||{});let v=new Ee({basicInformation:p,organizingCommittees:a.value,participatingTeams:u.value,eventStatistics:s.value,leaderParticipants:o.value,personalParticipants:c.value});return C.value=v.createHtmlContent(),C.value},htmlContent:C,fieldMaps:m}},De=Ce;function _e(r,e,a){if(!Array.isArray(r))return"";let u="";return r.forEach((s,c)=>{u+=ye(s,c,e,a)}),`${u}`}function ye(r,e,a,u){let s="";return s+=`<h2 class="groupName">${M(r.name||"")}</h2>`,Array.isArray(r.eventGradeRecordListRespVOS)&&r.eventGradeRecordListRespVOS.forEach(c=>{s+=be(c,e===0?a:u)}),s}function be(r,e){const a=r.eventGradeRecordListRespVOS||[],u=a.find(o=>o.gradeDemandType==="team");console.error({tableItem:r});let s=[...e];u&&(s=s.filter(o=>o.prop!=="tsNo"),s.forEach(o=>{o.label==="\u5355\u4F4D\u540D\u79F0"&&(o.prop="showName")}));let c="";return c+=`<h3 class="tableName">${M(r.name||"")}</h3>`,c+='<table border="1" cellspacing="0" cellpadding="5" style="border-collapse:collapse;width:100%;">',c+=Ae(s),c+=Be(a,s),c+="</table>",c}function Ae(r,e){return`<thead><tr>${r.map(u=>`<th>${M(u.label||"")}</th>`).join("")}</tr></thead>`}function Be(r,e){let a="";return r.forEach((u,s)=>{let c=e.map(o=>o.type==="index"?`<td style="text-align: center; padding: 12px; font-size: 16px;">${s+1}</td>`:`<td style="text-align: center; padding: 12px; font-size: 16px;">${M(u[o.prop]||"")}</td>`).join("");a+=`<tr>${c}</tr>`}),`<tbody>${a}</tbody>`}function M(r){return typeof r!="string"?r:r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const Pe={class:"generateText"},Te={key:1,class:"schedule-information-container"},Ne={class:"schedule-information-content"},xe={class:"data-entry-content-item"},Se=Q({name:"eventManualIndex"}),$e=Q({...Se,setup(r){ve();const e=fe(),a=ie(()=>sessionStorage.getItem("eventId"));De(a.value);const{handleExport:u,handleImport:s,importHtmlContent:c}=pe();oe(c,n=>{n&&(o.value=n)});const o=G(""),C={eventId:a.value,isEventProgram:0,eventGradeContent:"",eventProgramAttachment:"",eventProgramAttachmentPerson:[],eventProgramStatus:"init",eventRegulationContent:"",isEventGrade:0},m=G(Z(C)),$=()=>{},D=G(!1),H=n=>{let t=[];try{JSON.parse(n).forEach(b=>{t.push({name:b.name,url:b.url})})}catch{}return JSON.stringify(t)},z=async()=>{if(m.value.eventProgramAttachmentPerson.length==0){y.error("\u8BF7\u4E0A\u4F20\u9644\u4EF6");return}let n={eventId:a.value,isEventGrade:m.value.isEventGrade,eventProgramAttachmentPerson:H(m.value.eventProgramAttachmentPerson)},t=await ue(n);t.code==0?y.success("\u4FDD\u5B58\u6210\u529F"):y.error(t.msg),D.value=!1},J=async()=>{D.value=!0;let n={eventId:a.value,isEventGrade:m.value.isEventGrade,eventGradeContent:String(o.value).replace(/<br\s*\/?>/g,"")},t=await q(n);t.code==0?y.success("\u4FDD\u5B58\u6210\u529F"):y.error(t.msg),D.value=!1},U=()=>{se.confirm("\u91CD\u7F6E\u4F1A\u6E05\u7A7A\u5F53\u524D\u5BFC\u5165\u4FE1\u606F\uFF0C\u6062\u590D\u7CFB\u7EDF\u9ED8\u8BA4\u79E9\u5E8F\u518C\uFF0C\u786E\u5B9A\u7EE7\u7EED\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{let n=await q({eventId:a.value,eventGradeContent:"",isEventGrade:m.value.isEventGrade});n.code==0?(y.success("\u91CD\u7F6E\u6210\u529F"),d.value=1):y.error(n.msg)})},N=G([]),{tableColumns:j,columns:p,dataCallBack:l,paramCallBack:v,awardTabColumns:f}=Fe(),i=async()=>{const n=await he({eventId:a.value});if(n.code===0){N.value=n.data||[];const t=_e(N.value,j.value,f.value);o.value=t}},d=G(1),h=async()=>{let n=await le(a.value);if(n.code!=0){y.error(n.msg);return}let t=Z(C);if(n.data)if(t.isEventGrade=n.data.isEventGrade,t.eventGradeContent=n.data.eventGradeContent,t.eventProgramAttachment=n.data.eventProgramAttachment,t.eventRegulationContent=n.data.eventRegulationContent,t.eventProgramStatus=n.data.eventProgramStatus,n.data.eventProgramAttachmentPerson)try{t.eventProgramAttachmentPerson=JSON.parse(n.data.eventProgramAttachmentPerson)}catch{t.eventProgramAttachmentPerson=[]}else t.eventProgramAttachmentPerson=[];m.value=t},P=async()=>{const n=JSON.parse(sessionStorage.getItem("eventParams")||"{}");n==null||n.eventApplyStatus,!N.value||N.value.length==0?y.warning("\u5F53\u524D\u8D5B\u4E8B\u6682\u672A\u5F55\u5165\u6210\u7EE9\uFF0C\u65E0\u6CD5\u751F\u6210\u6210\u7EE9\u518C"):d.value=2};return de(async()=>{await h(),m.value.eventGradeContent?(o.value=m.value.eventGradeContent,d.value=2):i()}),(n,t)=>{const _=A("DocumentAdd"),b=A("el-icon"),O=A("el-radio"),K=A("el-radio-group"),R=A("el-form-item"),L=A("el-button"),X=A("DocumentMul"),Y=A("el-form"),ee=A("HZPageLayout");return k(),ce(ee,{title:g(e).meta.title},{default:E(()=>[T(' <template v-if="!isGenerated"> '),T(" \u521D\u59CB\u72B6\u6001 "),g(d)===1?(k(),I("div",{key:0,class:"generateCode",onClick:P},[B("div",Pe,[F(b,{size:"80"},{default:E(()=>[F(_)]),_:1}),t[4]||(t[4]=B("div",null,"\u751F\u6210\u6210\u7EE9\u518C",-1))])])):T("v-if",!0),T(" \u62A5\u4FE1\u4FE1\u606F\u5F55\u5165 "),g(d)===2?(k(),I("div",Te,[F(Y,{model:g(m)},{default:E(()=>[F(R,{label:"\u516C\u5F0F\u8BBE\u7F6E"},{default:E(()=>[F(K,{modelValue:g(m).isEventGrade,"onUpdate:modelValue":t[0]||(t[0]=w=>g(m).isEventGrade=w),onChange:$},{default:E(()=>[F(O,{label:"\u6682\u4E0D\u516C\u793A",value:0}),F(O,{label:"\u516C\u793A",value:1})]),_:1},8,["modelValue"])]),_:1}),g(m).isEventProgram===1||g(m).isEventProgram==0?(k(),I(W,{key:0},[F(R,{label:"\u8D5B\u4E8B\u79E9\u5E8F\u518C",class:"schedule-information-content-item"},{label:E(()=>t[5]||(t[5]=[B("div",{class:"schedule-information-content-label"},[B("span",null,"\u8D5B\u4E8B\u79E9\u5E8F\u518C"),B("span",{class:"schedule-information-content-tip"}," \u8D5B\u4E8B\u79E9\u5E8F\u518C\u4EC5\u751F\u6210\u7CFB\u7EDF\u6807\u51C6\u7248\uFF0C\u82E5\u6709\u7279\u6B8A\u8981\u6C42\uFF0C\u53EF\u5BFC\u51FA\u540E\u5236\u4F5C\u518D\u884C\u5BFC\u5165 ")],-1)])),default:E(()=>[B("div",Ne,[F(L,{type:"primary",loading:g(D),onClick:J},{default:E(()=>t[6]||(t[6]=[V("\u4FDD\u5B58",-1)])),_:1,__:[6]},8,["loading"]),F(L,{type:"primary",loading:g(D),onClick:g(s)},{default:E(()=>t[7]||(t[7]=[V("\u5BFC\u5165",-1)])),_:1,__:[7]},8,["loading","onClick"]),F(L,{type:"primary",loading:g(D),onClick:t[1]||(t[1]=w=>g(u)(g(o)))},{default:E(()=>t[8]||(t[8]=[V("\u5BFC\u51FA",-1)])),_:1,__:[8]},8,["loading"]),F(L,{loading:g(D),onClick:U},{default:E(()=>t[9]||(t[9]=[V("\u91CD\u7F6E",-1)])),_:1,__:[9]},8,["loading"])])]),_:1}),T(" \u8D5B\u4E8B\u89C4\u7A0B\u5185\u5BB9 "),B("div",xe,[F(ne,{value:g(o),"onUpdate:value":t[2]||(t[2]=w=>me(o)?o.value=w:null),hideToolBar:"",editorStyle:{minHeight:"400px"}},null,8,["value"])])],64)):T("v-if",!0),g(m).isEventProgram===2?(k(),I(W,{key:1},[F(R,{label:"\u8D5B\u4E8B\u79E9\u5E8F\u518C"},{label:E(()=>t[10]||(t[10]=[B("div",{class:"schedule-information-content-label"},[B("span",null,"\u9644\u4EF6\u516C\u793A")],-1)])),default:E(()=>[F(X,{fileList:g(m).eventProgramAttachmentPerson,"onUpdate:fileList":t[3]||(t[3]=w=>g(m).eventProgramAttachmentPerson=w),limit:1,accept:".pdf",showFileEdit:!1},null,8,["fileList"])]),_:1}),F(R,{label:""},{default:E(()=>[F(L,{type:"primary",loading:g(D),onClick:z},{default:E(()=>t[11]||(t[11]=[V("\u4FDD\u5B58",-1)])),_:1,__:[11]},8,["loading"])]),_:1})],64)):T("v-if",!0)]),_:1},8,["model"])])):T("v-if",!0)]),_:1},8,["title"])}}});const Ue=ge($e,[["__scopeId","data-v-b9aba488"]]);export{Ue as default};
