import{d as f,ag as S,r as T,c as t,aj as g,F as C,q as u,B as _,al as b,br as y,m as v,g as B}from"./index.d1dca38b.js";import{O}from"./index.6af77b17.js";import{O as L}from"./index.3aa1e6eb.js";import{T as j}from"./teacher-list.652cbfc8.js";import{c as r,r as i}from"./create.c3d5f866.js";import{O as I}from"./index.a817bb82.js";import{C as k}from"./index.1383acec.js";import{C as G}from"./index.2f930c00.js";import"./index.339fc024.js";import"./icon_teacher.df08d662.js";import"./index.71cfe737.js";import"./index.a5f38096.js";import"./index.876ff047.js";import"./use-tab-status.03ea8dd0.js";import"./index.6c52b1a0.js";import"./index.3d816bd4.js";const w="_selectTeacher_1fv1o_1",F="_cellGroup_1fv1o_4",V="_tips_1fv1o_12",x="_name_1fv1o_15";var l={selectTeacher:w,cellGroup:F,tips:V,name:x};function E(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!b(c)}var Y=f({name:"teacher-list",emits:["close"],setup(){const c=S(),a=T({teacherStatus:!1,status:!1});console.log(r.selectLastTeacherSubjects);const p=async()=>{y({title:"\u63D0\u793A",message:"\u662F\u5426\u521B\u5EFA\u4E50\u56E2\uFF1F",showCancelButton:!0}).then(async()=>{try{const s=r.selectLastTeacherSubjects||[],e=[];s.forEach(o=>{e.push({teacherId:o.teacher.id,type:o.type,subjectId:o.id,studentIdList:[...o.students]})}),console.log(e,"tempselects"),await v.post("/api-school/orchestra/addOrchestra",{hideLoading:!1,data:{schoolId:B.user.data.school.id,name:r.orchestraName,classGroupList:[...e]}}),a.status=!0}catch{}})},m=s=>s&&s.toString().split(","),h=()=>{i(),c.replace("/train-planning")},d=()=>{i(),c.replace("/my-orchestra")};return()=>{let s;return t("div",{class:l.selectTeacher},[t(g,{title:"\u9009\u62E9\u4F34\u5B66\u8001\u5E08"},null),t(k,{inset:!0,class:l.cellGroup},E(s=r.selectLastTeacherSubjects.map(e=>t(G,{center:!0,onClick:()=>{a.teacherStatus=!0,r.selectTeacher=e},isLink:!0},{title:()=>t("span",{class:l.title},[e.name]),value:()=>{var o,n;return t(C,null,[(o=e.teacher)!=null&&o.nickname?t("p",{class:l.name},[((n=e.teacher)==null?void 0:n.nickname)||""]):t("p",{class:l.tips},[u("\u8BF7\u9009\u62E9\u4F34\u5B66\u8001\u5E08")])])}})))?s:{default:()=>[s]}),t(L,{position:"bottom"},{default:()=>[t("div",{class:["btnGroup"]},[t(_,{type:"primary",round:!0,block:!0,onClick:p},{default:()=>[u("\u521B\u5EFA\u5B8C\u6210")]})])]}),t(O,{modelValue:a.teacherStatus,"onUpdate:modelValue":e=>a.teacherStatus=e,position:"bottom"},{default:()=>[t(j,{subjectIdList:m(r.selectTeacher.id),onClose:()=>a.teacherStatus=!1,onSelect:e=>{r.selectTeacher.teacher=e,a.teacherStatus=!1}},null)]}),t(I,{show:a.status,"onUpdate:show":e=>a.status=e,title:"\u521B\u5EFA\u6210\u529F",messageAlign:"left",confirmButtonText:"\u53BB\u6392\u8BFE",cancelButtonText:"\u6682\u4E0D\u6392\u8BFE",showCancelButton:!0,message:"\u4E50\u56E2\u521B\u5EFA\u5B8C\u6210\uFF0C\u662F\u5426\u9700\u8981\u6392\u8BFE\uFF1F",onConfirm:h,onCancel:d},null)])}}});export{Y as default};
