You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
7.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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{c as se,m as ce,x as le}from"./api-rQwE0AaH.js";import{l as ue,u as de}from"./index-DFPdDGyr.js";import{t as g}from"./_plugin-vue_export-helper-CXTkFu_Z.js";import{a as fe,n as pe,o as me,t as he}from"./listPageState-BSDA5803.js";import{n as ge,r as _e,t as _}from"./entryGroups-mdEgVvvl.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=[`id`,`value`],w=[`for`],T={class:`col-md-4`},E={class:`col-md-3`},D={class:`col-12 col-md-auto d-flex gap-2`},O={key:0,class:`alert alert-warning py-2 small mb-3`,role:`alert`},k={key:1,class:`small text-secondary mb-2`,"aria-live":`polite`},A={class:`portal-table-scroll table-panel mb-0`},j={class:`table table-hover align-middle mb-0 admin-list-table portal-data-table portal-reviewer-table`},M={key:0},N={class:`text-secondary text-nowrap portal-sticky-left`},P={class:`reviewer-only-col`},F={class:`reviewer-only-col`},I={class:`reviewer-only-col text-nowrap`},ve={class:`admin-actions-cell portal-sticky-right-1`},L=g(re({__name:`ReviewerProjectsView`,setup(re){let g=ue(),L=de(),R=c(()=>String(g.params.slug??``).trim()),z=o([]),B=o(!1),V=o(``),H=o(``),U=ne({keyword:``,entry_group:_,review_status:``}),ye=ge,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(){return pe({page:G.value,perPage:K.value})}function Y(){let e=q();e.endsWith(`.`)||me(e,{page:G.value,perPage:K.value})}function be(){let e=fe(q(),g.query);G.value=e.page,K.value=e.perPage}function X(){let e=J(),t=typeof g.query.page==`string`?g.query.page:void 0,n=typeof g.query.per_page==`string`?g.query.per_page:void 0;t===e.page&&n===e.per_page||R.value&&L.replace({name:`reviewer-projects`,params:{slug:R.value},query:e})}function xe(){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.entry_group&&e.set(`entry_group`,U.entry_group),(U.review_status===`pending`||U.review_status===`reviewed`)&&e.set(`review_status`,U.review_status),e}async function Z(){let e=R.value,{token:t}=le();if(!e||!t){V.value=`未登录或缺少赛事信息`;return}B.value=!0,V.value=``;try{let e=`${ce()}${se}?${xe().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}),Q()}catch{V.value=`网络错误,请稍后重试`,z.value=[],H.value=``}finally{B.value=!1}}function Q(){let e=W.value.total;if(e<=0){H.value=`暂无符合条件的数据`;return}let t=[`共 ${e} 条`];U.entry_group&&t.push(U.entry_group);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||(Y(),X(),Z())}function Se(){U.keyword=``,U.entry_group=_,U.review_status=``,$(1)}be(),s([R,G,K],()=>{Y(),X(),Z()},{immediate:!0});let Ce=c(()=>B.value?`加载中…`:H.value||`暂无报名数据`);function we(e){G.value=e}function Te(e){K.value=e,G.value=1}function Ee(e){return(W.value.current_page-1)*W.value.per_page+e+1}function De(e){return e.score_is_pending?`评审`:`查看`}return(o,s)=>{let c=ee(`router-link`);return p(),m(`div`,v,[h(`div`,y,[s[10]||=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[6]||=h(`span`,{class:`small text-secondary text-nowrap`},`参赛组别`,-1),(p(!0),m(u,null,a(r(ye),e=>(p(),m(`div`,{key:e,class:`form-check form-check-inline mb-0`},[l(h(`input`,{id:`reviewer-entry-group-${e}`,"onUpdate:modelValue":s[0]||=e=>U.entry_group=e,class:`form-check-input`,type:`radio`,name:`reviewer-entry-group`,value:e,onChange:s[1]||=e=>$(1)},null,40,C),[[f,U.entry_group]]),h(`label`,{class:`form-check-label`,for:`reviewer-entry-group-${e}`},d(e),9,w)]))),128))]),h(`div`,T,[l(h(`input`,{"onUpdate:modelValue":s[2]||=e=>U.keyword=e,type:`search`,class:`form-control`,placeholder:`搜索项目、姓名、学校、手机号、推荐方`,onKeydown:s[3]||=ie(e=>$(1),[`enter`])},null,544),[[te,U.keyword]])]),h(`div`,E,[l(h(`select`,{"onUpdate:modelValue":s[4]||=e=>U.review_status=e,class:`form-select`},[...s[7]||=[h(`option`,{value:``},`全部评审状态`,-1),h(`option`,{value:`pending`},`待评审`,-1),h(`option`,{value:`reviewed`},`已评审`,-1)]],512),[[oe,U.review_status]])]),h(`div`,D,[h(`button`,{type:`button`,class:`btn btn-primary px-3`,onClick:s[5]||=e=>$(1)},`查询`),h(`button`,{type:`button`,class:`btn btn-light border px-3`,onClick:Se},`重置`)])])]),V.value?(p(),m(`p`,O,d(V.value),1)):(p(),m(`p`,k,d(Ce.value),1)),h(`div`,A,[h(`table`,j,[s[9]||=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`,M,[...s[8]||=[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`,N,d(Ee(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`,P,d(t.school||`—`),1),h(`td`,F,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`,I,d(t.submitted_at||`—`),1),h(`td`,ve,[i(c,{class:`btn btn-sm btn-outline-primary`,to:{name:`reviewer-application-detail`,params:{slug:R.value,id:String(t.id)},query:J()},onClick:Y},{default:ae(()=>[n(d(De(t)),1)]),_:2},1032,[`to`])])]))),128))])])]),i(_e,{page:G.value,"per-page":K.value,total:W.value.total,"onUpdate:page":we,"onUpdate:perPage":Te},null,8,[`page`,`per-page`,`total`])])])}}}),[[`__scopeId`,`data-v-fe5f81e6`]]);export{L as default};