!function(){function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var c=Object.prototype.toString.call(e).slice(8,-1);"Object"===c&&e.constructor&&(c=e.constructor.name);if("Map"===c||"Set"===c)return Array.from(e);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return t(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,c=new Array(t);n0&&1===r.current)){e.next=11;break}return e.abrupt("return");case 11:_.list=_.list.concat(r.rows||[]),_.listState.finished=r.current>=r.pages,_.params.page=r.current+1,_.listState.dataShow=_.list.length>0,_.isLoad=!1,e.next=23;break;case 18:e.prev=18,e.t0=e.catch(0),_.listState.dataShow=!1,_.listState.finished=!0,_.isLoad=!1;case 23:case"end":return e.stop()}}),e,null,[[0,18]])})));return function(){return e.apply(this,arguments)}}(),y=function(){_.params.page=1,_.list=[],_.listState.dataShow=!0,_.listState.loading=!1,_.listState.finished=!1,j()},k=function(){g("close"),g("select",_.check),setTimeout((function(){_.check=[]}),100)};return s((function(){return t.subjectId}),(function(){console.log("subjectId"),y()})),s((function(){return t.selectStudentIds}),(function(){console.log(t.selectStudentIds,"watch"),_.check=e(t.selectStudentIds)})),a((function(){var n;if(console.log(t.selectStudentIds,"onmount"),"sixYearSystem"===(null===(n=u.user.data.school)||void 0===n?void 0:n.schoolSystem)&&_.classList.push({text:"六年级",value:6}),t.orchestraList.length>0){var c=t.orchestraList[0];_.orchestra.id=c.value,_.orchestra.name=c.text}j(),_.check=e(t.selectStudentIds)})),function(){var e;return i("div",{class:N.studentList},[i(S,{position:"top"},{default:function(){return[i(l,{title:"选择学员",desotry:!1,border:!1},null),i(x,{class:"searchGroupInput",placeholder:"学员名称/手机号",onSearch:function(e){_.params.keyword=e,y()}},null),i("div",{class:"searchGroup"},[i("div",{class:["searchItem searchItem-large",_.showPopover?"searchItem-active":""],onClick:function(){return _.showPopover=!0}},[i("span",null,[_.class.name]),i("i",{class:"arrow"},null)]),i("div",{class:["searchItem searchItem-large",_.oPopover?"searchItem-active":""],onClick:function(){return _.oPopover=!0}},[i("span",null,[_.orchestra.name]),i("i",{class:"arrow"},null)])])]}}),_.listState.dataShow?i(I,{finished:_.listState.finished,finishedText:" ",class:[N.liveList],onLoad:j,style:{paddingTop:"12px"},immediateCheck:!1},{default:function(){return[i(L,{modelValue:_.check,"onUpdate:modelValue":function(e){return _.check=e}},(t=e=_.list.map((function(e){return i(E,{modelValue:_.check,"onUpdate:modelValue":function(e){return _.check=e},center:!0,onClick:function(){return t=e.id,void _.checkboxRefs[t].toggle();var t}},{icon:function(){return i(O,{class:N.img,src:e.avatar||C},null)},title:function(){return i("div",{class:N.content},[i("p",{class:N.name},[e.nickname]),i("p",{class:N.class},[e.currentGradeNum>0?F[e.currentGradeNum]:""])])},"right-icon":function(){return i(P,{name:e.id,ref:function(t){return _.checkboxRefs[e.id]=t},onClick:function(e){e.stopPropagation(),e.preventDefault()}},{icon:function(e){return i(d,{class:N.iconChecked,name:e.checked?w:A},null)}})}})})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)?e:{default:function(){return[e]}}))];var t}}):i(f,{btnStatus:!1,tips:"暂无学员"},null),i(S,{position:"bottom"},{default:function(){return[i("div",{class:["btnGroup",N.btnMore]},[i(p,{type:"primary",plain:!0,round:!0,style:{backgroundColor:"transparent"},onClick:function(){_.list.forEach((function(e){_.check.includes(e.id)||_.check.push(e.id)})),_.check}},{default:function(){return[h("全选")]}}),i(p,{type:"primary",round:!0,block:!0,onClick:k},{default:function(){return[h("确认")]}})])]}}),i(m,{show:_.oPopover,"onUpdate:show":function(e){return _.oPopover=e},position:"bottom",round:!0,class:"popupBottomSearch"},{default:function(){return[i(B,{columns:t.orchestraList,onCancel:function(){return _.oPopover=!1},onConfirm:function(e){var t=e.selectedOptions[0];_.orchestra.id=t.value,_.orchestra.name=t.text,_.oPopover=!1,y()}},null)]}}),i(m,{show:_.showPopover,"onUpdate:show":function(e){return _.showPopover=e},position:"bottom",round:!0,class:"popupBottomSearch"},{default:function(){return[i(B,{columns:_.classList,onCancel:function(){return _.showPopover=!1},onConfirm:function(e){var t=e.selectedOptions[0];_.class.id=t.value,_.class.name=t.text,_.showPopover=!1,y()}},null)]}})])}}}),J={subjectList:"_subjectList_hptt0_1",subject:"_subject_hptt0_1",iconChecked:"_iconChecked_hptt0_19",img:"_img_hptt0_27",name:"_name_hptt0_34"};var W=n({name:"subject-list",props:{subjectList:{type:Array,default:function(){return[]}},selectSubjects:{type:Array,default:function(){return[]}}},emits:["close","select"],setup:function(t,n){n.slots,n.attrs;var c=n.emit,o=r({check:[],checkboxRefs:[]}),u=function(){c("select",o.check),c("close")};return s((function(){return t.selectSubjects}),(function(){o.check=e(t.selectSubjects)})),a((function(){o.check=e(t.selectSubjects)})),function(){var e,n;return i("div",{style:{minHeight:"100vh"}},[i(l,{title:"选择声部",desotry:!1},null),i(L,{class:J.subjectList,modelValue:o.check,"onUpdate:modelValue":function(e){return o.check=e},style:{paddingBottom:"24px"}},(n=e=t.subjectList.map((function(e){return i("div",{class:J.subject,onClick:function(){return t=e.subjectId,void o.checkboxRefs[t].toggle();var t}},[i(P,{name:e.subjectId,class:J.checkbox,ref:function(t){return o.checkboxRefs[e.subjectId]=t},onClick:function(e){e.stopPropagation()}},{icon:function(e){return i(d,{class:J.iconChecked,name:e.checked?w:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA4BJREFUWEfVmT1sFEcUx/9vFntF4cI6FIGCEwmKYJnbnQsgIxIhuUgoaCIlIEKoKPgSoJRQUKWAEgHCQJEqwUpMQUMRKCyhJIoF5Gb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ww1rJlAAAAAElFTkSuQmCC"},null)}}),i(O,{class:J.img,src:e.subjectImg},null),i("p",{class:J.name},[e.subjectName])])})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!b(n)?e:{default:function(){return[e]}})),i(S,{position:"bottom"},{default:function(){return[i("div",{class:["btnGroup","btnMore"],style:"padding-left: 13px; padding-right: 13px;"},[i(p,{round:!0,color:"#CCCCCC",onClick:function(){return c("close")}},{default:function(){return[h("取消")]}}),i(p,{type:"primary",round:!0,onClick:u},{default:function(){return[h("确认")]}})])]}})])}}});t("default",n({name:"create-orchestra",setup:function(){var t=g(),n=function(){var e=o(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v.post("/api-school/subjectBasicConfig/page",{data:{page:1,rows:50}});case 3:t=e.sent,n=t.data,M.subjectList=n.rows||[],e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),c=function(){var e=o(regeneratorRuntime.mark((function e(){var t,n,c,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v.post("/api-school/orchestra/page",{data:{page:1,rows:100,schoolId:u.user.data.school.id,status:"DONE"}});case 3:t=e.sent,n=t.data,c=n.rows||[],r=[],c.forEach((function(e){r.push({text:e.name,value:e.id})})),M.orchestraList=[].concat(r),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),r=function(t){M.selectSubjectIds=e(t);var n=[];console.log(M.selectSubjects,"1212",M.subjectList),M.subjectList.forEach((function(e){var c=M.selectSubjects.findIndex((function(t){return t.id===e.subjectId}));t.includes(e.subjectId)&&(c<0?n.push({id:e.subjectId,name:e.subjectName,subjectCode:e.subjectCode,type:null,teacher:{},students:[]}):n.push(M.selectSubjects.find((function(t){return t.id===e.subjectId}))))})),M.selectSubjects=[].concat(n)},s=function(){if(M.orchestraName)if(M.selectSubjects&&M.selectSubjects.length<=0)j("请选择声部");else{var n=M.selectSubjects||[],c=!1;if(n.forEach((function(e){(!e.students||e.students&&e.students.length<=0)&&(c=!0)})),c)j("请选择学员");else{var r=[],s=[],o={};M.selectSubjects.forEach((function(t){if(console.log(t,"item.name"),s.push.apply(s,e(t.students)),"BARITONE"!==t.subjectCode&&"TUBA"!==t.subjectCode)r.push(t);else{var n=o.students?o.students:[];o={id:o.id?o.id+","+t.id:t.id,name:o.name?o.name+"-"+t.name:t.name,type:null,teacher:{},students:[].concat(e(n),e(t.students))}}})),M.selectLastTeacherSubjects=R(r),o.id&&M.selectLastTeacherSubjects.push(o),M.selectLastTeacherSubjects.push({id:null,name:"乐理班",type:"MUSIC_THEORY",teacher:{},students:[].concat(s)},{id:null,name:"合奏班",type:"INSTRUMENTAL_ENSEMBLE",teacher:{},students:[].concat(s)}),t.push({path:"/create-orchestra-teacher"})}}else j("请输入乐团名称")};return a((function(){U(),n(),c()})),function(){return i("div",{class:k["create-orchestra"]},[i(l,null,null),i(T,{inset:!0},{default:function(){return[i(z,{label:"乐团名称",modelValue:M.orchestraName,"onUpdate:modelValue":function(e){return M.orchestraName=e},placeholder:"请输入乐团名称",inputAlign:"right",maxlength:30},null),i(z,{label:"乐团声部",readonly:!0,placeholder:M.selectSubjects.length>0?"已选".concat(M.selectSubjects.length,"个"):"选择声部",isLink:!0,inputAlign:"right",onClick:function(){return M.subjectStatus=!0}},null),M.selectSubjects.map((function(e){return i(E,{title:e.name,isLink:!0,onClick:function(){M.studentStatus=!0,M.selectSubjectStudents=e}},{value:function(){var t;return i(_,null,[h("已选")," ",i("span",{style:{color:"var(--van-primary-color)"}},[(null===(t=e.students)||void 0===t?void 0:t.length)||0])," ",h("名学员")])}})}))]}}),i(S,{position:"bottom"},{default:function(){return[i("div",{class:["btnGroup"]},[i(p,{type:"primary",block:!0,round:!0,onClick:s},{default:function(){return[h("下一步")]}})])]}}),i(y,{modelValue:M.subjectStatus,"onUpdate:modelValue":function(e){return M.subjectStatus=e},style:"background: #F8F8F8;"},{default:function(){return[M.subjectStatus&&i(W,{onClose:function(){return M.subjectStatus=!1},subjectList:M.subjectList,selectSubjects:M.selectSubjectIds,onSelect:r},null)]}}),i(y,{modelValue:M.studentStatus,"onUpdate:modelValue":function(e){return M.studentStatus=e},style:"background: #f8f8f8;"},{default:function(){return[M.studentStatus&&i(V,{orchestraList:M.orchestraList,subjectId:M.selectSubjectStudents.id,selectStudentIds:M.selectSubjectStudents.students,onClose:function(){return M.studentStatus=!1},onSelect:function(t){M.selectSubjectStudents.students=e(t)}},null)]}})])}}}))}}}))}();