1 |
- import{d as C,r as g,Z as S,$ as N,c as s,q as n,ai as k,B as y,P as w,ak as b,m as p,f as h}from"./index.ffe80dbe.js";import{O as x}from"./index.a0ef77e4.js";import{O as m}from"./index.4ddd16f0.js";import{i as I}from"./icon_teacher.df08d662.js";import{L as B}from"./index.cafcb8b5.js";import{C as P}from"./index.f5635935.js";import{C as G}from"./index.914765a1.js";import{C as O}from"./index.ea031708.js";import{I as E}from"./index.7e972106.js";import{T as L}from"./index.55ba7429.js";import{C as T}from"./index.34fb3ef2.js";import{G as F,a as d}from"./index.72ca63b9.js";import{P as V}from"./index.777c6c1a.js";const A="_searchBand_1s5pv_1",R="_bandName_1s5pv_7",W="_gridContainer_1s5pv_12",j="_title_1s5pv_15",q="_red_1s5pv_25",U="_name_1s5pv_28",D="_gridClass_1s5pv_33",H="_img_1s5pv_33",M="_teacherName_1s5pv_40",Z="_maxWidth_1s5pv_44",$="_classCheckbox_1s5pv_57",z="_orchestraName_1s5pv_61",J="_className_1s5pv_71",K="_line_1s5pv_78",Q="_classCellGroup_1s5pv_100";var t={searchBand:A,bandName:R,gridContainer:W,title:j,red:q,name:U,gridClass:D,img:H,teacherName:M,maxWidth:Z,classCheckbox:$,orchestraName:z,className:J,line:K,classCellGroup:Q};function X(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!b(o)}var me=C({name:"practice-class",props:{classType:{type:String,default:""},orchestraId:{type:String,default:""},selectItem:{type:Array,default:()=>[]}},emits:["close","confirm"],setup(o,{slots:Y,attrs:ee,emit:u}){const e=g({showPopover:!1,orchestraId:o.orchestraId||null,orchestraName:null,orchestraList:[],isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{page:1,rows:20},check:o.selectItem||[],checkboxRefs:[]}),f=async()=>{try{const{data:r}=await p.post("/api-school/orchestra/page",{data:{page:1,rows:100,schoolId:h.user.data.school.id,status:"DONE"}}),a=r.rows||[],l=[];a.forEach(i=>{l.push({text:i.name,value:i.id})}),e.orchestraList=[...l],l.length>0&&(e.orchestraId=l[0].value,e.orchestraName=l[0].text,await c())}catch{}},c=async()=>{try{if(e.isClick)return;e.isClick=!0;const{data:r}=await p.post("/api-school/classGroup/page",{data:{...e.params,schoolId:h.user.data.school.id,orchestraId:e.orchestraId,classType:o.classType}});e.isClick=!1,e.listState.loading=!1;const a=r||{};if(e.list.length>0&&a.current===1)return;e.list.concat(a.rows||[]).forEach(i=>{i.preStudentNum>0&&e.list.push(i)}),e.listState.finished=a.current>=a.pages,e.params.page=a.current+1,e.listState.dataShow=e.list.length>0}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isClick=!1}};S(()=>o.classType,()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,c()});const _=r=>{e.checkboxRefs[r].toggle()},v=()=>{u("confirm",e.check),u("close")};return N(async()=>{o.orchestraId?await c():await f()}),()=>{let r;return s("div",{class:[t.practiceClass,!e.listState.dataShow&&"emptyRootContainer"]},[s(m,{position:"top"},{default:()=>[s(x,{title:"\u9009\u62E9\u73ED\u7EA7",desotry:!1},null),!o.orchestraId&&s("div",{class:"searchGroup-single"},[s("div",{class:["searchItem",e.showPopover&&"searchItem-active"],onClick:()=>e.showPopover=!0},[s("span",null,[e.orchestraName])])])]}),e.listState.dataShow?s(B,{finished:e.listState.finished,style:{marginTop:o.orchestraId?"12px":0},finishedText:" ",class:[t.liveList],onLoad:c,immediateCheck:!1},{default:()=>[s(P,{class:[t.gridContainer,t.gridClass],modelValue:e.check,"onUpdate:modelValue":a=>e.check=a},X(r=e.list.map(a=>s(G,{class:t.classCellGroup,onClick:()=>{a.teacherId&&_(a.id)},border:!1},{default:()=>[s(O,{center:!0,titleStyle:{flex:"0 auto"},valueClass:t.classCheckbox},{icon:()=>s(E,{src:I,class:t.img},null),title:()=>s("div",{class:t.content},[s("div",{class:t.teacherName},[a.teacherName?s("div",{class:[t.name,t.maxWidth,"van-ellipsis"]},[a.teacherName]):s("div",{class:[t.name,"van-ellipsis"],style:{color:"red"}},[n("\u6682\u672A\u8BBE\u7F6E\u4F34\u5B66\u6307\u5BFC")]),s(L,{type:"primary"},{default:()=>[a.name]})]),s("div",{class:[t.orchestraName,"van-ellipsis"]},[a.orchestraName])]),value:()=>s(T,{name:a.id,ref:l=>e.checkboxRefs[a.id]=l,disabled:!a.teacherId,onClick:l=>{l.stopPropagation()}},null)}),s(F,{border:!1,columnNum:3},{default:()=>[s(d,null,{default:()=>[s("p",{class:t.title},[a.preStudentNum]),s("p",{class:t.name},[n("\u5B66\u751F\u4EBA\u6570")])]}),s(d,null,{default:()=>[s("p",{class:[t.title]},[a.courseScheduleNum-a.completeCourseScheduleNum]),s("p",{class:t.name},[n("\u5269\u4F59\u8BFE\u65F6")])]}),s(d,null,{default:()=>[s("p",{class:t.title},[a.courseScheduleNum]),s("p",{class:t.name},[n("\u603B\u8BFE\u65F6")])]})]})]})))?r:{default:()=>[r]})]}):s(k,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null),s(m,{position:"bottom"},{default:()=>[s("div",{class:"btnGroup"},[s(y,{block:!0,round:!0,type:"primary",onClick:v},{default:()=>[n("\u786E\u8BA4")]})])]}),s(w,{show:e.showPopover,"onUpdate:show":a=>e.showPopover=a,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[s(V,{columns:e.orchestraList,onCancel:()=>e.showPopover=!1,onConfirm:a=>{e.orchestraId=a.selectedOptions[0].value,e.orchestraName=a.selectedOptions[0].text,e.showPopover=!1,e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,c()}},null)]})])}}});export{me as P};
|