2 lines
1.9 KiB
JavaScript
2 lines
1.9 KiB
JavaScript
const t=l=>String(l??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function c(l,r,d,i){const n=r.map(e=>{const s=e.key==="rewards"?e.subtotal:Math.min(e.subtotal,e.cap),a=e.items.map(o=>'<tr><td style="padding:3pt 6pt;border:0.75pt solid #999">'+t(o.title)+'</td><td style="padding:3pt 6pt;border:0.75pt solid #999;font-size:10pt;color:#555">'+t(o.note||o.source)+'</td><td style="padding:3pt 6pt;border:0.75pt solid #999;text-align:right;width:70pt">'+t(o.score)+"</td></tr>").join("");return'<h2 style="font-size:13pt;margin:12pt 0 5pt;color:#111">'+t(e.label)+"(上限 "+t(e.cap)+" 分,小计 "+t(s)+' 分)</h2><table style="width:100%;border-collapse:collapse;font-size:11pt">'+a+"</table>"}).join("");return'<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word"><head><meta charset="utf-8"><title>综合素质测评</title><!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View></w:WordDocument></xml><![endif]--></head><body style="font-family:SimSun,Calibri,sans-serif;margin:36pt;color:#222"><h1 style="text-align:center;font-size:18pt;margin:0 0 6pt">学生综合素质测评</h1>'+('<div style="font-size:11pt;color:#555;margin-bottom:6pt">'+t(i.name??"")+" · "+t(i.className??"")+" · 统计周期:"+t(l)+"</div>")+'<p style="text-align:center;font-size:13pt;background:#f2f2f2;padding:6pt"><b>综合素质总分:'+t(d)+" 分</b></p>"+n+'<div style="margin-top:24pt;font-size:10.5pt;color:#555">计分依据:《计算机与网络安全学院学生综合素质测评评分细则》。以上自动匹配条目均经过人工核对。</div><table style="width:100%;border-collapse:collapse;margin-top:24pt;font-size:11pt"><tr><td style="width:33%">学生签名:______</td><td style="width:33%">辅导员签名:______</td><td>日期:______</td></tr></table></body></html>'}export{c as zongceToWordHtml};
|