select-teacher.eccc3398.js 2.9 KB

1
  1. import{O as f}from"./index.dd4c8fdc.js";import{O as S}from"./index.cefaa76f.js";import{O as C}from"./index.cde52934.js";import{T}from"./teacher-list.196ebad8.js";import{d as g,ag as _,r as b,c as t,F as y,q as u,B,ak as O,bn as v,m as L,f as k}from"./index.2158c03c.js";import{c as r,r as i}from"./create.0dc0e548.js";import{O as I}from"./index.d7cee136.js";import{C as j}from"./index.45c6a14f.js";import{C as G}from"./index.bf3bf6bf.js";import"./index.78beb99c.js";import"./index.339fc024.js";import"./icon_teacher.df08d662.js";import"./index.319cdf30.js";import"./index.0a7e4b18.js";import"./index.40086be7.js";import"./use-tab-status.94e3fedf.js";import"./index.4685a440.js";import"./index.c7644743.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 N(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!O(c)}var ee=g({name:"teacher-list",emits:["close"],setup(){const c=_(),a=b({teacherStatus:!1,status:!1});console.log(r.selectLastTeacherSubjects);const p=async()=>{v({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 L.post("/api-school/orchestra/addOrchestra",{hideLoading:!1,data:{schoolId:k.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(f,{title:"\u9009\u62E9\u4F34\u5B66\u6307\u5BFC"},null),t(j,{inset:!0,class:l.cellGroup},N(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(y,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\u6307\u5BFC")])])}})))?s:{default:()=>[s]}),t(C,{position:"bottom"},{default:()=>[t("div",{class:["btnGroup"]},[t(B,{type:"primary",round:!0,block:!0,onClick:p},{default:()=>[u("\u521B\u5EFA\u5B8C\u6210")]})])]}),t(S,{modelValue:a.teacherStatus,"onUpdate:modelValue":e=>a.teacherStatus=e,position:"bottom"},{default:()=>[t(T,{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{ee as default};