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