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