1 |
- import{d as S,ag as g,r as y,g as p,R as c,$ as v,e as E,b7 as R,c as a,aj as w,a5 as C,q as L,ak as T,al as U,m as O,o as k}from"./index.5f7ffb46.js";import{O as B}from"./index.ec2a7822.js";import{O as x}from"./index.7790de2a.js";import{s as m,U as I}from"./unit-list-item.298a198d.js";import{O as P}from"./index.1d6ac2c5.js";import{O as b}from"./index.fdad9231.js";import{L as V}from"./index.9ef28852.js";import"./index.6438a25f.js";import"./index.abd668f7.js";import"./icon-edit.664c5ff1.js";import"./icon-muit-message.0a72e92d.js";import"./index.052b3caa.js";import"./index.276a5d68.js";import"./index.78e196a2.js";import"./use-tab-status.69b57a37.js";var N="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAALtJREFUWEftmNENwyAMRPEgyRJmiUzSmTpJlsBLlEGokKiEojTSxVRC1fFtH9YDzIGEASPGuJVSnlVKRB4ppd0rK16Bmq+qrxDC0rSyma1e3VGFlb4QM3PrugUaMRYGbRFVJTES+0aApxLaG/UGQRPO4nkqUYokRmIXBKQzeR8/hQIbHZ+r2ZSDyRs9yV29PG9h0y7lXdZ9HvsYSpHESOyq86N06MdIDCRAzw8C4ysJBfb/xOb86vzF5/AbfM2i57toBH8AAAAASUVORK5CYII=";function G(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!U(o)}var W=S({name:"unit-list",setup(){const o=g(),e=y({oPopover:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},statusText:"\u73ED\u7EA7\u7C7B\u578B",params:{keyword:null,classTypeCode:null,page:1,rows:20},isClick:!1,action:[{name:"\u73ED\u7EA7\u7C7B\u578B",id:"ALL",selected:!0},{name:"\u5355\u6280\u73ED",id:"SINGLE"},{name:"\u4E50\u7406\u73ED",id:"MUSIC_THEORY"},{name:"\u5408\u594F\u73ED",id:"INSTRUMENTAL_ENSEMBLE"}]}),l=p.platformApi,i=c(!1),n=c(!1),r=async()=>{if(!e.isClick){e.isClick=!0,n.value=!0;try{i.value&&(e.params.page=1,e.list=[],i.value=!1);const s=p.platformType==="TEACHER"?`${l}/studentUnitExamination/queryPageByTeacher`:`${l}/studentUnitExamination/queryPageByManage`,t=await O.post(s,{data:{...e.params}});if(e.list.length>0&&t.data.pages===1)return;e.params.page=t.data.current+1,e.list=t.data.rows,e.listState.dataShow=e.list.length>0,n.value=!1,e.listState.finished=t.data.current>=t.data.pages}catch(s){const t=s.message;k(t),e.listState.dataShow=!1,e.listState.finished=!0}e.isClick=!1}},f=()=>{e.listState.finished=!0,n.value=!0,r()},u=()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,r()};v(()=>{r(),window.history.pushState(null,"",document.URL),window.addEventListener("popstate",d,!1)});const d=()=>{E({api:"back"})};R(()=>{window.removeEventListener("popstate",d)});const h=()=>{sessionStorage.removeItem("unit-create"),o.push("/unit-create")};return()=>{let s;return a("div",{class:m.unitTest},[a(x,{position:"top",onGetHeight:t=>{document.documentElement.style.setProperty("--header-height",t+"px")}},{default:()=>[a(w,{border:!1},{right:()=>l=="/api-teacher"?a(C,{name:N,size:19,onClick:h},null):null}),a(B,{placeholder:"\u8BF7\u8F93\u5165\u6D4B\u9A8C\u540D\u79F0",onSearch:t=>{e.params.keyword=t,u()}},{left:()=>a("div",{class:["searchItem-left",e.oPopover?"searchItem-active":""],onClick:()=>e.oPopover=!0},[a("span",null,[e.statusText,L(" ")])])})]}),e.listState.dataShow?a(P,{modelValue:i.value,"onUpdate:modelValue":t=>i.value=t,onRefresh:f,style:"min-height: calc(100vh - var(--header-height));"},{default:()=>[a(V,{finished:e.listState.finished,finishedText:" ",class:[m.liveList],onLoad:r,style:{paddingTop:"12px"},immediateCheck:!1},G(s=e.list.map(t=>a(I,{item:t},null)))?s:{default:()=>[s]})]}):a(T,{tips:"\u6682\u65E0\u9636\u6BB5\u81EA\u6D4B"},null),a(b,{show:e.oPopover,"onUpdate:show":t=>e.oPopover=t,actions:e.action,onSelect:t=>{e.action.forEach(A=>{A.selected=!1}),t.selected=!0,e.statusText=t.name,e.params.classTypeCode=t.id==="ALL"?null:t.id,e.oPopover=!1,u()}},null)])}}});export{W as default};
|