Files
FootPrint/sync-server/www/assets/AssessmentPage-WNZm2OFJ.js
T
root d534cae0e1 feat(admin): delete user wipes all remote/local data (blobs + sqlite + changes), invite holder_gone mark
\u9080\u8bf7\u7801\u5df2\u7528\u4f46\u6301\u6709\u4eba\u88ab\u6ce8\u9500\u65f6\u7ba1\u7406\u9875\u5c55\u793a\u5df2\u9500\u6237\u5f82\u7ae0\u4e0e\u7b5b\u9009\u3002
2026-10-17 17:04:51 +08:00

28 lines
24 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{c as me,d as pe,f as ee,r as K,ai as fe,aj as xe,j as s,S as he,B as q,ah as ge,m as be,H as le,af as ie,ag as ye,v as ve,M as we}from"./index-Dplf5hVV.js";import{R as je,P as Ne,C as ke}from"./rotate-ccw-DFLp9voo.js";/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _e=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ce=me("ChevronLeft",_e);/**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Se=[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]],ze=me("Images",Se),Me={politics:{中共党员:3,中共预备党员:2.5,入党积极分子:2,共青团员:1.5,群众:1},conductDefault:8,integrityDefault:2,sportsFactor:.025,gpaFactor:10,table2:{国家级:{一等奖:3,二等奖:2,三等奖:1,优秀奖:.5},省市级:{一等奖:2,二等奖:1,三等奖:.5,优秀奖:.2},区县级:{一等奖:1,二等奖:.5,三等奖:.2,优秀奖:.1},校级:{一等奖:.5,二等奖:.2,三等奖:.1,优秀奖:.05},二级学院:{一等奖:.2,二等奖:.1,三等奖:.05,优秀奖:0}},table4:{校级:{干部:4,干事:2,社团干部:1,学工助理:2},院级:{干部:3,干事:1.5,支部委员:1.5,支部组长:1,班长:1,团支书:1,班委:.5,社团干部:1,学工助理:2}},publicGood:{无偿献血:.5,捐献骨髓:3,国家级:1.5,省市级:1,区县级:.5,校级:.2,二级学院:.1},rewards:{荣誉称号:{院级:.3,校级:.5,区级:1,市级:1.5,国家级:2},英语等级:{三级:.5,四级:1,六级:2},计算机等级:{一级:.5,二级:1,三级:2},职业资格:{从业资格:.5,初级:1,中级:2,高级:3}},penalties:{留校察看:5,记过:4,严重警告:3,警告:2,通报批评:1}};function te(d){const i=/^(\d{4})-(\d{4})$/.exec(d);return i?[i[1]+"-09-01",i[2]+"-09-01"]:null}function se(d,i){const u=/^(\d{4})-/.exec(d),h=/^(\d{4})/.exec(i??"");if(!u||!h)return d+" 学年";const l=Number(u[1])-Number(h[1])+1;return(["大一","大二","大三","大四","大五"][l-1]??l+"年级")+"("+d+" 学年)"}function Ie(d,i){if(!i)return!0;const u=(d??"").slice(0,10);return u>=i[0]&&u<i[1]}function Y(d){const i=(d??"").trim();return i?i.includes("国家")?"国家级":i.includes("省")||i.includes("市")?"省市级":i.includes("区")?"区县级":i.includes("院")||i.includes("二级")?"二级学院":i.includes("校")?"校级":null:null}function ce(d){const i=(d??"").trim();return i?/特等|一等|金(色)?奖|冠军|第1名|第一名/.test(i)?"一等奖":/二等|银(色)?奖|亚军|第2名|第3名|第二名|第三名/.test(i)?"二等奖":/三等|铜(色)?奖|第[4-6]名|第四名|第五名|第六名/.test(i)?"三等奖":/优秀|优胜|第[7-9]名|第七名/.test(i)?"优秀奖":null:null}const z=d=>Math.round(d*100)/100;function de(d,i,u){var l;return!i||!u?null:((l=d.table2[i])==null?void 0:l[u])??null}function Ke(d){var ne,re,ae,oe;const{year:i,records:u,semesters:h,bands:l,weights:m,profile:y,rules:o,ov:v}=d,w=i==="all"?null:te(i),S=u.filter(e=>e.status!=="draft"&&Ie(e.start_date??e.created_at,w)),j=e=>{var t;return(t=v.itemOverrides)==null?void 0:t[e]},L=(e,t,a,c,M,I)=>{const _=j(e),ue=(_==null?void 0:_.score)??c??0;return{itemKey:e,title:t,source:a,score:ue,overridden:(_==null?void 0:_.score)!=null,note:M,fromRecord:I}},f=(e,t,a,c)=>({key:e,label:t,cap:a,items:c,subtotal:z(c.reduce((M,I)=>M+I.score,0))}),g=[],b=y.political??"",N=Object.keys(o.politics).find(e=>b.includes(e)),P=N?o.politics[N]:1,O=v.conduct??o.conductDefault,R=v.integrity??o.integrityDefault;g.push(f("conduct","品行素质",13,[{itemKey:"politics",title:"思想政治基础分("+(b||"群众")+")",source:"个人信息 · 政治面貌",score:P},{itemKey:"conduct",title:"操行考评成绩",source:"辅导员考评(可修改)",score:O,overridden:v.conduct!=null},{itemKey:"integrity",title:"诚信分",source:"默认满分(可修改)",score:R,overridden:v.integrity!=null}]));const T=[];for(const e of h){if(w&&!te(e.term))continue;const t=te(e.term);(w===null||t&&!(t[1]<=w[0]||t[0]>=w[1]))&&T.push(...e.courses)}let k=null;const J=e=>{if(e.grade_point!=null)return e.grade_point;if(l&&e.score!=null){const t=l.find(a=>e.score>=a.min&&(e.score<a.max||a.max>=100&&e.score<=a.max));if(t&&t.gp!=null){if(t.gpTop!=null){const a=t.max>=100?t.max:t.max-1,c=(t.gpTop-t.gp)/Math.max(1,a-t.min);return z(t.gp+(e.score-t.min)*c)}return t.gp}}return null},B=e=>m?m[e.category??"其他"]??m.其他??1:1,V=T.map(e=>({...e,grade_point:J(e)})).filter(e=>e.grade_point!=null&&e.credit>0);if(V.length){const e=V.reduce((t,a)=>t+a.credit,0);k=z(V.reduce((t,a)=>t+a.grade_point*B(a)*a.credit,0)/e)}const F=k!=null?Math.min(z(k*o.gpaFactor),60):0;g.push(f("academic","学业成绩",60,[{itemKey:"gpa",title:"平均学分绩点 "+(k!=null?k.toFixed(2):"—")+" × 10",source:"成绩模块 · "+T.length+" 门课程",score:F,note:k==null?"该学期暂无课程成绩":void 0}]));const G=T.filter(e=>/体育/.test(e.course_name)),U=z(G.reduce((e,t)=>e+(t.score??0),0)*o.sportsFactor),$=[];G.length&&$.push({itemKey:"sports",title:"体育成绩("+G.length+" 学期体育课)",source:"体育课成绩之和 × "+o.sportsFactor,score:Math.min(U,5)});const W=[];for(const e of S.filter(t=>t.type_name==="文体活动")){const t=de(o,Y(e.level),ce(e.award_grade));t==null&&!((ne=j("w"+e.id))!=null&&ne.score)||W.push(L("w"+e.id,e.title,e.type_name+" · "+(e.level??"")+" "+(e.award_grade??""),t,void 0,e.id))}const X=z(Math.min(W.reduce((e,t)=>e+t.score,0),5));g.push(f("sports","文体素质",10,[...$,{itemKey:"wcap",title:"文体类加分(上限 5 分)",source:W.length+" 条记录",score:X,note:W.map(e=>e.title+" "+e.score+"分").join(";")||"无匹配记录"}]));const D=[];for(const e of S.filter(t=>t.type_name==="竞赛"||t.type_name==="科研")){const t=de(o,Y(e.level),ce(e.award_grade));t==null&&!((re=j("c"+e.id))!=null&&re.score)||D.push(L("c"+e.id,e.title,e.type_name+" · "+(e.level??"")+" "+(e.award_grade??""),t,void 0,e.id))}const n=z(Math.min(D.reduce((e,t)=>e+t.score,0),10)),r=[];for(const e of S.filter(t=>t.type_name==="学生工作")){const t=Y(e.level)??"院级",a=(e.role??"")+" "+e.title,c=o.table4[t==="国家级"||t==="省市级"||t==="区县级"?"校级":t]??o.table4.院级;let M=null;for(const[I,_]of Object.entries(c))if(a.includes(I)){M=_;break}M==null&&!((ae=j("k"+e.id))!=null&&ae.score)||r.push(L("k"+e.id,e.title,"学生工作 · "+(e.level??"院级")+" "+(e.role??""),M,M==null?"请手动填写分值":void 0,e.id))}const p=z(Math.min(r.reduce((e,t)=>e+t.score,0),4)),x=[];for(const e of S.filter(t=>t.type_name==="志愿公益")){const t=Y(e.level),a=/献血/.test(e.title);let c=a?o.publicGood.无偿献血:t?o.publicGood[t]??null:null;c==null&&!((oe=j("g"+e.id))!=null&&oe.score)||x.push(L("g"+e.id,e.title,"公益 · "+(a?"无偿献血":e.level??"校级"),c,void 0,e.id))}const H=z(Math.min(x.reduce((e,t)=>e+t.score,0),3));g.push(f("expand","拓展性素质",17,[{itemKey:"ccap",title:"竞赛获奖(上限 10 分)",source:D.length+" 条记录",score:n,note:D.map(e=>e.title+" "+e.score+"分").join(";")||"无匹配记录"},{itemKey:"kcap",title:"担任学生工作(上限 4 分)",source:r.length+" 条记录",score:p,note:r.map(e=>e.title+" "+e.score+"分").join(";")||"无匹配记录"},{itemKey:"gcap",title:"公益活动(上限 3 分)",source:x.length+" 条记录",score:H,note:x.map(e=>e.title+" "+e.score+"分").join(";")||"无匹配记录"}]));const E=[];for(const e of S.filter(t=>t.type_name==="荣誉惩处"||t.type_name==="证书技能")){const t=j("h"+e.id),a=e.title+" "+(e.award_grade??"");if(/综合测评奖学金/.test(a))continue;let c=null,M=e.type_name;if(/留校察看/.test(a))c=-o.penalties.留校察看;else if(/记过/.test(a))c=-o.penalties.记过;else if(/严重警告/.test(a))c=-o.penalties.严重警告;else if(/警告/.test(a))c=-o.penalties.警告;else if(/通报批评/.test(a))c=-o.penalties.通报批评;else if(/六级|专八/.test(a))c=o.rewards.英语等级.六级;else if(/四级|专四/.test(a))c=o.rewards.英语等级.四级;else if(/三级/.test(a)&&/英语/.test(a))c=o.rewards.英语等级.三级;else if(/计算机/.test(a)&&/三级/.test(a))c=o.rewards.计算机等级.三级;else if(/计算机/.test(a)&&/二级/.test(a))c=o.rewards.计算机等级.二级;else if(/计算机/.test(a)&&/一级/.test(a))c=o.rewards.计算机等级.一级;else if(/高级/.test(a))c=o.rewards.职业资格.高级;else if(/中级/.test(a))c=o.rewards.职业资格.中级;else if(/初级/.test(a))c=o.rewards.职业资格.初级;else if(/从业|资格证|教师资格|普通话|驾驶证|软考/.test(a))c=o.rewards.职业资格.从业资格;else{const I=Y(e.level),_=I==="省市级"?"市级":I==="区县级"?"区级":I==="二级学院"?"院级":I;_&&o.rewards.荣誉称号[_]!=null&&(c=o.rewards.荣誉称号[_],M="荣誉 · "+_)}c==null&&!(t!=null&&t.score)||E.push(L("h"+e.id,e.title,M,c,void 0,e.id))}const A=z(Math.max(Math.min(E.reduce((e,t)=>e+t.score,0),5),-5));g.push(f("rewards","奖惩分",5,[{itemKey:"hcap",title:"奖惩合计(±5 分)",source:E.length+" 条记录",score:A,note:E.map(e=>e.title+" "+e.score+"分").join(";")||"无匹配记录"}]));for(const e of v.manual??[]){const t=g.find(a=>a.label===e.section)??g[g.length-1];t.items.push({itemKey:"m"+e.title+e.score,title:e.title,source:"手动添加",score:e.score}),t.subtotal=z(t.items.reduce((a,c)=>a+c.score,0))}const Q=z(g.reduce((e,t)=>{const a=t.key==="rewards"?t.subtotal:Math.min(t.subtotal,t.cap);return e+a},0));return{sections:g,total:Q,gpa:k}}function Le(d){return String(d??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Oe(d,i){var l;const u="----=_fp_zongce",h=[];h.push(`MIME-Version: 1.0\r
Content-Type: multipart/related; type="text/html"; boundary="`+u+`"\r
\r
--`+u+`\r
Content-Location: document.html\r
Content-Type: text/html; charset="utf-8"\r
Content-Transfer-Encoding: 8bit\r
\r
`+d+`\r
`);for(const m of i){const y=m.dataUri.indexOf(","),o=m.dataUri.slice(0,y),v=m.dataUri.slice(y+1),w=((l=/data:([^;]+)/.exec(o))==null?void 0:l[1])??"image/png";h.push("--"+u+`\r
Content-Location: `+m.name+`\r
Content-Type: `+w+`\r
Content-Transfer-Encoding: base64\r
\r
`+v+`\r
`)}return h.push("--"+u+`--\r
`),new Blob([h.join("")],{type:'multipart/related; type="text/html"; boundary="'+u+'"'})}const C="border:0.75pt solid #4a4a4a;padding:4pt 7pt;font-size:10.5pt;vertical-align:middle",Z=C+";background:#e8eaf0;font-weight:bold;font-family:SimHei;letter-spacing:1pt";function Ee(d,i,u,h){const l=f=>Le(f),m=l(u.school||"云川理工学院"),y=(f,g,b=!1)=>'<td style="'+Z+";width:"+(b?"16%":"14%")+'">'+g+'</td><td style="'+C+'">'+l(f||"")+"</td>",o=i.sections.map(f=>{const g=f.key==="rewards"?f.subtotal:Math.min(f.subtotal,f.cap),b=f.items.map(N=>'<tr><td style="'+C+'">'+l(N.title)+(N.overridden?"(已手动修正)":"")+'</td><td style="'+C+';color:#555;font-size:9.5pt">'+l(N.note||N.source)+'</td><td style="'+C+';text-align:right;width:64pt" class="num">'+l(N.score)+"</td></tr>").join("");return'<table style="border-collapse:collapse;width:100%;margin:6pt 0 0" border="1"><tr><td style="'+Z+';width:34%">考评项目</td><td style="'+Z+'">评分依据</td><td style="'+Z+';width:64pt;text-align:center">分值</td></tr>'+b+'<tr><td colspan="2" style="'+C+';text-align:right;background:#f4f5f7"><b>'+l(f.label)+"小计</b>(板块上限 "+l(f.cap)+' 分)</td><td style="'+C+';text-align:right;background:#f4f5f7"><b class="num">'+l(g)+"</b></td></tr></table>"}).join(""),v=[];let w=0;const S=h.map(f=>{const g=f.images.map(b=>{w++;const N="ev"+f.recordId+"_"+v.length;return v.push({name:N,dataUri:b}),'<div style="text-align:center"><img src="'+N+'" style="width:196pt;border:0.75pt solid #8a8a8a" alt="附图"><br><span style="font-size:9pt;color:#444">图 '+w+" "+l(f.title)+"</span></div>"}).join("");return'<tr><td style="'+C+';width:26%;vertical-align:top;background:#fafafa"><b style="font-size:10pt">'+l(f.title)+'</b><br><span style="font-size:9pt;color:#666">'+l(f.meta)+'</span></td><td style="'+C+'"><table style="width:100%;border-collapse:collapse"><tr><td style="padding:2pt">'+g+"</td></tr></table></td></tr>"}).join(""),j=S?'<div style="font-family:SimHei;font-size:12pt;margin:14pt 0 4pt">附:加分证明材料('+l(h.length)+" 项记录 · "+l(w)+' 张材料图)</div><table style="border-collapse:collapse;width:100%" border="1">'+S+"</table>":"",L='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word"><head><meta charset="utf-8"><title>学生综合素质测评表</title><style>@page WordSection1 { size:595.3pt 841.9pt; margin:56.7pt 62pt 62pt; mso-footer: f1; }div.WordSection1 { page:WordSection1; }body { font-family:SimSun,serif; font-size:10.5pt; color:#1a1a1a; }h1.title { font-family:SimHei; font-size:16pt; text-align:center; letter-spacing:2pt; margin:0 0 4pt; }p.sub { text-align:center; font-size:10pt; color:#333; margin:0; }table { border-collapse:collapse; }.total td { background:#eef1f6; font-family:SimHei; font-size:12pt; }.num { font-family:Calibri,SimSun; }</style></head><body><div class="WordSection1"><div style="text-align:center;font-size:10.5pt;letter-spacing:1pt;color:#333">'+m+'</div><h1 class="title">学生综合素质测评表</h1><p class="sub">测评学年:'+l(d)+'</p><table style="border-collapse:collapse;width:100%;margin-top:10pt" border="1"><tr>'+y(u.studentId,"学 号")+y(u.name,"姓 名")+y(u.gender,"性 别")+"</tr><tr>"+y(u.college,"学 院")+y(u.major,"专 业")+y(u.className,"班 级")+"</tr><tr>"+y(u.political,"政治面貌")+'<td style="'+Z+'">测评学年</td><td style="'+C+'">'+l(d)+'</td><td style="'+Z+'">测评总分</td><td style="'+C+'"><b class="num" style="font-size:12pt">'+l(i.total)+"</b> / 100 分</td></tr></table>"+o+'<table style="border-collapse:collapse;width:100%;margin-top:8pt" border="1"><tr class="total"><td style="'+C+';text-align:left;font-family:SimHei">综合素质测评总分</td><td style="'+C+';text-align:right;width:64pt" class="num">'+l(i.total)+"</td></tr></table>"+j+'<table style="width:100%;border-collapse:collapse;margin-top:22pt;font-size:10.5pt"><tr><td style="width:25%">学生签名:_____</td><td style="width:25%">班长签名:_____</td><td style="width:25%">辅导员签名:_____</td><td>日期:______</td></tr></table><p style="font-size:9pt;color:#555;margin-top:10pt">说明:本表依据《计算机与网络安全学院学生综合素质测评评分细则》自动生成;带「已手动修正」标记的分值为辅导员核准后的手动结果。导出前请核对加分记录与证明材料一致。</p></div></body></html>';return Oe(L,v)}function Fe(){var $,W,X,D;const d=pe(),i=ee({queryKey:["profile"],queryFn:ye}),u=ee({queryKey:["zc-records"],queryFn:()=>ve({page:1,page_size:500})}),h=ee({queryKey:["grades"],queryFn:we}),l=($=i.data)==null?void 0:$.content,m={...(l==null?void 0:l.info)??{}},y=((W=l==null?void 0:l.zongce)==null?void 0:W.rules)??Me,[o,v]=K.useState(""),[w,S]=K.useState({}),[j,L]=K.useState([]),[f,g]=K.useState(!1),[b,N]=K.useState(null);K.useEffect(()=>{var r,p;if(!l)return;S(((r=l.zongce)==null?void 0:r.overrides)??{});const n=Array.from(new Set((((p=h.data)==null?void 0:p.semesters)??[]).map(x=>x.term.slice(0,7))));!o&&n.length&&v(n[0])},[l,h.data]);const P=((X=u.data)==null?void 0:X.items)??[],O=w[o]??{},R=K.useMemo(()=>{var n,r,p;return Ke({year:o||"all",records:P,semesters:((n=h.data)==null?void 0:n.semesters)??[],bands:(r=h.data)==null?void 0:r.bands,weights:(p=h.data)==null?void 0:p.weights,profile:m,rules:y,ov:O})},[P,h.data,m,y,O,o]),T=K.useMemo(()=>{const n=[];return R.sections.forEach(r=>r.items.forEach(p=>{p.fromRecord&&n.push(p.fromRecord)})),n},[R]);K.useEffect(()=>{let n=!0;return(async()=>{const r=[];for(const p of T){const x=P.find(H=>H.id===p);try{const H=await fe(p),E=[];for(const A of H.items.filter(Q=>Q.id).slice(0,2)){const Q=await xe(A.id);Q.data_b64&&E.push("data:"+(A.mime==="image/jpeg"?"image/jpeg":"image/webp")+";base64,"+Q.data_b64)}if(E.length){const A=[x==null?void 0:x.type_name,x==null?void 0:x.level,x==null?void 0:x.award_grade].filter(Boolean).join(" · ");r.push({recordId:p,title:(x==null?void 0:x.title)??"记录 "+p,meta:A,images:E})}}catch{}}n&&L(r)})(),()=>{n=!1}},[T.join(",")]);const k=K.useMemo(()=>{const n=[];for(const r of j)for(const p of r.images)n.push({src:p,title:r.title});return n},[j]),J=n=>{S(r=>({...r,[o]:n})),ie({info:m,zongce:{rules:y,overrides:{...w,[o]:n}}}).catch(r=>d("error",r.message))},B=o==="all"?"全部学年":se(o,m.eduStart),V=()=>{const n=Ee(B,R,m,j),r=URL.createObjectURL(n),p=document.createElement("a");p.href=r,p.download="综合素质测评_"+B+".doc",p.click(),setTimeout(()=>URL.revokeObjectURL(r),6e4),d("success","综测表已导出(.doc,含证明材料附图 "+k.length+" 张)")},F=b?k.findIndex(n=>n.src===b.src):-1,G=n=>{const r=F+n;r>=0&&r<k.length&&N({src:k[r].src,title:k[r].title,index:r})},U=k.length;return s.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[s.jsxs("div",{className:"no-print mb-4 flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"综合测评"}),s.jsx("p",{className:"mt-0.5 text-[11.5px] text-ink-3",children:"按学年依据学院细则自动计算,可手动修正,支持导出 Word 测评表"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(he,{className:"w-[190px]",value:o,onChange:n=>v(n.target.value),options:[...Array.from(new Set((((D=h.data)==null?void 0:D.semesters)??[]).map(n=>n.term.split("-").slice(0,2).join("-")))).map(n=>({value:n,label:se(n,m.eduStart)})),{value:"all",label:"全部学年"}]}),s.jsxs(q,{variant:"secondary",onClick:V,children:[s.jsx(ge,{size:13})," 导出 Word"]}),s.jsxs(q,{variant:"secondary",onClick:()=>g(!0),children:[s.jsx(je,{size:13})," 初始化"]}),s.jsxs(q,{variant:"primary",onClick:()=>window.print(),children:[s.jsx(Ne,{size:13})," 打印"]})]})]}),s.jsxs("div",{className:"print-sheet mx-auto w-full max-w-[820px] rounded-xl border border-line bg-white shadow-card sm:p-8",children:[s.jsx("div",{className:"text-center text-[11px] tracking-widest text-neutral-500",children:m.school||"云川理工学院"}),s.jsx("h1",{className:"mt-0.5 text-center text-[19px] font-bold tracking-wide text-neutral-900",children:"学生综合素质测评表"}),s.jsxs("div",{className:"mt-1 text-center text-[12px] text-neutral-500",children:["测评学年:",B]}),s.jsx("div",{className:"mt-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-neutral-300 bg-neutral-300 text-[12.5px] sm:grid-cols-3",children:[["学 号",m.studentId],["姓 名",m.name],["性 别",m.gender],["学 院",m.college],["专 业",m.major],["班 级",m.className],["政治面貌",m.political],["统计周期",B]].map(([n,r])=>s.jsxs("div",{className:"flex bg-white",children:[s.jsx("span",{className:"w-[62px] shrink-0 bg-neutral-50 px-2 py-1.5 font-medium text-neutral-500",children:n}),s.jsx("span",{className:"min-w-0 flex-1 truncate px-2 py-1.5 text-neutral-900",children:r??"—"})]},n))}),s.jsxs("div",{className:"mt-4 flex items-center justify-center rounded-lg bg-gradient-to-r from-neutral-900 to-neutral-700 px-4 py-2.5 text-white",children:[s.jsx("span",{className:"text-[12px] opacity-80",children:"综合素质测评总分"}),s.jsx("span",{className:"num ml-3 text-[26px] font-bold leading-none",children:R.total}),s.jsx("span",{className:"ml-1.5 text-[12px] opacity-80",children:"/ 100 分"})]}),R.sections.map(n=>s.jsxs("div",{className:"mt-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"h-4 w-1 rounded-full bg-brand"}),s.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:n.label}),s.jsxs(be,{className:"no-print",color:"var(--text-3)",children:["上限 ",n.cap," 分"]})]}),s.jsxs("span",{className:"num rounded-md bg-neutral-100 px-2 py-0.5 text-[12px] font-semibold text-neutral-700",children:["小计 ",n.key==="rewards"?n.subtotal:Math.min(n.subtotal,n.cap)]})]}),s.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 rounded-lg border border-neutral-200 bg-neutral-50/60 p-3",children:[n.items.map(r=>s.jsxs("div",{className:"flex items-center gap-2 text-[12.5px]",children:[s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"text-neutral-900",children:r.title}),s.jsx("span",{className:"ml-2 text-[11px] text-neutral-400",children:r.source}),r.note&&s.jsx("div",{className:"text-[11px] leading-relaxed text-neutral-400",children:r.note})]}),s.jsx("input",{type:"number",step:"0.1",className:"num w-[72px] rounded-md border border-neutral-200 bg-white px-1.5 py-0.5 text-right text-[12px] focus:border-brand focus:outline-none",value:r.score,onChange:p=>{var x;if(r.itemKey==="conduct"||r.itemKey==="integrity")J({...O,[r.itemKey]:Number(p.target.value)});else{const H={...O.itemOverrides??{},[r.itemKey]:{...((x=O.itemOverrides)==null?void 0:x[r.itemKey])??{},score:Number(p.target.value)}};J({...O,itemOverrides:H})}}})]},r.itemKey)),!n.items.length&&s.jsx("div",{className:"text-[12px] text-neutral-400",children:"暂无数据"})]})]},n.key)),(j.length>0||U>0)&&s.jsxs("div",{className:"mt-7",children:[s.jsx("div",{className:"flex items-center justify-between border-t border-neutral-200 pt-4",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{size:15,className:"text-neutral-500"}),s.jsx("span",{className:"text-[13.5px] font-bold text-neutral-900",children:"附:加分证明材料"}),s.jsxs("span",{className:"text-[11.5px] text-neutral-400",children:["共 ",j.length," 项记录 · ",U," 张图片(点击可放大)"]})]})}),s.jsx("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2",children:j.map(n=>s.jsxs("div",{className:"rounded-lg border border-neutral-200 bg-white p-2.5 transition-shadow hover:shadow-md",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("div",{className:"min-w-0 truncate text-[12.5px] font-semibold text-neutral-800",children:n.title}),s.jsx("div",{className:"shrink-0 text-[10.5px] text-neutral-400",children:n.meta})]}),s.jsx("div",{className:"mt-2 grid grid-cols-2 gap-2",children:n.images.map((r,p)=>s.jsx("button",{onClick:()=>N({src:r,title:n.title,index:k.findIndex(x=>x.src===r)}),className:"group overflow-hidden rounded-md border border-neutral-200 bg-neutral-50",children:s.jsx("img",{src:r,alt:"证明 "+(p+1),className:"aspect-[4/3] w-full object-cover transition-transform group-hover:scale-[1.03]"})},p))})]},n.recordId))})]}),s.jsx("div",{className:"mt-6 border-t border-neutral-200 pt-3 text-[11px] leading-relaxed text-neutral-400",children:"计分依据:《计算机与网络安全学院学生综合素质测评评分细则》。自动匹配条目均可手动修正分值; 「初始化」清除本学年全部手动修正。导出 Word / 打印前请核对加分记录与证明材料一致。"})]}),s.jsx(le,{open:!!b,onClose:()=>N(null),width:920,title:(b==null?void 0:b.title)??(b?"("+(F+1)+"/"+U+")":""),footer:s.jsxs("div",{className:"flex w-full items-center justify-between",children:[s.jsxs(q,{variant:"secondary",disabled:F<=0,onClick:()=>G(-1),children:[s.jsx(Ce,{size:13})," 上一张"]}),s.jsx("span",{className:"num text-[12px] text-ink-3",children:b?F+1+" / "+U:""}),s.jsxs(q,{variant:"primary",disabled:F>=U-1,onClick:()=>G(1),children:["下一张 ",s.jsx(ke,{size:13})]})]}),children:b&&s.jsx("img",{src:b.src,alt:b.title,className:"mx-auto max-h-[74vh] rounded-md"})}),s.jsx(le,{open:f,onClose:()=>g(!1),width:440,title:"初始化综测",footer:s.jsxs(s.Fragment,{children:[s.jsx(q,{variant:"ghost",onClick:()=>g(!1),children:"取消"}),s.jsx(q,{variant:"primary",onClick:()=>{const n={...w};delete n[o],S(n),ie({info:m,zongce:{rules:y,overrides:n}}).then(()=>{g(!1),d("success","已恢复自动计算")}).catch(r=>d("error",r.message))},children:"恢复自动计算"})]}),children:s.jsxs("div",{className:"text-[12.5px] leading-relaxed text-ink-2",children:["将清除 ",s.jsx("b",{children:o==="all"?"全部学年":se(o,m.eduStart)})," 的全部手动修正 (分值覆盖、操行/诚信分修改),恢复为按细则规则的自动计算结果。",s.jsx("div",{className:"mt-2 text-ink-3",children:"记录数据与个人信息不受影响。"})]})})]})}export{Fe as AssessmentPage};