import{d as _,c as a,q as i,a5 as h,B as c,ag as T,r as y,$ as w,m as d,f as S,n as v,ah as m,ai as D,P as b,ak as x}from"./index.ffe80dbe.js";import{O as I}from"./index.c7af3af2.js";import{O as k}from"./index.4ddd16f0.js";import{i as L}from"./icon-edit.664c5ff1.js";import{c as N,u as p}from"./index.931cf0b8.js";import{T as P}from"./index.55ba7429.js";import{G as Y,a as C}from"./index.72ca63b9.js";import{O as G}from"./index.45b38760.js";import{O as M}from"./index.d745568a.js";import{O}from"./index.6daa5b04.js";import{L as U}from"./index.cafcb8b5.js";import{C as q}from"./index.914765a1.js";import{C as F}from"./index.ea031708.js";import{I as R}from"./index.7e972106.js";import"./index.92ec0bf4.js";import"./index.84851ef1.js";import"./use-tab-status.5a3cd090.js";const Q="_unitTest_1rbsa_1",j="_searchBand_1rbsa_1",Z="_cellGroup_1rbsa_7",V="_img_1rbsa_21",J="_unitTitle_1rbsa_26",X="_pass_1rbsa_34",H="_unitSection_1rbsa_40",K="_name_1rbsa_44",W="_endTime_1rbsa_50",z="_unitInformation_1rbsa_54",$="_unitBtnGroup_1rbsa_74";var o={unitTest:Q,searchBand:j,cellGroup:Z,img:V,unitTitle:J,"no-start":"_no-start_1rbsa_31",pass:X,"no-pass":"_no-pass_1rbsa_37",unitSection:H,name:K,endTime:W,unitInformation:z,unitBtnGroup:$};const tt="_dialogTitle_a0l7r_1",at="_btns_a0l7r_19",et="_noticeContainer_a0l7r_26",st="_unitContainer_a0l7r_29",it="_unitTitle_a0l7r_34",nt="_gridScore_a0l7r_51",ut="_title_a0l7r_54",lt="_name_a0l7r_60",ot="_unitTimer_a0l7r_65",rt="_reminder_a0l7r_81",ct="_iconBell_a0l7r_81",dt="_rTitle_a0l7r_86",mt="_rContent_a0l7r_94";var s={dialogTitle:tt,btns:at,noticeContainer:et,unitContainer:st,unitTitle:it,gridScore:nt,title:ut,name:lt,unitTimer:ot,reminder:rt,iconBell:ct,rTitle:dt,rContent:mt},pt="data:image/png;base64,iVBORw0K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==",ft=_({name:"notice-start",props:{data:{type:Object,default:()=>{}}},emits:["close","confirm"],setup(n,{emit:t}){return()=>a("div",{class:s.noticeStart},[a("div",{class:s.dialogTitle},[a("i",null,null),i("\u6D4B\u9A8C\u987B\u77E5")]),a("div",{class:s.noticeContainer},[a("div",{class:s.unitContainer},[a("div",{class:s.unitTitle},[a("span",{class:[s.name,"van-ellipsis"]},[n.data.name]),a(P,{type:"primary"},{default:()=>[N[n.data.courseTypeCode]]})]),a(Y,{border:!1,columnNum:3,class:s.gridScore},{default:()=>[a(C,null,{default:()=>[a("p",{class:s.title},[n.data.totalScore]),a("p",{class:s.name},[i("\u603B\u5206")])]}),a(C,null,{default:()=>[a("p",{class:[s.title],style:{color:"#F67146"}},[n.data.passScore]),a("p",{class:s.name},[i("\u5408\u683C\u5206")])]}),a(C,null,{default:()=>[a("p",{class:s.title},[n.data.questionNum]),a("p",{class:s.name},[i("\u9898\u76EE\u6570\u91CF")])]})]}),a("div",{class:[s.unitTimer,"van-hairline--top"]},[a(h,{name:At},null),a("span",null,[i("\u6D4B\u9A8C\u65F6\u957F\uFF1A"),n.data.timeMinutes,i("\u5206\u949F")])])]),a("div",{class:s.reminder},[a("div",{class:s.rTitle},[a(h,{name:pt,class:s.iconBell},null),a("span",null,[i("\u6E29\u99A8\u63D0\u793A\uFF1A")])]),a("p",{class:s.rContent},[i("1\u3001\u9636\u6BB5\u81EA\u6D4B\u4EC5\u53EF\u8FDB\u884C\u4E00\u6B21\uFF0C\u8BF7\u901A\u8FC7\u7EC3\u4E60\u6A21\u5F0F\u5145\u5206\u7EC3\u4E60\u540E\u518D\u8FDB\u884C\u6D4B\u8BD5\uFF0C\u4EE5\u4FDD\u969C\u6D4B\u9A8C\u5206\u6570\u51C6\u786E\uFF1B"),a("br",null,null),i("2\u3001\u70B9\u51FB\u5F00\u59CB\u6D4B\u9A8C\u540E\u5F00\u59CB\u6D4B\u9A8C\u8BA1\u65F6\uFF0C\u5230\u8FBE\u6D4B\u9A8C\u65F6\u957F\u540E\u81EA\u52A8\u5B8C\u6210\uFF1B"),a("br",null,null),i("3\u3001\u5F00\u59CB\u6D4B\u9A8C\u540E\u82E5\u4E2D\u9014\u9000\u51FA\uFF0C\u65F6\u957F\u4F9D\u7136\u8BA1\u7B97\uFF1B "),a("br",null,null),i(" 4\u3001\u51C6\u5907\u597D\u540E\u5F00\u59CB\u6D4B\u9A8C\u5427\uFF01")])])]),a("div",{class:["van-hairline--top van-dialog__footer",s.btns]},[a(c,{onClick:()=>t("close"),class:["van-dialog__cancel"]},{default:()=>[i("\u518D\u7B49\u7B49")]}),a(c,{onClick:()=>t("confirm"),class:["van-dialog__confirm van-hairline--left"]},{default:()=>[i("\u5F00\u59CB\u6D4B\u9A8C")]})])])}});function Ct(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!x(n)}var Nt=_({name:"unit-test",setup(){const n=T(),t=y({oPopover:!1,searchList:[],list:[],listState:{dataShow:!0,loading:!1,finished:!1,refreshing:!1,height:0},statusText:"\u5168\u90E8\u6D4B\u9A8C",params:{keyword:null,status:null,page:1,rows:20},isClick:!1,visiableNotice:!1,unitExam:{},selectUnitExam:{},dialogMessage:"",dialogStatus:!1}),A=async(u=!1)=>{try{if(t.isClick)return;t.isClick=!0;const e=await d.post("/api-student/studentUnitExamination/queryPageByStudent",{data:{...t.params}});t.listState.loading=!1,t.listState.refreshing=!1;const l=e.data||{};if(t.list.length>0&&l.current===1)return;t.list=t.list.concat(l.rows||[]),t.listState.finished=l.current>=l.pages,t.params.page=l.current+1,t.listState.dataShow=t.list.length>0,t.isClick=!1}catch{t.listState.dataShow=!1,t.listState.finished=!0,t.listState.refreshing=!1,t.isClick=!1}},f=(u=!1)=>{t.params.page=1,t.list=[],t.listState.dataShow=!0,t.listState.loading=!1,t.listState.finished=!1,A(u)},B=async u=>{try{if(!S.user.data.vipMember){t.dialogStatus=!0,t.dialogMessage="\u60A8\u6682\u672A\u5F00\u901A\u56E2\u7EC3\u5B9D\uFF0C\u8BF7\u5F00\u901A\u540E\u4F7F\u7528";return}if(t.selectUnitExam=u||{},u.status==="C_ING"&&g(),u.status==="D_NO_SUBMIT"){const{data:e}=await d.post("/api-student/studentUnitExamination/getExaminationDetail",{requestType:"form",hideLoading:!1,data:{studentUnitExaminationId:u.id}});t.unitExam=e||{},t.visiableNotice=!0}}catch{}},E=u=>{n.push({path:"/unit-detail",query:{id:u.id}})},g=async()=>{try{await d.post("/api-student/studentUnitExamination/startExamination",{requestType:"form",hideLoading:!1,data:{studentUnitExaminationId:t.selectUnitExam.id}}),n.push({path:"/examination-mode",query:{id:t.selectUnitExam.id}})}catch{}};return w(async()=>{const u=sessionStorage.getItem("unit-test-search-type"),e=[{name:"\u5168\u90E8\u6D4B\u9A8C",id:"ALL",selected:!0}];let l={};for(const r in p)e.push({name:p[r],id:r}),r===u&&(l={name:p[r],id:r});t.searchList=e,l.id&&l.id!=="ALL"&&(t.statusText=l.name,t.params.status=l.id);try{const r=await d.get(S.platformApi+"/user/getUserInfo");v(r.data)}catch{}await A()}),()=>{let u;return a("div",{class:[o.unitTest,!t.listState.dataShow&&"emptyRootContainer"]},[a(k,{position:"top",onGetHeight:e=>{t.listState.height=e}},{default:()=>[a(I,{placeholder:"\u8BF7\u8F93\u5165\u6D4B\u9A8C\u540D\u79F0",onSearch:e=>{t.params.keyword=e,f()}},{left:()=>a("div",{class:["searchItem-left",t.oPopover?"searchItem-active":""],onClick:()=>t.oPopover=!0},[a("span",null,[t.statusText])])})]}),t.listState.dataShow?a(G,{modelValue:t.listState.refreshing,"onUpdate:modelValue":e=>t.listState.refreshing=e,onRefresh:()=>f(!0),style:{minHeight:`calc(100vh - ${t.listState.height}px)`}},{default:()=>[a(U,{finished:t.listState.finished,finishedText:" ",class:[o.liveList],style:{paddingTop:"12px"},onLoad:A,immediateCheck:!1},Ct(u=t.list.map(e=>a(q,{inset:!0,class:o.cellGroup,border:!1},{default:()=>[a(F,{center:!0,clickable:!1,titleStyle:{flex:"1 auto"},valueClass:[o["no-start"],e.status==="A_PASS"&&o.pass,e.status==="B_NO_PASS"&&o["no-pass"]]},{icon:()=>a(R,{src:L,class:o.img},null),title:()=>a("div",{class:[o.unitTitle,"van-ellipsis"]},[e.name]),value:()=>p[e.status]}),a(F,{center:!0,class:o.unitSection},{title:()=>a("div",{class:o.unitInformation},[a("div",null,[a("div",{class:o.name},[e.orchestraName]),a("div",{class:o.endTime},[i("\u622A\u6B62\u65F6\u95F4\uFF1A"),m(e.expiryDate||new Date).format("YYYY-MM-DD")])]),e.status==="A_PASS"||e.status==="B_NO_PASS"?a("span",null,[e.score||0,a("i",null,[i("\u5206")])]):""]),label:()=>a("div",{class:o.unitBtnGroup},[a(c,{color:"#FFF0E6",round:!0,block:!0,style:{color:"#F67146"},onClick:()=>{n.push({path:"/test-exercise",query:{id:e.unitExaminationId}})}},{default:()=>[i("\u7EC3\u4E60\u6A21\u5F0F")]}),e.status==="A_PASS"||e.status==="B_NO_PASS"?a(c,{type:"primary",round:!0,block:!0,onClick:()=>E(e)},{default:()=>[i("\u67E5\u770B\u6D4B\u9A8C")]}):a(c,{type:"primary",round:!0,block:!0,disabled:m(m().format("YYYY-MM-DD")).isAfter(m(e.expiryDate)),onClick:()=>B(e)},{default:()=>[e.status==="C_ING"?"\u7EE7\u7EED\u6D4B\u9A8C":"\u5F00\u59CB\u6D4B\u9A8C"]})])})]})))?u:{default:()=>[u]})]}):a(D,{tips:"\u6682\u65E0\u9636\u6BB5\u81EA\u6D4B"},null),a(b,{show:t.visiableNotice,"onUpdate:show":e=>t.visiableNotice=e,round:!0,style:{width:"90%"},closeOnClickOverlay:!1},{default:()=>[a(ft,{data:t.unitExam,onClose:()=>{t.visiableNotice=!1},onConfirm:g},null)]}),a(M,{message:t.dialogMessage,show:t.dialogStatus,"onUpdate:show":e=>t.dialogStatus=e,showCancelButton:!0,cancelButtonText:"\u53D6\u6D88",confirmButtonText:"\u7ACB\u5373\u5F00\u901A",onConfirm:()=>{n.push("/memberCenter")}},null),a(O,{show:t.oPopover,"onUpdate:show":e=>t.oPopover=e,actions:t.searchList,onSelect:e=>{t.searchList.forEach(l=>{l.selected=!1}),e.selected=!0,t.statusText=e.name,t.params.status=e.id==="ALL"?null:e.id,sessionStorage.setItem("unit-test-search-type",e.id),t.oPopover=!1,f()}},null)])}}});export{Nt as default};