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
4.5 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,O as r,W as i,Y as a,Z as o,_t as s,at as c,b as l,g as u,in as d,k as f,q as p,st as m,w as h,x as g}from"./vue.runtime.esm-bundler-6_koQ1g6.js";import{_,o as v,p as y}from"./api-CH6mod_b.js";import{C as b}from"./index-Dur82jKu.js";import{t as x}from"./_plugin-vue_export-helper-S3RvzygF.js";var S={class:`reviewer-projects-page d-flex flex-column flex-grow-1 h-100 min-h-0`},C={class:`container-fluid p-3 p-md-4`},w={key:0,class:`alert alert-warning py-2 small mb-3`,role:`alert`},T={key:1,class:`small text-secondary mb-3`},E={key:2,class:`small text-secondary mb-2`,"aria-live":`polite`},D={class:`table-responsive table-panel mb-0`},O={class:`table table-hover align-middle mb-0 admin-list-table`},k={key:0},A={class:`text-secondary text-nowrap`},j={class:`reviewer-only-col`},M={class:`reviewer-only-col`},N={class:`reviewer-only-col text-nowrap`},P={class:`admin-actions-cell`},F={key:3,class:`d-flex align-items-center justify-content-between flex-wrap gap-2 mt-3`,"aria-label":`分页`},I=[`disabled`],L={class:`small text-secondary`},R=[`disabled`],z=x(f({__name:`ReviewerProjectsView`,setup(f){let x=b(),z=l(()=>String(x.params.slug??``).trim()),B=s([]),V=s(!1),H=s(``),U=s({current_page:1,last_page:1,per_page:20,total:0}),W=s(1);async function G(){let e=z.value,{token:t}=_();if(!e||!t){H.value=`未登录或缺少赛事信息`;return}V.value=!0,H.value=``;try{let n=new URLSearchParams;n.set(`competition_slug`,e),n.set(`page`,String(W.value)),n.set(`per_page`,`20`);let r=`${y()}${v}?${n.toString()}`,i=await fetch(r,{headers:{Authorization:`Bearer ${t}`,Accept:`application/json`}});if(!i.ok){let e=await i.json().catch(()=>({}));H.value=(typeof e==`object`&&e&&`message`in e?String(e.message??``):``)||`加载失败(${i.status}`,B.value=[];return}let a=await i.json();B.value=Array.isArray(a.data)?a.data:[];let o=a.meta;o&&(U.value={current_page:o.current_page??1,last_page:o.last_page??1,per_page:o.per_page??20,total:o.total??0})}catch{H.value=`网络错误,请稍后重试`,B.value=[]}finally{V.value=!1}}c([z,W],()=>void G()),i(()=>void G());let K=l(()=>{let e=U.value.total;return e<=0?`暂无报名数据`:`${e} 条,第 ${U.value.current_page} / ${U.value.last_page}`});function q(){W.value>1&&--W.value}function J(){W.value<U.value.last_page&&(W.value+=1)}function Y(e){return(U.value.current_page-1)*U.value.per_page+e+1}function X(e){return e===0?`评审`:`查看`}return(i,s)=>{let c=o(`router-link`);return p(),h(`div`,S,[g(`div`,C,[s[2]||=g(`div`,{class:`d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3`},[g(`h5`,{class:`mb-0 section-title`},`项目评审`)],-1),H.value?(p(),h(`p`,w,d(H.value),1)):V.value?(p(),h(`p`,T,`加载中…`)):(p(),h(`p`,E,d(K.value),1)),g(`div`,D,[g(`table`,O,[s[1]||=g(`thead`,{class:`table-light`},[g(`tr`,null,[g(`th`,{class:`text-nowrap`,style:{width:`3.5rem`}},`序号`),g(`th`,null,`项目编号`),g(`th`,null,`项目名称`),g(`th`,null,`姓名`),g(`th`,null,`项目所在地`),g(`th`,{class:`reviewer-only-col`},`毕业院校`),g(`th`,{class:`reviewer-only-col`},`最高学历`),g(`th`,null,`赛道`),g(`th`,null,`评分`),g(`th`,{class:`reviewer-only-col`},`提交时间`),g(`th`,{class:`admin-actions-head`},`操作`)])],-1),g(`tbody`,null,[!V.value&&B.value.length===0&&!H.value?(p(),h(`tr`,k,[...s[0]||=[g(`td`,{colspan:`11`,class:`text-center text-secondary py-4`},`暂无符合条件的数据`,-1)]])):t(``,!0),(p(!0),h(u,null,a(B.value,(t,i)=>(p(),h(`tr`,{key:t.id,"data-list-row":``},[g(`td`,A,d(Y(i)),1),g(`td`,null,d(t.project_code),1),g(`td`,null,d(t.project_name||``),1),g(`td`,null,d(t.player_name||``),1),g(`td`,null,d(t.location_label),1),g(`td`,j,d(t.school||``),1),g(`td`,M,d(t.degree||``),1),g(`td`,null,d(t.track_title||t.track_code||``),1),g(`td`,{class:e({"admin-total-pending-text":t.score_is_pending})},d(t.score_display),3),g(`td`,N,d(t.submitted_at||``),1),g(`td`,P,[r(c,{class:`btn btn-sm btn-outline-primary`,to:{name:`reviewer-application-detail`,params:{slug:z.value,id:String(t.id)}}},{default:m(()=>[n(d(X(i)),1)]),_:2},1032,[`to`])])]))),128))])])]),U.value.last_page>1?(p(),h(`nav`,F,[g(`button`,{type:`button`,class:`btn btn-sm btn-light border`,disabled:W.value<=1||V.value,onClick:q},` 上一页 `,8,I),g(`span`,L,d(U.value.current_page)+` / `+d(U.value.last_page),1),g(`button`,{type:`button`,class:`btn btn-sm btn-light border`,disabled:W.value>=U.value.last_page||V.value,onClick:J},` 下一页 `,8,R)])):t(``,!0)])])}}}),[[`__scopeId`,`data-v-631ee0e2`]]);export{z as default};