|
|
import{$t as e,C as t,D as n,Et as r,O as i,Y as a,Z as ee,_t as o,at as s,b as c,ct as l,d as te,g as u,ht as ne,in as d,k as re,l as f,p as ie,q as p,st as ae,u as oe,w as m,x as h}from"./vue.runtime.esm-bundler-OsdSFvn7.js";import{_ as se,k as ce,u as le}from"./api-Dpfxb1ca.js";import{l as g,u as ue}from"./index-CpTiFmNV.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-y2a2WJrd.js";import{n as ge,t as _e}from"./eventLocations-BfEKlYoy.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 _=g(),L=ue(),R=c(()=>String(_.params.slug??``).trim()),z=o([]),B=o(!1),V=o(``),H=o(``),U=ne({keyword:``,event_location:``,review_status:``}),be=_e,W=o({current_page:1,last_page:1,per_page:20,total:0}),G=o(1),K=o(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()}${le}?${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(),s([R,G,K],()=>{X(),Z(),Q()},{immediate:!0});let Te=c(()=>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(o,s)=>{let c=ee(`router-link`);return p(),m(`div`,v,[h(`div`,y,[s[13]||=h(`div`,{class:`d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3`},[h(`h5`,{class:`mb-0 section-title`},`项目评审`)],-1),h(`div`,b,[h(`div`,x,[h(`div`,S,[s[9]||=h(`span`,{class:`small text-secondary text-nowrap`},`参赛地点`,-1),h(`div`,C,[l(h(`input`,{id:`reviewer-event-location-all`,"onUpdate:modelValue":s[0]||=e=>U.event_location=e,class:`form-check-input`,type:`radio`,name:`reviewer-event-location`,value:``,onChange:s[1]||=e=>$(1)},null,544),[[f,U.event_location]]),s[8]||=h(`label`,{class:`form-check-label`,for:`reviewer-event-location-all`},`全部`,-1)]),(p(!0),m(u,null,a(r(be),e=>(p(),m(`div`,{key:e,class:`form-check form-check-inline mb-0`},[l(h(`input`,{id:`reviewer-event-location-${e}`,"onUpdate:modelValue":s[2]||=e=>U.event_location=e,class:`form-check-input`,type:`radio`,name:`reviewer-event-location`,value:e,onChange:s[3]||=e=>$(1)},null,40,w),[[f,U.event_location]]),h(`label`,{class:`form-check-label`,for:`reviewer-event-location-${e}`},d(e),9,T)]))),128))]),h(`div`,E,[l(h(`input`,{"onUpdate:modelValue":s[4]||=e=>U.keyword=e,type:`search`,class:`form-control`,placeholder:`搜索项目、姓名、学校、手机号、推荐方`,onKeydown:s[5]||=ie(e=>$(1),[`enter`])},null,544),[[te,U.keyword]])]),h(`div`,D,[l(h(`select`,{"onUpdate:modelValue":s[6]||=e=>U.review_status=e,class:`form-select`},[...s[10]||=[h(`option`,{value:``},`全部评审状态`,-1),h(`option`,{value:`pending`},`待评审`,-1),h(`option`,{value:`reviewed`},`已评审`,-1)]],512),[[oe,U.review_status]])]),h(`div`,O,[h(`button`,{type:`button`,class:`btn btn-primary px-3`,onClick:s[7]||=e=>$(1)},`查询`),h(`button`,{type:`button`,class:`btn btn-light border px-3`,onClick:we},`重置`)])])]),V.value?(p(),m(`p`,k,d(V.value),1)):(p(),m(`p`,A,d(Te.value),1)),h(`div`,j,[h(`table`,M,[s[12]||=h(`thead`,{class:`table-light`},[h(`tr`,null,[h(`th`,{class:`text-nowrap portal-sticky-left`,style:{width:`3.5rem`}},`序号`),h(`th`,{class:`text-nowrap`},`项目编号`),h(`th`,{class:`cell-wrap`},`项目名称`),h(`th`,{class:`text-nowrap`},`姓名`),h(`th`,{class:`cell-wrap`},`项目所在地`),h(`th`,{class:`cell-wrap reviewer-only-col`},`毕业院校`),h(`th`,{class:`text-nowrap reviewer-only-col`},`最高学历`),h(`th`,{class:`cell-wrap`},`赛道`),h(`th`,{class:`text-nowrap`},`评分`),h(`th`,{class:`text-nowrap reviewer-only-col`},`提交时间`),h(`th`,{class:`text-nowrap admin-actions-head portal-sticky-right-1`},`操作`)])],-1),h(`tbody`,null,[!B.value&&z.value.length===0&&!V.value?(p(),m(`tr`,N,[...s[11]||=[h(`td`,{colspan:`11`,class:`text-center text-secondary py-4`},`暂无符合条件的数据`,-1)]])):t(``,!0),(p(!0),m(u,null,a(z.value,(t,r)=>(p(),m(`tr`,{key:t.id,"data-list-row":``},[h(`td`,P,d(Oe(r)),1),h(`td`,null,d(t.project_code),1),h(`td`,null,d(t.project_name||`—`),1),h(`td`,null,d(t.player_name||`—`),1),h(`td`,null,d(t.location_label),1),h(`td`,F,d(t.school||`—`),1),h(`td`,I,d(t.degree||`—`),1),h(`td`,null,d(t.track_title||t.track_code||`—`),1),h(`td`,{class:e({"admin-total-pending-text":t.score_is_pending})},d(t.score_display),3),h(`td`,ve,d(t.submitted_at||`—`),1),h(`td`,ye,[i(c,{class:`btn btn-sm btn-outline-primary`,to:{name:`reviewer-application-detail`,params:{slug:R.value,id:String(t.id)},query:Y()},onClick:X},{default:ae(()=>[n(d(ke(t)),1)]),_:2},1032,[`to`])])]))),128))])])]),i(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-ef5e7cd3`]]);export{L as default}; |