import{$t as e,D as t,Et as n,O as r,S as i,T as a,Y as o,Z as ee,_ as s,_t as c,at as l,ct as u,d as te,f as ne,ht as d,in as f,k as re,m as ie,q as p,st as ae,u as m,w as oe,x as h}from"./vue.runtime.esm-bundler-CACvpnko.js";import{_ as se,k as ce,u as g}from"./api-Dpfxb1ca.js";import{f as le,p as ue}from"./index-BXcJqdBr.js";import{t as _}from"./_plugin-vue_export-helper-CXTkFu_Z.js";import{a as de,n as fe,o as pe,r as me,t as he}from"./listPageState-BzwZpEQc.js";import{n as ge,t as _e}from"./eventLocations-BZXc6Zy_.js";var v={class:`reviewer-projects-page`},y={class:`container-fluid p-3 p-md-4`},b={class:`filter-panel mb-3`},x={class:`row g-2 align-items-center`},S={class:`col-12 d-flex flex-wrap align-items-center gap-3`},C={class:`form-check form-check-inline mb-0`},w=[`id`,`value`],T=[`for`],E={class:`col-md-4`},D={class:`col-md-3`},O={class:`col-12 col-md-auto d-flex gap-2`},k={key:0,class:`alert alert-warning py-2 small mb-3`,role:`alert`},A={key:1,class:`small text-secondary mb-2`,"aria-live":`polite`},j={class:`portal-table-scroll table-panel mb-0`},M={class:`table table-hover align-middle mb-0 admin-list-table portal-data-table portal-reviewer-table`},N={key:0},P={class:`text-secondary text-nowrap portal-sticky-left`},F={class:`reviewer-only-col`},I={class:`reviewer-only-col`},ve={class:`reviewer-only-col text-nowrap`},ye={class:`admin-actions-cell portal-sticky-right-1`},L=_(re({__name:`ReviewerProjectsView`,setup(re){let _=le(),L=ue(),R=h(()=>String(_.params.slug??``).trim()),z=c([]),B=c(!1),V=c(``),H=c(``),U=d({keyword:``,event_location:``,review_status:``}),be=_e,W=c({current_page:1,last_page:1,per_page:20,total:0}),G=c(1),K=c(15);function q(){return he(`reviewer-projects`,R.value)}function J(){let e={};return U.event_location&&(e.event_location=U.event_location),U.keyword.trim()&&(e.keyword=U.keyword.trim()),U.review_status&&(e.review_status=U.review_status),e}function Y(){return fe({page:G.value,perPage:K.value,filters:J()})}function X(){let e=q();e.endsWith(`.`)||pe(e,{page:G.value,perPage:K.value,filters:J()})}function xe(){let e=de(q(),_.query);G.value=e.page,K.value=e.perPage,U.event_location=e.filters.event_location??``,U.keyword=e.filters.keyword??``,U.review_status=e.filters.review_status===`pending`||e.filters.review_status===`reviewed`?e.filters.review_status:``}function Z(){let e=Y();me(e,_.query)||R.value&&L.replace({name:`reviewer-projects`,params:{slug:R.value},query:e})}function Se(){let e=new URLSearchParams;e.set(`competition_slug`,R.value),e.set(`page`,String(G.value)),e.set(`per_page`,String(K.value));let t=U.keyword.trim();return t&&e.set(`keyword`,t),U.event_location&&e.set(`event_location`,U.event_location),(U.review_status===`pending`||U.review_status===`reviewed`)&&e.set(`review_status`,U.review_status),e}async function Q(){let e=R.value,{token:t}=ce();if(!e||!t){V.value=`未登录或缺少赛事信息`;return}B.value=!0,V.value=``;try{let e=`${se()}${g}?${Se().toString()}`,n=await fetch(e,{headers:{Authorization:`Bearer ${t}`,Accept:`application/json`}});if(!n.ok){let e=await n.json().catch(()=>({}));V.value=(typeof e==`object`&&e&&`message`in e?String(e.message??``):``)||`加载失败(${n.status})`,z.value=[],H.value=``;return}let r=await n.json();z.value=Array.isArray(r.data)?r.data:[];let i=r.meta;i&&(W.value={current_page:i.current_page??1,last_page:i.last_page??1,per_page:i.per_page??20,total:i.total??0}),Ce()}catch{V.value=`网络错误,请稍后重试`,z.value=[],H.value=``}finally{B.value=!1}}function Ce(){let e=W.value.total;if(e<=0){H.value=`暂无符合条件的数据`;return}let t=[`共 ${e} 条`];U.event_location&&t.push(U.event_location);let n=U.keyword.trim();n&&t.push(`关键词「${n}」`),U.review_status===`pending`?t.push(`待评审`):U.review_status===`reviewed`&&t.push(`已评审`),H.value=t.join(` · `)}function $(e=G.value){let t=G.value!==e;G.value=e,t||(X(),Z(),Q())}function we(){U.keyword=``,U.event_location=``,U.review_status=``,$(1)}xe(),l([R,G,K],()=>{X(),Z(),Q()},{immediate:!0});let Te=h(()=>B.value?`加载中…`:H.value||`暂无报名数据`);function Ee(e){G.value=e}function De(e){K.value=e,G.value=1}function Oe(e){return(W.value.current_page-1)*W.value.per_page+e+1}function ke(e){return e.score_is_pending?`评审`:`查看`}return(c,l)=>{let d=ee(`router-link`);return p(),a(`div`,v,[i(`div`,y,[l[13]||=i(`div`,{class:`d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3`},[i(`h5`,{class:`mb-0 section-title`},`项目评审`)],-1),i(`div`,b,[i(`div`,x,[i(`div`,S,[l[9]||=i(`span`,{class:`small text-secondary text-nowrap`},`意向参赛地点`,-1),i(`div`,C,[u(i(`input`,{id:`reviewer-event-location-all`,"onUpdate:modelValue":l[0]||=e=>U.event_location=e,class:`form-check-input`,type:`radio`,name:`reviewer-event-location`,value:``,onChange:l[1]||=e=>$(1)},null,544),[[m,U.event_location]]),l[8]||=i(`label`,{class:`form-check-label`,for:`reviewer-event-location-all`},`全部`,-1)]),(p(!0),a(s,null,o(n(be),e=>(p(),a(`div`,{key:e,class:`form-check form-check-inline mb-0`},[u(i(`input`,{id:`reviewer-event-location-${e}`,"onUpdate:modelValue":l[2]||=e=>U.event_location=e,class:`form-check-input`,type:`radio`,name:`reviewer-event-location`,value:e,onChange:l[3]||=e=>$(1)},null,40,w),[[m,U.event_location]]),i(`label`,{class:`form-check-label`,for:`reviewer-event-location-${e}`},f(e),9,T)]))),128))]),i(`div`,E,[u(i(`input`,{"onUpdate:modelValue":l[4]||=e=>U.keyword=e,type:`search`,class:`form-control`,placeholder:`搜索项目、姓名、学校、手机号、推荐方`,onKeydown:l[5]||=ie(e=>$(1),[`enter`])},null,544),[[ne,U.keyword]])]),i(`div`,D,[u(i(`select`,{"onUpdate:modelValue":l[6]||=e=>U.review_status=e,class:`form-select`},[...l[10]||=[i(`option`,{value:``},`全部评审状态`,-1),i(`option`,{value:`pending`},`待评审`,-1),i(`option`,{value:`reviewed`},`已评审`,-1)]],512),[[te,U.review_status]])]),i(`div`,O,[i(`button`,{type:`button`,class:`btn btn-primary px-3`,onClick:l[7]||=e=>$(1)},`查询`),i(`button`,{type:`button`,class:`btn btn-light border px-3`,onClick:we},`重置`)])])]),V.value?(p(),a(`p`,k,f(V.value),1)):(p(),a(`p`,A,f(Te.value),1)),i(`div`,j,[i(`table`,M,[l[12]||=i(`thead`,{class:`table-light`},[i(`tr`,null,[i(`th`,{class:`text-nowrap portal-sticky-left`,style:{width:`3.5rem`}},`序号`),i(`th`,{class:`text-nowrap`},`项目编号`),i(`th`,{class:`cell-wrap`},`项目名称`),i(`th`,{class:`text-nowrap`},`姓名`),i(`th`,{class:`cell-wrap`},`项目所在地`),i(`th`,{class:`cell-wrap reviewer-only-col`},`毕业院校`),i(`th`,{class:`text-nowrap reviewer-only-col`},`最高学历`),i(`th`,{class:`cell-wrap`},`赛道`),i(`th`,{class:`text-nowrap`},`评分`),i(`th`,{class:`text-nowrap reviewer-only-col`},`提交时间`),i(`th`,{class:`text-nowrap admin-actions-head portal-sticky-right-1`},`操作`)])],-1),i(`tbody`,null,[!B.value&&z.value.length===0&&!V.value?(p(),a(`tr`,N,[...l[11]||=[i(`td`,{colspan:`11`,class:`text-center text-secondary py-4`},`暂无符合条件的数据`,-1)]])):oe(``,!0),(p(!0),a(s,null,o(z.value,(n,o)=>(p(),a(`tr`,{key:n.id,"data-list-row":``},[i(`td`,P,f(Oe(o)),1),i(`td`,null,f(n.project_code),1),i(`td`,null,f(n.project_name||`—`),1),i(`td`,null,f(n.player_name||`—`),1),i(`td`,null,f(n.location_label),1),i(`td`,F,f(n.school||`—`),1),i(`td`,I,f(n.degree||`—`),1),i(`td`,null,f(n.track_title||n.track_code||`—`),1),i(`td`,{class:e({"admin-total-pending-text":n.score_is_pending})},f(n.score_display),3),i(`td`,ve,f(n.submitted_at||`—`),1),i(`td`,ye,[r(d,{class:`btn btn-sm btn-outline-primary`,to:{name:`reviewer-application-detail`,params:{slug:R.value,id:String(n.id)},query:Y()},onClick:X},{default:ae(()=>[t(f(ke(n)),1)]),_:2},1032,[`to`])])]))),128))])])]),r(ge,{page:G.value,"per-page":K.value,total:W.value.total,"onUpdate:page":Ee,"onUpdate:perPage":De},null,8,[`page`,`per-page`,`total`])])])}}}),[[`__scopeId`,`data-v-696f4045`]]);export{L as default};