index-legacy.9e294ace.js 17 KB

1
  1. !function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t,n,r,c,o,s){try{var a=e[o](s),u=a.value}catch(i){return void n(i)}a.done?t(u):Promise.resolve(u).then(r,c)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,c){var o=e.apply(t,n);function a(e){s(o,r,c,a,u,"next",e)}function u(e){s(o,r,c,a,u,"throw",e)}a(void 0)}))}}var u=document.createElement("style");u.innerHTML="._searchBand_1v64m_1{display:inline-block;font-size:.37333rem;font-weight:600;color:#333}._searchBand_1v64m_1 ._bandName_1v64m_7{display:inline-block;max-width:4.8rem;vertical-align:text-top}._studentList_1v64m_12{--van-checkbox-border-color: transparent}._studentList_1v64m_12 .van-checkbox{height:.66667rem}._studentList_1v64m_12 ._iconChecked_1v64m_18{font-size:.48rem;border:.02667rem solid transparent;background:transparent}._studentList_1v64m_12 ._iconChecked_1v64m_18 .van-icon__image{width:100%;height:100%}._studentList_1v64m_12 ._img_1v64m_27{width:1.28rem;height:1.28rem;overflow:hidden;border-radius:50%;margin-right:.32rem;flex-shrink:0}._studentList_1v64m_12 ._name_1v64m_35{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._studentList_1v64m_12 ._class_1v64m_41{padding-top:.08rem;font-size:.32rem;color:#777;line-height:.45333rem}._studentList_1v64m_12 ._btnMore_1v64m_47{display:flex;align-items:center;padding:.42667rem .34667rem!important}._studentList_1v64m_12 ._btnMore_1v64m_47 .van-button{display:flex;justify-content:center;align-items:center;flex-shrink:1;width:30%}._studentList_1v64m_12 ._btnMore_1v64m_47 .van-button+.van-button{flex-shrink:2;width:68%;margin-left:2%}._subjectList_hptt0_1{display:flex;align-items:center;flex-wrap:wrap}._subject_hptt0_1{--van-checkbox-border-color: transparent;position:relative;padding-left:.34667rem;margin-top:.53333rem}._subject_hptt0_1 .van-checkbox{position:absolute;top:.16rem;right:.16rem;z-index:9;height:.66667rem}._subject_hptt0_1 ._iconChecked_hptt0_19{font-size:.48rem;border:.02667rem solid transparent}._subject_hptt0_1 ._iconChecked_hptt0_19 .van-icon__image{width:100%;height:100%}._subject_hptt0_1 ._img_hptt0_27{width:2.88rem;height:2.88rem;border-radius:.21333rem;overflow:hidden;background-color:#fff}._subject_hptt0_1 ._name_hptt0_34{padding-top:.16rem;font-size:.42667rem;font-weight:500;color:#333;max-width:2.88rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n",document.head.appendChild(u),System.register(["./index-legacy.81fd4e6f.js","./index-legacy.50ceab3b.js","./index-legacy.00d82922.js","./index-legacy.a9944503.js","./index.module-legacy.6e7ede01.js","./index-legacy.c7f919fb.js","./icon-checkbox-check-legacy.8c6ec582.js","./icon-checkbox-default-legacy.20cf236b.js","./icon_student-legacy.6118fd72.js","./index-legacy.8271e59c.js","./index-legacy.3652aee1.js","./index-legacy.16d013c6.js","./index-legacy.aa24f77a.js","./index-legacy.1f2c4a24.js","./index-legacy.40afcdaf.js","./create-legacy.5d325e95.js","./index-legacy.75e78f7b.js","./index-legacy.0256f666.js","./index-legacy.819d05e3.js","./index-legacy.c75fe8a2.js","./use-tab-status-legacy.7b80393c.js","./Checker-legacy.a8f83c3c.js","./index-legacy.e997fd26.js","./index-legacy.8bfb99fc.js","./index-legacy.2a9471c6.js"],(function(n){"use strict";var r,o,s,u,i,l,d,f,p,h,m,b,v,_,g,j,y,S,k,x,w,C,L,I,O,P,A,E,N,R,T,B,M,U;return{setters:[function(e){r=e.O},function(e){o=e.O},function(e){s=e.O},function(e){u=e.d,i=e.r,l=e.Z,d=e.$,f=e.f,p=e.c,h=e.a5,m=e.ai,b=e.B,v=e.q,_=e.P,g=e.aj,j=e.m,y=e.ag,S=e.F,k=e.o},function(e){x=e.s},function(e){w=e.O},function(e){C=e.c},function(e){L=e.c},function(e){I=e.i},function(e){O=e.L},function(e){P=e.C},function(e){A=e.C},function(e){E=e.I},function(e){N=e.C},function(e){R=e.P},function(e){T=e.r,B=e.c},function(e){M=e.C},function(e){U=e.F},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var V={searchBand:"_searchBand_1v64m_1",bandName:"_bandName_1v64m_7",studentList:"_studentList_1v64m_12",iconChecked:"_iconChecked_1v64m_18",img:"_img_1v64m_27",name:"_name_1v64m_35",class:"_class_1v64m_41",btnMore:"_btnMore_1v64m_47"};var G={1:"一年级",2:"二年级",3:"三年级",4:"四年级",5:"五年级",6:"六年级"},z=u({name:"student-list",props:{orchestraList:{type:Array,default:function(){return[]}},subjectId:{type:[String,Number],default:""},selectStudentIds:{type:Array,default:function(){return[]}}},emits:["close","select"],setup:function(e,n){n.slots,n.attrs;var o=n.emit,u=i({showPopover:!1,oPopover:!1,isLoad:!1,classList:[{text:"全部",value:-1},{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],check:[],checkboxRefs:[],orchestra:{id:null,name:"全部乐团"},class:{id:null,name:"全部"},list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,page:1,rows:20}}),y=function(){var t=a(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!u.isLoad){t.next=3;break}return t.abrupt("return");case 3:return u.isLoad=!0,t.next=6,j.post("/api-school/student/page",{data:c(c({},u.params),{},{subjectId:e.subjectId,orchestraId:u.orchestra.id,currentGradeNum:-1===u.class.id?null:u.class.id})});case 6:if(n=t.sent,u.listState.loading=!1,r=n.data||{},!(u.list.length>0&&1===r.current)){t.next=11;break}return t.abrupt("return");case 11:u.list=u.list.concat(r.rows||[]),u.listState.finished=r.current>=r.pages,u.params.page=r.current+1,u.listState.dataShow=u.list.length>0,u.isLoad=!1,t.next=23;break;case 18:t.prev=18,t.t0=t.catch(0),u.listState.dataShow=!1,u.listState.finished=!0,u.isLoad=!1;case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(){return t.apply(this,arguments)}}(),S=function(){u.params.page=1,u.list=[],u.listState.dataShow=!0,u.listState.loading=!1,u.listState.finished=!1,y()},k=function(){o("close"),o("select",u.check),setTimeout((function(){u.check=[]}),100)};return l((function(){return e.subjectId}),(function(){console.log("subjectId"),S()})),l((function(){return e.selectStudentIds}),(function(){console.log(e.selectStudentIds,"watch"),u.check=t(e.selectStudentIds)})),d((function(){var n;if(console.log(e.selectStudentIds,"onmount"),"sixYearSystem"===(null===(n=f.user.data.school)||void 0===n?void 0:n.schoolSystem)&&u.classList.push({text:"六年级",value:6}),e.orchestraList.length>0){var r=e.orchestraList[0];u.orchestra.id=r.value,u.orchestra.name=r.text}y(),u.check=t(e.selectStudentIds)})),function(){var t;return p("div",{class:V.studentList},[p(s,{position:"top"},{default:function(){return[p(r,{title:"选择学生",desotry:!1,border:!1},null),p(w,{class:"searchGroupInput",placeholder:"学生名称/手机号",onSearch:function(e){u.params.keyword=e,S()}},null),p("div",{class:"searchGroup"},[p("div",{class:["searchItem searchItem-large",u.showPopover?"searchItem-active":""],onClick:function(){return u.showPopover=!0}},[p("span",null,[u.class.name]),p("i",{class:"arrow"},null)]),p("div",{class:["searchItem searchItem-large",u.oPopover?"searchItem-active":""],onClick:function(){return u.oPopover=!0}},[p("span",null,[u.orchestra.name]),p("i",{class:"arrow"},null)])])]}}),u.listState.dataShow?p(O,{finished:u.listState.finished,finishedText:" ",class:[V.liveList],onLoad:y,style:{paddingTop:"12px"},immediateCheck:!1},{default:function(){return[p(P,{modelValue:u.check,"onUpdate:modelValue":function(e){return u.check=e}},(e=t=u.list.map((function(e){return p(A,{modelValue:u.check,"onUpdate:modelValue":function(e){return u.check=e},center:!0,onClick:function(){return t=e.id,void u.checkboxRefs[t].toggle();var t}},{icon:function(){return p(E,{class:V.img,src:e.avatar||I},null)},title:function(){return p("div",{class:V.content},[p("p",{class:V.name},[e.nickname]),p("p",{class:V.class},[e.currentGradeNum>0?G[e.currentGradeNum]:""])])},"right-icon":function(){return p(N,{name:e.id,ref:function(t){return u.checkboxRefs[e.id]=t},onClick:function(e){e.stopPropagation(),e.preventDefault()}},{icon:function(e){return p(h,{class:V.iconChecked,name:e.checked?C:L},null)}})}})})),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!g(e)?t:{default:function(){return[t]}}))];var e}}):p(m,{btnStatus:!1,tips:"暂无学生"},null),p(s,{position:"bottom"},{default:function(){return[p("div",{class:["btnGroup",V.btnMore]},[p(b,{type:"primary",plain:!0,round:!0,style:{backgroundColor:"transparent"},onClick:function(){u.list.forEach((function(e){u.check.includes(e.id)||u.check.push(e.id)})),u.check}},{default:function(){return[v("全选")]}}),p(b,{type:"primary",round:!0,block:!0,onClick:k},{default:function(){return[v("确认")]}})])]}}),p(_,{show:u.oPopover,"onUpdate:show":function(e){return u.oPopover=e},position:"bottom",round:!0,class:"popupBottomSearch"},{default:function(){return[p(R,{columns:e.orchestraList,onCancel:function(){return u.oPopover=!1},onConfirm:function(e){var t=e.selectedOptions[0];u.orchestra.id=t.value,u.orchestra.name=t.text,u.oPopover=!1,S()}},null)]}}),p(_,{show:u.showPopover,"onUpdate:show":function(e){return u.showPopover=e},position:"bottom",round:!0,class:"popupBottomSearch"},{default:function(){return[p(R,{columns:u.classList,onCancel:function(){return u.showPopover=!1},onConfirm:function(e){var t=e.selectedOptions[0];u.class.id=t.value,u.class.name=t.text,u.showPopover=!1,S()}},null)]}})])}}}),D={subjectList:"_subjectList_hptt0_1",subject:"_subject_hptt0_1",iconChecked:"_iconChecked_hptt0_19",img:"_img_hptt0_27",name:"_name_hptt0_34"};var F=u({name:"subject-list",props:{subjectList:{type:Array,default:function(){return[]}},selectSubjects:{type:Array,default:function(){return[]}}},emits:["close","select"],setup:function(e,n){n.slots,n.attrs;var c=n.emit,o=i({check:[],checkboxRefs:[]}),a=function(){c("select",o.check),c("close")};return l((function(){return e.selectSubjects}),(function(){o.check=t(e.selectSubjects)})),d((function(){o.check=t(e.selectSubjects)})),function(){var t,n;return p("div",{style:{minHeight:"100vh"}},[p(r,{title:"选择声部",desotry:!1},null),p(P,{class:D.subjectList,modelValue:o.check,"onUpdate:modelValue":function(e){return o.check=e},style:{paddingBottom:"24px"}},(n=t=e.subjectList.map((function(e){return p("div",{class:D.subject,onClick:function(){return t=e.subjectId,void o.checkboxRefs[t].toggle();var t}},[p(N,{name:e.subjectId,class:D.checkbox,ref:function(t){return o.checkboxRefs[e.subjectId]=t},onClick:function(e){e.stopPropagation()}},{icon:function(e){return p(h,{class:D.iconChecked,name:e.checked?C:L},null)}}),p(E,{class:D.img,src:e.subjectImg},null),p("p",{class:D.name},[e.subjectName])])})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!g(n)?t:{default:function(){return[t]}})),p(s,{position:"bottom"},{default:function(){return[p("div",{class:["btnGroup","btnMore"],style:"padding-left: 13px; padding-right: 13px;"},[p(b,{round:!0,color:"#CCCCCC",onClick:function(){return c("close")}},{default:function(){return[v("取消")]}}),p(b,{type:"primary",round:!0,onClick:a},{default:function(){return[v("确认")]}})])]}})])}}}),H=function t(n){if(null===n)return null;var r=Object.assign({},n);return Object.keys(r).forEach((function(c){return r[c]="object"===e(n[c])?t(n[c]):n[c]})),Array.isArray(n)?(r.length=n.length,Array.from(r)):r};n("default",u({name:"create-orchestra",setup:function(){var e=y(),n=function(){var e=a(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,j.post("/api-school/subjectBasicConfig/page",{data:{page:1,rows:50}});case 3:t=e.sent,n=t.data,B.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=a(regeneratorRuntime.mark((function e(){var t,n,r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,j.post("/api-school/orchestra/page",{data:{page:1,rows:100,schoolId:f.user.data.school.id,status:"DONE"}});case 3:t=e.sent,n=t.data,r=n.rows||[],c=[],r.forEach((function(e){c.push({text:e.name,value:e.id})})),B.orchestraList=[].concat(c),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)}}(),u=function(e){B.selectSubjectIds=t(e);var n=[];console.log(B.selectSubjects,"1212",B.subjectList),B.subjectList.forEach((function(t){var r=B.selectSubjects.findIndex((function(e){return e.id===t.subjectId}));e.includes(t.subjectId)&&(r<0?n.push({id:t.subjectId,name:t.subjectName,subjectCode:t.subjectCode,type:null,teacher:{},students:[]}):n.push(B.selectSubjects.find((function(e){return e.id===t.subjectId}))))})),B.selectSubjects=[].concat(n)},i=function(){if(B.orchestraName)if(B.selectSubjects&&B.selectSubjects.length<=0)k("请选择声部");else{var n=B.selectSubjects||[],r=!1;if(n.forEach((function(e){(!e.students||e.students&&e.students.length<=0)&&(r=!0)})),r)k("请选择学生");else{var c=[],o=[],s={};B.selectSubjects.forEach((function(e){if(console.log(e,"item.name"),o.push.apply(o,t(e.students)),"BARITONE"!==e.subjectCode&&"TUBA"!==e.subjectCode)c.push(e);else{var n=s.students?s.students:[];s={id:s.id?s.id+","+e.id:e.id,name:s.name?s.name+"-"+e.name:e.name,type:null,teacher:{},students:[].concat(t(n),t(e.students))}}})),B.selectLastTeacherSubjects=H(c),s.id&&B.selectLastTeacherSubjects.push(s),B.selectLastTeacherSubjects.push({id:null,name:"乐理班",type:"MUSIC_THEORY",teacher:{},students:[].concat(o)},{id:null,name:"合奏班",type:"INSTRUMENTAL_ENSEMBLE",teacher:{},students:[].concat(o)}),e.push({path:"/create-orchestra-teacher"})}}else k("请输入乐团名称")};return d((function(){T(),n(),c()})),function(){return p("div",{class:x["create-orchestra"]},[p(r,null,null),p(M,{inset:!0},{default:function(){return[p(U,{label:"乐团名称",modelValue:B.orchestraName,"onUpdate:modelValue":function(e){return B.orchestraName=e},placeholder:"请输入乐团名称",inputAlign:"right",maxlength:30},null),p(U,{label:"乐团声部",readonly:!0,placeholder:B.selectSubjects.length>0?"已选".concat(B.selectSubjects.length,"个"):"选择声部",isLink:!0,inputAlign:"right",onClick:function(){return B.subjectStatus=!0}},null),B.selectSubjects.map((function(e){return p(A,{title:e.name,isLink:!0,onClick:function(){B.studentStatus=!0,B.selectSubjectStudents=e}},{value:function(){var t;return p(S,null,[v("已选")," ",p("span",{style:{color:"var(--van-primary-color)"}},[(null===(t=e.students)||void 0===t?void 0:t.length)||0])," ",v("名学生")])}})}))]}}),p(s,{position:"bottom"},{default:function(){return[p("div",{class:["btnGroup"]},[p(b,{type:"primary",block:!0,round:!0,onClick:i},{default:function(){return[v("下一步")]}})])]}}),p(o,{modelValue:B.subjectStatus,"onUpdate:modelValue":function(e){return B.subjectStatus=e},style:"background: #F8F8F8;"},{default:function(){return[B.subjectStatus&&p(F,{onClose:function(){return B.subjectStatus=!1},subjectList:B.subjectList,selectSubjects:B.selectSubjectIds,onSelect:u},null)]}}),p(o,{modelValue:B.studentStatus,"onUpdate:modelValue":function(e){return B.studentStatus=e},style:"background: #f8f8f8;"},{default:function(){return[B.studentStatus&&p(z,{orchestraList:B.orchestraList,subjectId:B.selectSubjectStudents.id,selectStudentIds:B.selectSubjectStudents.students,onClose:function(){return B.studentStatus=!1},onSelect:function(e){B.selectSubjectStudents.students=t(e)}},null)]}})])}}}))}}}))}();