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

2 lines
6.3 KiB
JavaScript

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.

var R=(u,y,f)=>new Promise((I,w)=>{var h=c=>{try{g(f.next(c))}catch(v){w(v)}},T=c=>{try{g(f.throw(c))}catch(v){w(v)}},g=c=>c.done?I(c.value):Promise.resolve(c.value).then(h,T);g((f=f.apply(u,y)).next())});import{u as D,_ as j}from"./useForm-Ca7JThS8.js";import"./BasicForm.vue_vue_type_style_index_0_lang-D34fDasZ.js";import"./componentMap-S705cJLS.js";import{ax as A,C as H,_ as q}from"./entry/index-CwTXVJ2d-1723001953242.js";import{P as z}from"./index-BOexY1T-.js";import{u as J,_ as Q}from"./useTable--thsDsLA.js";import"./index-B4wZYO02.js";import{a3 as B,b9 as X,M as G,b3 as b,j as $}from"./antd-BY-1PcYE.js";import{d as Z,r as ee,c as V,f as _,w as te,aa as ae,_ as k,a8 as N,a9 as t,k as s,u as a,$ as O,F as oe,ab as le,a0 as d,G as p,a1 as m,ac as se,y as ne,a3 as re,a4 as ie}from"./vue-aEZWZQSa.js";import"./FormItem.vue_vue_type_script_lang-DhGC9etS.js";import"./helper-BPjqq6ZQ.js";import"./index-DVEqH4Di.js";import"./useWindowSizeFn-C93ItSr2.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-Cx2YeHC7.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./style-DTWqfx8n.js";import"./useContentViewHeight-C-BEyhbS.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-BAwH_r98.js";import"./download-Da_OLLnH.js";import"./useLoading-B4X4QuoY.js";function ue(u,y){return A.get({url:"/report/universityRecord/generate/"+u+"/"+y})}function ce(u){return A.post({url:"/report/universityRecord/saveAndPrint",data:u},{isTransformResponse:!1})}const C=u=>(re("data-v-d63bbb9d"),u=u(),ie(),u),de={key:0,class:"mt-4"},pe=C(()=>d("b",null,"学校名称",-1)),me=C(()=>d("b",null,"测试年度",-1)),fe=C(()=>d("b",null,"学生人数",-1)),ve=C(()=>d("b",null,"学业预警学生人数",-1)),be=C(()=>d("b",null,"有心理治疗咨询史学生人数",-1)),_e=Z({__name:"index",setup(u){const y=ee({studentGrade:"年级",gender:"性别",department:"院系",major:"专业"}),f=V(()=>o=>"按"+y[o]||""),I=V(()=>{var o;switch((o=n.value)==null?void 0:o.category){case"major":return"专业";case"department":return"学院";case"studentGrade":return"入学年份";default:return""}}),w=V(()=>n.value?`高校学生心理健康状况统计表(${f.value(n.value.category)}`:""),h=_([]),T=[{field:"category",component:"Cascader",label:"按学校、分类别进行统计",colProps:{span:8},itemProps:{labelCol:{span:10},wrapperCol:{span:23}},componentProps:{options:[{value:"成都医学院",label:"成都医学院",children:[{value:"gender",label:"按性别统计"},{value:"studentGrade",label:"按年级统计"},{value:"major",label:"按专业统计"},{value:"department",label:"按院系统计"}]}]}}],[g,{getFieldsValue:c}]=D({labelWidth:80,schemas:T}),v=_([]),S=_(!1),x=_(!1),n=_(),[M,{setFieldsValue:K,getFieldsValue:L}]=D({labelCol:{span:8},wrapperCol:{span:15},actionColOptions:{offset:0,span:22},showActionButtonGroup:!1,schemas:[{field:"comment",label:"干预建议",component:"InputTextArea",show:!0,colProps:{span:24},itemProps:{labelCol:{span:3},wrapperCol:{span:20}},componentProps:{type:"text",rows:4,style:{width:"100%",minHeight:"100px"}}}]}),F=_([{title:"",width:100,dataIndex:"t1"},{title:"一级预警",width:60,dataIndex:"t2"},{title:"二级预警",width:60,dataIndex:"t3"},{title:"三级预警",width:60,dataIndex:"t4"},{title:"四级预警",width:60,dataIndex:"t5"}]),[U]=J({title:"",columns:F,pagination:!1,dataSource:h,showIndexColumn:!1,showTableSetting:!1,scroll:{y:300}});function W(o){return o.sort((l,r)=>{const e=Object.keys(l)[0],i=Object.keys(r)[0];return e.localeCompare(i)}).map(l=>{const r=Object.keys(l)[0],e=l[r];return{t1:r,t2:e[0],t3:e[1],t4:e[2],t5:e[3]}})}te(()=>n.value,o=>{o&&(F.value[0].title=I.value)},{immediate:!0});function Y(){return R(this,null,function*(){const l=c().category;try{const r=yield ue(l[0],l[1]);v.value=r,S.value=!0}catch(r){S.value=!1}})}function E(o){x.value=!0,n.value=o,ne(()=>{K(o),h.value=W(o.categoryStatistics)})}function P(o){return R(this,null,function*(){try{const l=L();o.comment=l.comment;const r=yield new Promise(i=>{G.confirm({title:"确认保存",content:"是否打印?",onOk:()=>i(!0),onCancel:()=>i(!1)})}),e=yield ce(o);if(r){const i=document.createElement("a");i.href="http://1.14.108.22:5050/static/tmp/"+e.msg,i.download="university_report.xlsx",document.body.appendChild(i),i.click(),document.body.removeChild(i)}x.value=!1,$.success("保存成功")}catch(l){$.error("保存失败")}})}return(o,l)=>{const r=ae("a-button");return k(),N(a(z),{title:"全校学生心理健康状况评价",class:"high-form",content:"全校学生心理健康状况评价。请选择学校以及统计类别,点击查询查看详情统计表"},{default:t(()=>[s(a(H),{title:"查询"},{default:t(()=>[s(a(j),{onRegister:a(g),onSubmit:Y},null,8,["onRegister"])]),_:1}),S.value?(k(),O("div",de,[s(a(B),{title:"学生心理健康状况统计表"},{default:t(()=>[(k(!0),O(oe,null,le(v.value,e=>(k(),N(a(X),{key:e.testYear,onClick:i=>E(e)},{default:t(()=>[d("p",null,[p("测试年度:"),d("b",null,m(e.testYear),1)]),d("p",null,[p(m(e.university)+"",1),d("b",null,m(f.value(e.category))+"统计",1)])]),_:2},1032,["onClick"]))),128))]),_:1})])):se("",!0),s(a(G),{visible:x.value,"onUpdate:visible":l[1]||(l[1]=e=>x.value=e),title:w.value,onOk:P,width:800},{footer:t(()=>[s(r,{type:"primary",onClick:l[0]||(l[0]=e=>P(n.value))},{default:t(()=>[p("保存")]),_:1})]),default:t(()=>[s(a(B),{bordered:!0,class:"mt-5 px-5"},{default:t(()=>[s(a(b),{column:2},{default:t(()=>[s(a(b).Item,null,{label:t(()=>[pe]),default:t(()=>{var e;return[p(" "+m((e=n.value)==null?void 0:e.university),1)]}),_:1}),s(a(b).Item,null,{label:t(()=>[me]),default:t(()=>{var e;return[p(" "+m((e=n.value)==null?void 0:e.testYear),1)]}),_:1}),s(a(b).Item,null,{label:t(()=>[fe]),default:t(()=>{var e;return[p(" "+m((e=n.value)==null?void 0:e.total),1)]}),_:1}),s(a(b).Item,null,{label:t(()=>[ve]),default:t(()=>{var e;return[p(" "+m((e=n.value)==null?void 0:e.academicWarningTotal),1)]}),_:1}),s(a(b).Item,null,{label:t(()=>[be]),default:t(()=>{var e;return[p(" "+m((e=n.value)==null?void 0:e.psychCounselingTotal),1)]}),_:1})]),_:1}),s(a(Q),{onRegister:a(U),dataSource:h.value},null,8,["onRegister","dataSource"]),s(a(j),{onRegister:a(M),class:"mt-4 px-4"},null,8,["onRegister"])]),_:1})]),_:1},8,["visible","title"])]),_:1})}}}),Ke=q(_e,[["__scopeId","data-v-d63bbb9d"]]);export{Ke as default};