;(function () { function _toConsumableArray(arr) { return ( _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread() ) } function _nonIterableSpread() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return if (typeof o === 'string') return _arrayLikeToArray(o, minLen) var n = Object.prototype.toString.call(o).slice(8, -1) if (n === 'Object' && o.constructor) n = o.constructor.name if (n === 'Map' || n === 'Set') return Array.from(o) if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen) } function _iterableToArray(iter) { if ( (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) || iter['@@iterator'] != null ) return Array.from(iter) } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr) } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg) var value = info.value } catch (error) { reject(error) return } if (info.done) { resolve(value) } else { Promise.resolve(value).then(_next, _throw) } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments return new Promise(function (resolve, reject) { var gen = fn.apply(self, args) function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value) } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err) } _next(undefined) }) } } var __vite_style__ = document.createElement('style') __vite_style__.innerHTML = '._roomHeader_13gb6_1{background:url(./assets/room_bg.498828a6.png) top center no-repeat;background-size:100%;overflow:hidden}._roomHeader_13gb6_1 .van-row{align-items:center}._countTimer_13gb6_9{padding:.85333rem .64rem .58667rem}._countTimer_13gb6_9 ._timer_13gb6_12{padding-left:.05333rem;font-size:.69333rem;font-weight:600;color:#333;padding-bottom:.26667rem}._countTimer_13gb6_9 ._timer_13gb6_12 span{color:#666;font-size:.37333rem}._countTimer_13gb6_9 ._title_13gb6_23{display:flex;align-items:center;font-size:.32rem;color:#333;line-height:.45333rem}._countTimer_13gb6_9 ._title_13gb6_23 img{width:.4rem;height:.4rem;margin-right:.13333rem}._chargeTimer_13gb6_35 .van-button__text{display:flex;align-items:center;font-weight:600}._chargeTimer_13gb6_35 .van-button__text img{margin-left:.05333rem;width:.26667rem;height:.26667rem}._studentList_13gb6_45{margin:0 .37333rem .4rem;background:#ffffff;border-radius:.26667rem;overflow:hidden}._studentCount_13gb6_51{font-size:.37333rem;font-weight:500;color:#333}._btnGroupInvite_13gb6_56{display:flex;align-items:center;justify-content:space-between;padding-bottom:.10667rem}._btnGroupInvite_13gb6_56 .van-button{width:48%;font-size:.37333rem;font-weight:500;color:#333!important}._btnGroupInvite_13gb6_56 .van-button img{margin-right:.21333rem;width:.53333rem;height:.53333rem}._btnGroupInvite_13gb6_56 .van-button__text{display:flex;align-items:center}._searchList_13gb6_77{display:flex;padding:.32rem .42667rem;background-color:#fff}._dataItem_13gb6_82{font-size:.37333rem;color:#333;padding-right:.64rem}._shareSection_115rh_1{width:8.13333rem;padding:.37333rem;background:url(./assets/share_bg.252c9956.png) center no-repeat #01C1B5;background-size:cover;overflow:hidden}._shareSection_115rh_1 ._img_115rh_8{width:1.44rem;height:1.44rem;border-radius:50%;margin-right:.32rem}._shareSection_115rh_1 ._name_115rh_14{font-size:.48rem;font-weight:500;color:#1a1a1a;line-height:.48rem;max-width:3.46667rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._shareSection_115rh_1 ._titleTips_115rh_24{padding-top:.13333rem;font-size:.37333rem;color:#8a8a8a;line-height:.48rem}._section_115rh_30{background:#ffffff;border-radius:.29333rem;overflow:hidden;padding:.37333rem .42667rem .53333rem}._txt_115rh_36{font-size:.42667rem;color:#333;line-height:1.5}._txt_115rh_36 span{font-size:.48rem;font-weight:500;color:#01C1B5}._teacherName_115rh_46{padding-top:.53333rem}._download_115rh_49{margin-top:.26667rem;display:flex;align-items:center;justify-content:space-between}._download_115rh_49 ._logo_115rh_55{font-size:.34667rem;color:#349784;line-height:.48rem}._download_115rh_49 ._logo_115rh_55 img{width:2.48rem;vertical-align:middle;margin-bottom:.29333rem}._download_115rh_49 ._qrcode_115rh_65{position:relative;width:2.02667rem;height:2.02667rem}._download_115rh_49 ._qrcode_115rh_65 ._qrcodeCanvas_115rh_70{width:100%!important;height:100%!important}._download_115rh_49 ._qrcode_115rh_65 ._qrcodeLogo_115rh_74{position:absolute;top:50%;left:50%;margin-left:-.21333rem;margin-top:-.21333rem;width:.42667rem;height:.42667rem;border-radius:.10667rem}._continue_115rh_84{position:absolute;right:.66667rem;top:.53333rem;z-index:2;background:rgba(0,0,0,.23);border-radius:.50667rem;font-size:.37333rem;color:#fff;background:linear-gradient(0deg,#01C1B5 0%,#32e8c6 100%);padding:.16rem .48rem}._label_v8pn1_1{margin-right:.21333rem;font-size:.37333rem}._label_v8pn1_1 .van-list__loading,._label_v8pn1_1 .van-list__finished-text,._label_v8pn1_1 .van-list__error-text{width:100%}._label_v8pn1_1 .iconfont-down{margin-left:.10667rem}._studentList_v8pn1_13{height:55vh;overflow:auto}._studentList_v8pn1_13 .van-checkbox{justify-content:flex-end}._btnGroup_v8pn1_20{padding:0 .53333rem .37333rem}._confirmTitle_yqlm2_1{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem;padding:.58667rem .58667rem .32rem}._confirmTitle_yqlm2_1 ._timer_yqlm2_8{color:#01C1B5}._addTitle_yqlm2_11,._calc_yqlm2_12{font-size:.42667rem;color:#666;line-height:.58667rem;padding:.32rem .58667rem 0}._addTitle_yqlm2_11 span,._calc_yqlm2_12 span{color:var(--van-primary)}._addTitle_yqlm2_11 .student,._calc_yqlm2_12 .student{margin:0}._studentList_yqlm2_26{max-height:45vh;overflow:auto}._btnGroup_yqlm2_30{padding:.37333rem .53333rem}\n' document.head.appendChild(__vite_style__) System.register( [ './title_timers-legacy.616e8b2e.js', './icon_name_active-legacy.e2b0189a.js', './icon_tips-legacy.b7861467.js', './index-legacy.fa4145a4.js', './index-legacy.595c24c3.js', './vendor-legacy.09f20d09.js', './index-legacy.637f35563.js', './index-legacy.f25f109a4.js', './index-legacy.f25f109a.js', './index-legacy.f25f109a6.js', './index-legacy.f25f109a11.js', './index-legacy.f25f109a7.js', './index-legacy.0bbb75e3.js', './browser-legacy.5a92c2a9.js', './icon_teacher-legacy.e765b7f7.js', './index-legacy.f72eae88.js', './organ-search-legacy.14a9ed93.js', './index-legacy.f25f109a13.js', './index-legacy.f25f109a14.js', './index-legacy.88d15645.js', './index-legacy.2d78ae68.js', './index-legacy.f25f109a8.js', './icon_timer2-legacy.b6c78faa.js', './index-legacy.9dfebfce.js', './index-legacy.f25f109a5.js', './index-legacy.f25f109a10.js', './index-legacy.f25f109a3.js', './icon_student-legacy.45be2fa9.js' ], function (exports) { 'use strict' var logo$1, __glob_11_0, __glob_11_1, __glob_11_4, __glob_11_5, __glob_11_6, __glob_11_7, __glob_11_8, __glob_11_10, __glob_11_11, __glob_11_13, __glob_11_14, __glob_11_15, __glob_11_16, __glob_11_17, __glob_11_18, __glob_11_19, __glob_11_2, __glob_11_3, __glob_11_9, __glob_11_12, ColHeader, postMessage, state, request, ColResult, formatterDate, defineComponent, createVNode, Fragment, createTextVNode, Cell, Toast, Icon, List, Checkbox, isVNode, Popup, Button, dayjs, Dialog, Row, Col, CellGroup, DatetimePicker, ActionSheet, Course, QRCode, html2canvas, iconLogo, IconAvator, ColSearch, OrganSearch, Student, useEventListener, useWindowScroll return { setters: [ function (module) { logo$1 = module.l __glob_11_0 = module._ __glob_11_1 = module.a __glob_11_4 = module.b __glob_11_5 = module.c __glob_11_6 = module.d __glob_11_7 = module.e __glob_11_8 = module.f __glob_11_10 = module.g __glob_11_11 = module.h __glob_11_13 = module.i __glob_11_14 = module.j __glob_11_15 = module.k __glob_11_16 = module.m __glob_11_17 = module.n __glob_11_18 = module.o __glob_11_19 = module.p }, function (module) { __glob_11_2 = module._ __glob_11_3 = module.a __glob_11_9 = module.b }, function (module) { __glob_11_12 = module._ }, function (module) { ColHeader = module.C }, function (module) { postMessage = module.p state = module.s request = module.r ColResult = module.C formatterDate = module.k }, function (module) { defineComponent = module.d createVNode = module.a Fragment = module.F createTextVNode = module.j Cell = module.C Toast = module.T Icon = module.K List = module.M Checkbox = module.a5 isVNode = module.x Popup = module.P Button = module.B dayjs = module.g Dialog = module.D Row = module.z Col = module.A CellGroup = module.y DatetimePicker = module.V ActionSheet = module.N }, function () {}, function () {}, function () {}, function () {}, function () {}, function () {}, function (module) { Course = module.C }, function (module) { QRCode = module.Q html2canvas = module.h iconLogo = module.i }, function (module) { IconAvator = module.I }, function (module) { ColSearch = module.C }, function (module) { OrganSearch = module.O }, function () {}, function () {}, function (module) { Student = module.S }, function (module) { useEventListener = module.u useWindowScroll = module.a }, function () {}, function () {}, function () {}, function () {}, function () {}, function () {}, function () {} ], execute: function execute() { var roomHeader = '_roomHeader_13gb6_1' var countTimer = '_countTimer_13gb6_9' var timer$1 = '_timer_13gb6_12' var title = '_title_13gb6_23' var chargeTimer = '_chargeTimer_13gb6_35' var studentList$2 = '_studentList_13gb6_45' var studentCount = '_studentCount_13gb6_51' var btnGroupInvite = '_btnGroupInvite_13gb6_56' var searchList = '_searchList_13gb6_77' var dataItem = '_dataItem_13gb6_82' var styles$3 = { roomHeader: roomHeader, countTimer: countTimer, timer: timer$1, title: title, chargeTimer: chargeTimer, studentList: studentList$2, studentCount: studentCount, btnGroupInvite: btnGroupInvite, searchList: searchList, dataItem: dataItem } var shareSection = '_shareSection_115rh_1' var img = '_img_115rh_8' var name = '_name_115rh_14' var titleTips = '_titleTips_115rh_24' var section = '_section_115rh_30' var txt = '_txt_115rh_36' var teacherName = '_teacherName_115rh_46' var download = '_download_115rh_49' var logo = '_logo_115rh_55' var qrcode = '_qrcode_115rh_65' var qrcodeCanvas = '_qrcodeCanvas_115rh_70' var qrcodeLogo = '_qrcodeLogo_115rh_74' var styles$2 = { shareSection: shareSection, img: img, name: name, titleTips: titleTips, section: section, txt: txt, teacherName: teacherName, download: download, logo: logo, qrcode: qrcode, qrcodeCanvas: qrcodeCanvas, qrcodeLogo: qrcodeLogo, continue: '_continue_115rh_84' } var Share = defineComponent({ name: 'share', props: { teacherId: { type: Number } }, data: function data() { return { qrCode: '', image: null } }, mounted: function mounted() { var _this = this this.qrCode = location.origin + '/student/#/inviteTeacher?id=' + this.teacherId var canvas = document.getElementById('canvas') QRCode.toCanvas( canvas, this.qrCode, { margin: 1 }, function (error) { if (error) console.log(error) console.log('success') } ) this.$nextTick( /*#__PURE__*/ _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var container return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch ((_context.prev = _context.next)) { case 0: container = document.getElementById( 'share-preview-container' ) html2canvas(container, { allowTaint: true, useCORS: true }).then(function (canvas) { var url = canvas.toDataURL('image/png') _this.image = url }) case 2: case 'end': return _context.stop() } } }, _callee) }) ) ) }, methods: { shareShow: function shareShow() { var _this2 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee2() { var image return regeneratorRuntime.wrap(function _callee2$( _context2 ) { while (1) { switch ((_context2.prev = _context2.next)) { case 0: image = _this2.image if (image) { postMessage( { api: 'shareAchievements', content: { title: '我在酷乐秀使用小酷Ai练习乐器', desc: '酷乐秀小酷Ai帮助我自主练习乐器,真的太好用啦!每天都要坚持练习哦~', image: image, video: '', type: 'image' } }, function (res) { if (res && res.content) { Toast( res.content.message || (res.content.status ? '分享成功' : '分享失败') ) } } ) } case 2: case 'end': return _context2.stop() } } }, _callee2) }) )() } }, render: function render() { var _this3 = this return createVNode(Fragment, null, [ createVNode( 'div', { class: styles$2.continue, onClick: function onClick() { _this3.shareShow() } }, [createTextVNode('\u5206\u4EAB')] ), createVNode( 'div', { class: styles$2.shareSection, id: 'share-preview-container' }, [ createVNode('div', { class: styles$2.section }, [ createVNode( Cell, { center: true, border: false, style: { padding: 0 } }, { icon: function icon() { return createVNode( 'img', { src: state.user.data.heardUrl ? state.user.data.heardUrl + '?time=' + new Date().valueOf() : IconAvator, class: styles$2.img, crossorigin: 'anonymous' }, null ) }, title: function title() { return createVNode('div', null, [ createVNode('p', { class: styles$2.name }, [ state.user.data.username ]), createVNode('p', { class: styles$2.titleTips }, [ createTextVNode( '\u9177\u4E50\u79C0\u5165\u9A7B\u8001\u5E08' ) ]) ]) } } ), createVNode( 'p', { class: [styles$2.txt, styles$2.teacherName] }, [ createVNode('span', null, [state.user.data.username]), createTextVNode( '\u9080\u8BF7\u60A8\u52A0\u5165\u9177\u4E50\u79C0' ) ] ), createVNode('p', { class: styles$2.txt }, [ createTextVNode( '\u6765\u4E0E\u6211\u4E00\u8D77\u8E0F\u5165\u97F3\u4E50\u6BBF\u5802\u5427\uFF01' ) ]) ]), createVNode( 'div', { class: [styles$2.section, styles$2.download] }, [ createVNode('div', { class: styles$2.logo }, [ createVNode('img', { src: logo$1 }, null), createVNode('p', null, [ createTextVNode( '\u626B\u7801\u4E0B\u8F7D\u9177\u4E50\u79C0\u5F00\u542F\u5B66\u4E60\u4E4B\u65C5' ) ]) ]), createVNode('div', { class: styles$2.qrcode }, [ createVNode( 'canvas', { id: 'canvas', class: styles$2.qrcodeCanvas }, null ), createVNode( 'img', { src: iconLogo, class: styles$2.qrcodeLogo }, null ) ]) ] ) ] ) ]) } }) var label = '_label_v8pn1_1' var studentList$1 = '_studentList_v8pn1_13' var btnGroup$1 = '_btnGroup_v8pn1_20' var styles$1 = { label: label, studentList: studentList$1, btnGroup: btnGroup$1 } function _isSlot$1(s) { return ( typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s)) ) } var StudentInfo = defineComponent({ name: 'myStudent', props: { courseId: Number, onSubmit: { type: Function, default: function _default(item) {} } }, data: function data() { return { searchStatus: false, openStatus: false, subjectList: [], list: [], dataShow: true, // 判断是否有数据 loading: false, finished: false, params: { userName: '', subjectName: '全部声部', subjectId: null, page: 1, rows: 20 }, interfaceIds: [], userIdList: [] } }, mounted: function mounted() { var _this4 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee3() { var res return regeneratorRuntime.wrap( function _callee3$(_context3) { while (1) { switch ((_context3.prev = _context3.next)) { case 0: _context3.prev = 0 _context3.next = 3 return request.get( '/api-teacher/subject/subjectSelect' ) case 3: res = _context3.sent _this4.subjectList = res.data || [] _context3.next = 9 break case 7: _context3.prev = 7 _context3.t0 = _context3['catch'](0) case 9: _context3.next = 11 return _this4.getExistList() case 11: _context3.next = 13 return _this4.getList() case 13: case 'end': return _context3.stop() } } }, _callee3, null, [[0, 7]] ) }) )() }, methods: { onSort: function onSort() { this.params.page = 1 this.list = [] this.dataShow = true // 判断是否有数据 this.loading = false this.finished = false this.searchStatus = false this.getList() }, onSearch: function onSearch(val) { this.params.userName = val this.onSort() }, getExistList: function getExistList() { var _this5 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee4() { var res, rows, userIdList return regeneratorRuntime.wrap( function _callee4$(_context4) { while (1) { switch ((_context4.prev = _context4.next)) { case 0: _context4.prev = 0 _context4.next = 3 return request.post( '/api-teacher/courseSchedule/selectStudent', { data: { courseId: _this5.courseId, page: 1, rows: 20 } } ) case 3: res = _context4.sent rows = res.data.rows || [] userIdList = rows.map(function (item) { return item.userId }) _this5.interfaceIds = _toConsumableArray(userIdList) _this5.userIdList = _toConsumableArray(userIdList) _context4.next = 12 break case 10: _context4.prev = 10 _context4.t0 = _context4['catch'](0) case 12: case 'end': return _context4.stop() } } }, _callee4, null, [[0, 10]] ) }) )() }, getList: function getList() { var _this6 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee5() { var res, result, rows return regeneratorRuntime.wrap( function _callee5$(_context5) { while (1) { switch ((_context5.prev = _context5.next)) { case 0: _context5.prev = 0 _context5.next = 3 return request.post( '/api-teacher/courseSchedule/selectStudent', { data: _this6.params } ) case 3: res = _context5.sent _this6.loading = false result = res.data || {} // 处理重复请求数据 if ( !(_this6.list.length > 0 && result.pageNo === 1) ) { _context5.next = 8 break } return _context5.abrupt('return') case 8: rows = result.rows || [] rows.forEach(function (n) { if (_this6.userIdList.includes(n.userId)) { n.checked = true } else { n.checked = false } }) _this6.list = _this6.list.concat(rows || []) _this6.finished = result.pageNo >= result.totalPage _this6.params.page = result.pageNo + 1 _this6.dataShow = _this6.list.length > 0 _context5.next = 20 break case 16: _context5.prev = 16 _context5.t0 = _context5['catch'](0) _this6.dataShow = false _this6.finished = true case 20: case 'end': return _context5.stop() } } }, _callee5, null, [[0, 16]] ) }) )() }, equar: function equar(a, b) { // 判断数组的长度 if (a.length !== b.length) { return false } else { // 循环遍历数组的值进行比较 for (var i = 0; i < a.length; i++) { if (a[i] !== b[i]) { return false } } return true } }, nextSubmit: function nextSubmit() { var _this7 = this if (this.userIdList.length <= 0) { return Toast('请至少选择一个学员') } if (this.equar(this.interfaceIds, this.userIdList)) { return Toast('您未调整学员') } var addStudentIds = this.userIdList.filter(function (item) { return !_this7.interfaceIds.includes(item) && item }) var removeStudentIds = this.interfaceIds.filter(function ( item ) { return !_this7.userIdList.includes(item) && item }) console.log(addStudentIds, removeStudentIds) var addStudents = [] var removeStudents = [] this.list.forEach(function (item) { if (addStudentIds.includes(item.userId)) { addStudents.push(item) } if (removeStudentIds.includes(item.userId)) { removeStudents.push(item) } }) console.log(addStudents, removeStudents) this.onSubmit({ addStudents: addStudents, removeStudents: removeStudents, userIdList: this.userIdList }) }, onCheckbox: function onCheckbox(item) { if (!item.checked && this.userIdList.length >= 7) { return Toast('学生已达上限') } item.checked = !item.checked var isExist = this.userIdList.includes(item.userId) if (item.checked) { !isExist && this.userIdList.push(item.userId) } else { isExist && this.userIdList.splice( this.userIdList.indexOf(item.userId), 1 ) } } }, render: function render() { var _this8 = this var _slot return createVNode(Fragment, null, [ createVNode( ColSearch, { placeholder: '请输入学员名称', onSearch: this.onSearch }, { left: function left() { return createVNode( 'div', { class: styles$1.label, onClick: function onClick() { _this8.searchStatus = !_this8.searchStatus _this8.openStatus = !_this8.openStatus } }, [ _this8.params.subjectName, createVNode( Icon, { classPrefix: 'iconfont', name: 'down', size: 12, color: '#333' }, null ) ] ) } } ), createVNode('div', { class: styles$1.studentList }, [ this.dataShow ? createVNode( List, { loading: this.loading, 'onUpdate:loading': function onUpdateLoading($event) { return (_this8.loading = $event) }, finished: this.finished, finishedText: ' ', class: ['mb12'], immediateCheck: false, onLoad: this.getList }, _isSlot$1( (_slot = this.list.map(function (item) { return createVNode( Student, { item: { userName: item.userName, subjectName: item.subjectName, avatar: item.avatar }, onClick: function onClick() { _this8.onCheckbox(item) } }, { default: function _default() { return [ createVNode( Checkbox, { modelValue: item.checked, 'onUpdate:modelValue': function onUpdateModelValue($event) { return (item.checked = $event) }, name: item.userId, onClick: function onClick() { _this8.onCheckbox(item) } }, null ) ] } } ) })) ) ? _slot : { default: function _default() { return [_slot] } } ) : createVNode( ColResult, { btnStatus: false, classImgSize: 'SMALL', tips: '暂无学员' }, null ) ]), createVNode( Popup, { show: this.searchStatus, position: 'bottom', round: true, closeable: true, 'safe-area-inset-bottom': true, onClose: function onClose() { return (_this8.searchStatus = false) }, onClosed: function onClosed() { return (_this8.openStatus = false) } }, { default: function _default() { return [ _this8.openStatus && createVNode( OrganSearch, { subjectList: _this8.subjectList, onSort: _this8.onSort, isReset: true, modelValue: _this8.params.subjectId, 'onUpdate:modelValue': function onUpdateModelValue($event) { return (_this8.params.subjectId = $event) }, subjectName: _this8.params.subjectName, 'onUpdate:subjectName': function onUpdateSubjectName($event) { return (_this8.params.subjectName = $event) } }, null ) ] } } ), createVNode('div', { class: styles$1.btnGroup }, [ createVNode( Button, { type: 'primary', round: true, block: true, onClick: this.nextSubmit }, { default: function _default() { return [createTextVNode('\u4E0B\u4E00\u6B65')] } } ) ]) ]) } }) var confirmTitle = '_confirmTitle_yqlm2_1' var timer = '_timer_yqlm2_8' var addTitle = '_addTitle_yqlm2_11' var calc = '_calc_yqlm2_12' var studentList = '_studentList_yqlm2_26' var btnGroup = '_btnGroup_yqlm2_30' var styles = { confirmTitle: confirmTitle, timer: timer, addTitle: addTitle, calc: calc, studentList: studentList, btnGroup: btnGroup } var StudentConfirm = defineComponent({ name: 'studentConfirm', props: { courseInfo: { type: Object, default: {} }, studentObject: { type: Object, default: {} }, onSubmit: { type: Function, default: function _default(item) {} } }, computed: { timer: function timer() { var item = this.courseInfo return ( dayjs(item.startTime).format('YYYY/MM/DD HH:mm') + ' ~ ' + dayjs(item.endTime).format('HH:mm') ) }, addStudents: function addStudents() { var addStudents = this.studentObject.addStudents return addStudents || [] }, removeStudents: function removeStudents() { var removeStudents = this.studentObject.removeStudents return removeStudents || [] }, calcTimer: function calcTimer() { var _this$studentObject = this.studentObject, addStudents = _this$studentObject.addStudents, removeStudents = _this$studentObject.removeStudents var _this$courseInfo = this.courseInfo, singleCourseTime = _this$courseInfo.singleCourseTime, studentCount = _this$courseInfo.studentCount var suffix = addStudents.length - removeStudents.length console.log(suffix, singleCourseTime, this.courseInfo) var type = suffix >= 0 ? 'add' : 'remove' console.log( addStudents, removeStudents, 'addStudents', suffix, type, studentCount ) // n * (n -1) * 分钟数 * 课次数 // 总分钟数 var allMinutes = studentCount * singleCourseTime // var reTime = Math.abs( Math.abs(suffix + studentCount) * singleCourseTime ) return { type: type, mins: Math.abs(allMinutes - reTime) } } }, render: function render() { var _this9 = this return createVNode('div', { class: styles.studentConfirm }, [ createVNode( 'div', { class: [styles.confirmTitle, 'van-hairline--bottom'] }, [ createVNode('p', null, [ createTextVNode('\u60A8\u5C06\u4E3A'), this.courseInfo.groupName ]), createVNode('p', { class: styles.timer }, [this.timer]) ] ), createVNode('div', { class: styles.studentList }, [ this.addStudents.length > 0 && createVNode(Fragment, null, [ createVNode('p', { class: styles.addTitle }, [ createTextVNode('\u6DFB\u52A0\u5B66\u5458 '), createVNode('span', null, [this.addStudents.length]), createTextVNode(' \u540D') ]), this.addStudents.map(function (item) { return createVNode( Student, { border: false, item: item }, null ) }) ]), this.removeStudents.length > 0 && createVNode(Fragment, null, [ createVNode('p', { class: styles.addTitle }, [ createTextVNode('\u79FB\u9664\u5B66\u5458 '), createVNode('span', null, [this.removeStudents.length]), createTextVNode(' \u540D') ]), this.removeStudents.map(function (item) { return createVNode( Student, { border: false, item: item }, null ) }) ]) ]), createVNode('p', { class: styles.calc }, [ createTextVNode('\u8C03\u6574\u540E\u5C06'), this.calcTimer.type === 'remove' ? '释放' : '冻结', ' ', createVNode('span', null, [this.calcTimer.mins]), createTextVNode(' \u5206\u949F') ]), createVNode('div', { class: styles.btnGroup }, [ createVNode( Button, { type: 'primary', round: true, block: true, onClick: function onClick() { var userIdList = _this9.studentObject.userIdList _this9.onSubmit(userIdList) } }, { default: function _default() { return [createTextVNode('\u786E\u8BA4\u8C03\u6574')] } } ) ]) ]) } }) function _isSlot(s) { return ( typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s)) ) } var getAssetsHomeFile = exports( 'getAssetsHomeFile', function (fileName) { var path = './images/'.concat(fileName) var modules = { './images/icon_arrow.png': __glob_11_0, './images/icon_class_plan.png': __glob_11_1, './images/icon_education.png': __glob_11_2, './images/icon_education_active.png': __glob_11_3, './images/icon_freeze_timer.png': __glob_11_4, './images/icon_invite_student.png': __glob_11_5, './images/icon_last_timer.png': __glob_11_6, './images/icon_message.png': __glob_11_7, './images/icon_music_account.png': __glob_11_8, './images/icon_name_active.png': __glob_11_9, './images/icon_num.png': __glob_11_10, './images/icon_timers.png': __glob_11_11, './images/icon_tips.png': __glob_11_12, './images/logo.png': __glob_11_13, './images/paino_bg.png': __glob_11_14, './images/room_bg.png': __glob_11_15, './images/select_timers.png': __glob_11_16, './images/select_timers_bg.png': __glob_11_17, './images/share_bg.png': __glob_11_18, './images/title_timers.png': __glob_11_19 } return modules[path].default } ) var index = exports( 'default', defineComponent({ name: 'PianoRoom', data: function data() { return { shareStatus: false, teacherId: 0, typeStatus: false, courseTxt: '所有课程', actions: [ { name: '所有课程' }, { name: '未开始', status: 'NOT_START' }, { name: '进行中', status: 'ING' }, { name: '已完成', status: 'COMPLETE' }, { name: '已取消', status: 'CANCEL' } ], remain: { frozenTime: 0, remainTime: 0, studentCount: 0 }, list: [], dataShow: true, // 判断是否有数据 loading: false, finished: false, monthTxt: dayjs().format('YYYY年MM月'), month: new Date(), params: { status: '', month: dayjs().format('YYYY-MM'), page: 1, rows: 20 }, timeShow: false, timeUpdateStatus: false, timeUpdateInfo: {}, timeUpdateTimer: new Date(), studentStatus: false, studentConfirm: false, studentChangeObject: {}, background: 'transparent', setLoading: false, startClassTime: '', endClassTime: '', minDate: new Date() } }, mounted: function mounted() { var _this10 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee6() { return regeneratorRuntime.wrap(function _callee6$( _context6 ) { while (1) { switch ((_context6.prev = _context6.next)) { case 0: _context6.next = 2 return _this10._init() case 2: _context6.next = 4 return _this10.getBaseData() case 4: _context6.next = 6 return _this10.getList() case 6: useEventListener( document, 'scroll', function (evt) { var _useWindowScroll = useWindowScroll(), y = _useWindowScroll.y if (y.value > 45) { _this10.background = '#fff' } else { _this10.background = 'transparent' } } ) case 7: case 'end': return _context6.stop() } } }, _callee6) }) )() }, methods: { _init: function _init() { var _this11 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee7() { var res, _ref2, frozenTime, remainTime, _studentCount, teacherId return regeneratorRuntime.wrap( function _callee7$(_context7) { while (1) { switch ((_context7.prev = _context7.next)) { case 0: _context7.prev = 0 _context7.next = 3 return request.get( '/api-teacher/courseSchedule/selectRemainTime' ) case 3: res = _context7.sent // console.log(res) ;(_ref2 = res.data || {}), (frozenTime = _ref2.frozenTime), (remainTime = _ref2.remainTime), (_studentCount = _ref2.studentCount), (teacherId = _ref2.teacherId) _this11.remain = { frozenTime: frozenTime || 0, remainTime: remainTime || 0, studentCount: _studentCount || 0 } _this11.teacherId = teacherId _context7.next = 11 break case 9: _context7.prev = 9 _context7.t0 = _context7['catch'](0) case 11: case 'end': return _context7.stop() } } }, _callee7, null, [[0, 9]] ) }) )() }, getBaseData: function getBaseData() { var _this12 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee8() { var result, tempResult, i, len return regeneratorRuntime.wrap( function _callee8$(_context8) { while (1) { switch ((_context8.prev = _context8.next)) { case 0: _context8.prev = 0 _context8.next = 3 return request.get( '/api-teacher/sysConfig/queryByParamNameList', { params: { paramNames: 'course_start_setting,course_end_setting' } } ) case 3: result = _context8.sent console.log(result) tempResult = result.data for ( i = 0, len = tempResult.length; i < len; i++ ) { if ( tempResult[i].paramName === 'course_start_setting' ) { _this12.startClassTime = tempResult[i] .paramValue ? tempResult[i].paramValue.split(':') : [] } if ( tempResult[i].paramName === 'course_end_setting' ) { _this12.endClassTime = tempResult[i] .paramValue ? tempResult[i].paramValue.split(':') : [] } } console.log( _this12.startClassTime, _this12.endClassTime ) _context8.next = 12 break case 10: _context8.prev = 10 _context8.t0 = _context8['catch'](0) case 12: case 'end': return _context8.stop() } } }, _callee8, null, [[0, 10]] ) }) )() }, onSearch: function onSearch() { this.dataShow = true this.loading = false this.finished = false this.list = [] this.params.page = 1 this.getList() }, onSelect: function onSelect(item) { this.courseTxt = item.name this.params.status = item.status || '' this._init() this.onSearch() }, getList: function getList() { var _this13 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee9() { var res, result return regeneratorRuntime.wrap( function _callee9$(_context9) { while (1) { switch ((_context9.prev = _context9.next)) { case 0: _context9.prev = 0 if (!_this13.setLoading) { _context9.next = 3 break } return _context9.abrupt('return') case 3: _this13.setLoading = true _context9.next = 6 return request.post( '/api-teacher/courseSchedule/selectCourseList', { data: _this13.params } ) case 6: res = _context9.sent _this13.setLoading = false _this13.loading = false result = res.data || {} // 处理重复请求数据 if ( !( _this13.list.length > 0 && result.pageNo === 1 ) ) { _context9.next = 12 break } return _context9.abrupt('return') case 12: _this13.list = _this13.list.concat( result.rows || [] ) _this13.finished = result.pageNo >= result.totalPage _this13.params.page = result.pageNo + 1 _this13.dataShow = _this13.list.length > 0 _context9.next = 22 break case 18: _context9.prev = 18 _context9.t0 = _context9['catch'](0) _this13.dataShow = false _this13.finished = true case 22: case 'end': return _context9.stop() } } }, _callee9, null, [[0, 18]] ) }) )() }, onCourseDelete: function onCourseDelete(item) { var _this14 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee11() { return regeneratorRuntime.wrap(function _callee11$( _context11 ) { while (1) { switch ((_context11.prev = _context11.next)) { case 0: try { Dialog.confirm({ title: '提示', message: '确定删除该课程吗?', confirmButtonColor: 'var(--van-primary)' }).then( /*#__PURE__*/ _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark( function _callee10() { return regeneratorRuntime.wrap( function _callee10$(_context10) { while (1) { switch ( (_context10.prev = _context10.next) ) { case 0: _context10.next = 2 return request.post( '/api-teacher/courseSchedule/deleteCourse', { data: { courseId: item.courseId } } ) case 2: console.log('删除成功') Toast('课程删除成功') _this14._init() _this14.onSearch() case 6: case 'end': return _context10.stop() } } }, _callee10 ) } ) ) ) } catch (_unused7) {} case 1: case 'end': return _context11.stop() } } }, _callee11) }) )() }, onTimeUpdateChange: function onTimeUpdateChange(item) { var _this15 = this try { Dialog.confirm({ title: '提示', message: '确定调整该课程吗?', confirmButtonColor: 'var(--van-primary)' }).then( /*#__PURE__*/ _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark( function _callee12() { var _this15$timeUpdateInf, courseId, singleCourseTime, startTime, endTime return regeneratorRuntime.wrap(function _callee12$( _context12 ) { while (1) { switch ((_context12.prev = _context12.next)) { case 0: ;(_this15$timeUpdateInf = _this15.timeUpdateInfo), (courseId = _this15$timeUpdateInf.courseId), (singleCourseTime = _this15$timeUpdateInf.singleCourseTime) startTime = dayjs(item).format( 'YYYY-MM-DD HH:mm:ss' ) endTime = dayjs(item) .add(singleCourseTime, 'minute') .format('YYYY-MM-DD HH:mm:ss') _context12.next = 5 return request.post( '/api-teacher/courseSchedule/updateCourseTime', { data: { courseId: courseId, startTime: startTime, endTime: endTime } } ) case 5: _this15.timeUpdateStatus = false Toast('课程调整成功') _this15.onSearch() case 8: case 'end': return _context12.stop() } } }, _callee12) } ) ) ) } catch (_unused8) {} }, onStudentChange: function onStudentChange(item) { var _this16 = this return _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee14() { var courseId return regeneratorRuntime.wrap( function _callee14$(_context14) { while (1) { switch ((_context14.prev = _context14.next)) { case 0: _context14.prev = 0 courseId = _this16.timeUpdateInfo.courseId _context14.next = 4 return request.post( '/api-teacher/courseSchedule/updateCourseStudent', { data: { studentIds: item, courseId: courseId } } ) case 4: _this16.studentConfirm = false Toast('学生调整成功') setTimeout( /*#__PURE__*/ _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark( function _callee13() { return regeneratorRuntime.wrap( function _callee13$(_context13) { while (1) { switch ( (_context13.prev = _context13.next) ) { case 0: _context13.next = 2 return _this16._init() case 2: _this16.onSearch() case 3: case 'end': return _context13.stop() } } }, _callee13 ) } ) ), 1000 ) _context14.next = 11 break case 9: _context14.prev = 9 _context14.t0 = _context14['catch'](0) case 11: case 'end': return _context14.stop() } } }, _callee14, null, [[0, 9]] ) }) )() }, onTeacherAuth: function onTeacherAuth(callBack) { // 是否达人认证 // 老师入驻状态 0、未申请 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过,可用值:UNPAALY,DOING,PASS,UNPASS var data = state.user.data if (data.entryStatus === 'PASS') { callBack && callBack() } else if (data.entryStatus === 'DOING') { Toast('认证审核中,请稍后再试') } else { this.$router.push('/teacherCert') } }, filterDate: function filterDate(type, options) { var _this17 = this var value = 0 if (this.$refs.datetime) { var _picker$getValues$ var picker = this.$refs.datetime.getPicker() value = ((_picker$getValues$ = picker.getValues()[3]) === null || _picker$getValues$ === void 0 ? void 0 : _picker$getValues$.split('时')[0]) || 0 } if (type == 'hour') { return options.filter(function (option) { return ( Number(_this17.startClassTime[0]) <= Number(option) && Number(_this17.endClassTime[0]) >= Number(option) ) }) } if (type === 'minute') { return options.filter(function (option) { return ( (Number(_this17.startClassTime[1]) <= Number(option) && Number(_this17.endClassTime[1]) >= Number(option)) || value != Number(_this17.endClassTime[0]) ) }) } return options } }, render: function render() { var _this18 = this var _slot return createVNode(Fragment, null, [ createVNode('div', { class: styles$3.roomHeader }, [ createVNode( ColHeader, { background: this.background, rightText: '课程记录', onClickRight: function onClickRight() { _this18.$router.push('/courseRecord') }, border: false }, null ), createVNode( Row, { class: styles$3.countTimer }, { default: function _default() { return [ createVNode( Col, { span: 9 }, { default: function _default() { return [ createVNode( 'p', { class: styles$3.timer }, [ _this18.remain.remainTime, createVNode('span', null, [ createTextVNode('\u5206\u949F') ]) ] ), createVNode( 'p', { class: styles$3.title }, [ createVNode( 'img', { src: getAssetsHomeFile( 'icon_last_timer.png' ) }, null ), createVNode('span', null, [ createTextVNode( '\u7434\u623F\u5269\u4F59\u65F6\u957F' ) ]) ] ) ] } } ), createVNode( Col, { span: 9 }, { default: function _default() { return [ createVNode( 'p', { class: styles$3.timer }, [ _this18.remain.frozenTime, createVNode('span', null, [ createTextVNode('\u5206\u949F') ]) ] ), createVNode( 'p', { class: styles$3.title }, [ createVNode( 'img', { src: getAssetsHomeFile( 'icon_freeze_timer.png' ) }, null ), createVNode('span', null, [ createTextVNode( '\u51BB\u7ED3\u65F6\u957F' ) ]) ] ) ] } } ), createVNode( Col, { span: 6 }, { default: function _default() { return [ createVNode( Button, { type: 'primary', round: true, size: 'small', class: styles$3.chargeTimer, onClick: function onClick() { _this18.onTeacherAuth(function () { _this18.$router.push({ path: '/accountRechargeTimer' }) }) } }, { default: function _default() { return [ createTextVNode( '\u65F6\u957F\u5145\u503C' ), createVNode( 'img', { src: getAssetsHomeFile( 'icon_arrow.png' ) }, null ) ] } } ) ] } } ) ] } } ), createVNode( CellGroup, { class: styles$3.studentList, border: false }, { default: function _default() { return [ createVNode( Cell, { title: '\u6211\u7684\u5B66\u5458 '.concat( _this18.remain.studentCount, ' \u4EBA' ), titleClass: styles$3.studentCount, isLink: true, to: '/myStudent', border: false }, null ), createVNode( Cell, { valueClass: styles$3.btnGroupInvite }, { default: function _default() { return [ createVNode( Button, { color: '#E0F7F3', round: true, block: true, onClick: function onClick() { _this18.onTeacherAuth(function () { _this18.shareStatus = true }) } }, { default: function _default() { return [ createVNode( 'img', { src: getAssetsHomeFile( 'icon_invite_student.png' ) }, null ), createTextVNode( '\u9080\u8BF7\u5B66\u5458' ) ] } } ), createVNode( Button, { color: '#E0F7F3', round: true, block: true, onClick: function onClick() { _this18.onTeacherAuth(function () { _this18.$router.push( '/classArrangement' ) }) } }, { default: function _default() { return [ createVNode( 'img', { src: getAssetsHomeFile( 'icon_class_plan.png' ) }, null ), createTextVNode('\u6392\u8BFE') ] } } ) ] } } ) ] } } ) ]), createVNode('div', { class: styles$3.searchList }, [ createVNode( 'div', { class: styles$3.dataItem, onClick: function onClick() { _this18.timeShow = true } }, [ this.monthTxt, createVNode( Icon, { classPrefix: 'iconfont', name: 'down', size: 8, style: { marginLeft: '4px' }, color: '#CCCCCC' }, null ) ] ), createVNode( 'div', { class: styles$3.dataItem, onClick: function onClick() { _this18.typeStatus = true } }, [ this.courseTxt, createVNode( Icon, { classPrefix: 'iconfont', name: 'down', size: 8, style: { marginLeft: '4px' }, color: '#CCCCCC' }, null ) ] ) ]), this.dataShow ? createVNode( List, { loading: this.loading, 'onUpdate:loading': function onUpdateLoading($event) { return (_this18.loading = $event) }, finished: this.finished, finishedText: ' ', class: [styles$3.liveList, 'mb12'], immediateCheck: false, onLoad: this.getList }, _isSlot( (_slot = this.list.map(function (item) { return createVNode( Course, { item: item, operation: item.status === 'NOT_START' ? true : false, onCourseDelete: _this18.onCourseDelete, onStudentAdjust: function onStudentAdjust( item ) { _this18.timeUpdateInfo = item _this18.studentStatus = true }, onTimeAdjust: function onTimeAdjust(item) { _this18.timeUpdateInfo = item _this18.timeUpdateTimer = dayjs( item.startTime ).toDate() _this18.timeUpdateStatus = true } }, null ) })) ) ? _slot : { default: function _default() { return [_slot] } } ) : createVNode( ColResult, { btnStatus: false, classImgSize: 'SMALL', tips: '暂无课程' }, null ), createVNode( Popup, { position: 'bottom', show: this.timeShow, 'onUpdate:show': function onUpdateShow($event) { return (_this18.timeShow = $event) }, round: true }, { default: function _default() { return [ createVNode('div', { class: styles$3.picker }, [ createVNode( DatetimePicker, { modelValue: _this18.month, 'onUpdate:modelValue': function onUpdateModelValue($event) { return (_this18.month = $event) }, type: 'year-month', formatter: formatterDate, onConfirm: function onConfirm(item) { _this18.monthTxt = dayjs(item).format('YYYY年MM月') _this18.params.month = dayjs(item).format('YYYY-MM') _this18.timeShow = false _this18.onSearch() }, onCancel: function onCancel() { return (_this18.timeShow = false) } }, null ) ]) ] } } ), createVNode( Popup, { position: 'bottom', show: this.timeUpdateStatus, 'onUpdate:show': function onUpdateShow($event) { return (_this18.timeUpdateStatus = $event) }, round: true }, { default: function _default() { return [ createVNode('div', { class: styles$3.picker }, [ createVNode( DatetimePicker, { modelValue: _this18.timeUpdateTimer, 'onUpdate:modelValue': function onUpdateModelValue($event) { return (_this18.timeUpdateTimer = $event) }, type: 'datetime', minDate: _this18.minDate, formatter: formatterDate, filter: _this18.filterDate, ref: 'datetime', onConfirm: function onConfirm(item) { _this18.onTimeUpdateChange(item) }, onCancel: function onCancel() { return (_this18.timeUpdateStatus = false) } }, null ) ]) ] } } ), createVNode( ActionSheet, { show: this.typeStatus, 'onUpdate:show': function onUpdateShow($event) { return (_this18.typeStatus = $event) }, actions: this.actions, closeOnClickAction: true, cancelText: '取消', onSelect: this.onSelect, onCancel: function onCancel() { _this18.typeStatus = false } }, null ), createVNode( Popup, { show: this.shareStatus, 'onUpdate:show': function onUpdateShow($event) { return (_this18.shareStatus = $event) }, round: true }, { default: function _default() { return [ createVNode( Share, { teacherId: _this18.teacherId }, null ) ] } } ), createVNode( Popup, { show: this.studentStatus, 'onUpdate:show': function onUpdateShow($event) { return (_this18.studentStatus = $event) }, position: 'bottom', round: true }, { default: function _default() { return [ _this18.studentStatus && createVNode( StudentInfo, { courseId: _this18.timeUpdateInfo.courseId, onSubmit: function onSubmit(item) { _this18.studentChangeObject = item _this18.studentStatus = false _this18.studentConfirm = true } }, null ) ] } } ), createVNode( Popup, { show: this.studentConfirm, 'onUpdate:show': function onUpdateShow($event) { return (_this18.studentConfirm = $event) }, position: 'bottom', round: true, closeable: true }, { default: function _default() { return [ createVNode( StudentConfirm, { courseInfo: _this18.timeUpdateInfo, studentObject: _this18.studentChangeObject, onSubmit: (function () { var _onSubmit = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark( function _callee15(item) { return regeneratorRuntime.wrap( function _callee15$(_context15) { while (1) { switch ( (_context15.prev = _context15.next) ) { case 0: _context15.next = 2 return _this18.onStudentChange( item ) case 2: case 'end': return _context15.stop() } } }, _callee15 ) } ) ) function onSubmit(_x) { return _onSubmit.apply(this, arguments) } return onSubmit })() }, null ) ] } } ) ]) } }) ) } } } ) })()