trainStatistics.9ca09eb5.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["trainStatistics"],{"0781":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAk1BMVEUAAAAAwbQBwbUBwrUCwrYBwbUAwrYAzbMBwrUBwbUBwrUCwbUCwrUAwbUAwrYAwrYBwbYBwrUBwbUBwrYBwbUAwrYAwrUAwbYAwLQAvrgAv68BwrYBwrUCwrUAwrUAwrYAw7cAw7cAw7gAwbUAw7kBwrYBwbUCwrcAwbUAw7cAwbYAwbUAwLMAxbcBwbYCwbQBwbVBksG5AAAAMHRSTlMAEfvtmdluBPbp4Z+SfGhP9PDPzckvKR4bCgixrad1Yl1LRSMYwLqJgnFXPjo20aSMH9xxAAABIklEQVQoz3WS13KDMBQFhSimOQEbbOMa957s/39dhC0GEZF90RntiFsG0TC7LuJQukW6HQiLaSJpiL/+2iDEpJiacuChGA3v+0N5+8mB6GHo2vpboXFSCfmk/TKwrETLLgffaVoOlRUdniGkOifgV6LLBuT+/ViCrmtQgNdUHguLT3BfYQFDW88zKOvgw0PYnOC1vAymPTqBdX1KcHp0qmvmMOnRKwjqcwSfPXqsrz3wbHsAZnrCqLL0Gr7fE0Y9gzsuXN/xA7LSbiye65/BV7k7+oV6KZoyg+huLDQBXKfdvwRWevpqE1Mzav3OReF7w/V5EaI4dv3+hIEb1P0yNpa9O0oto7O6trw43C5ekgbPgcraFyrbtH4i/mfjLruvbX4BnUcqUEVerZEAAAAASUVORK5CYII="},"088a":function(t,e,a){"use strict";var n=a("1221"),r=a.n(n);r.a},"09c7":function(t,e,a){"use strict";var n=a("5872"),r=a.n(n);r.a},1221:function(t,e,a){},"497d":function(t,e,a){"use strict";var n=a("d363"),r=a.n(n);r.a},5872:function(t,e,a){},7421:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"visitList"},[n("van-sticky",[t.headerStatus?n("m-header",{attrs:{isFixed:!1}}):t._e(),n("van-tabs",{staticClass:"van-hairline--bottom",attrs:{"title-active-color":"#000000","title-inactive-color":"#808080",color:"#01C1B5"},on:{change:t.tabChange},model:{value:t.active,callback:function(e){t.active=e},expression:"active"}},[n("van-tab",{attrs:{title:"全部学员",name:"all"}},[n("train-model",{ref:"trainModel1",attrs:{active:t.active,defaultTime:0},on:{onLoad:t.onLoad}})],1),n("van-tab",{attrs:{title:"待回访学员",name:"visited"}},[n("train-model",{ref:"trainModel2",attrs:{active:t.active,defaultTime:-1},on:{onLoad:t.onLoad}})],1)],1)],1),t.dataShow?n("van-list",{attrs:{finished:t.finished,"finished-text":"- 没有更多了 -","immediate-check":!1},on:{load:t.getList},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.list,function(e,r){return n("van-cell-group",{key:r,staticClass:"data-content",attrs:{border:!1},on:{click:function(a){return t.onHref(e)}}},[n("van-cell",{staticStyle:{padding:"16px 12px"},attrs:{center:!0},scopedSlots:t._u([{key:"title",fn:function(){return[n("div",{staticClass:"teacher_info"},[e.avatar?n("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):n("img",{staticClass:"logo",attrs:{src:a("a7ed"),alt:""}}),n("p",{staticStyle:{color:"#1a1a1a","font-size":".14rem"}},[t._v(t._s(e.username))])])]},proxy:!0}],null,!0)},[n("p",{staticStyle:{"font-size":"14px",color:"#333","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}},[t._v(t._s(e.musicGroupName))])]),n("van-cell",{staticStyle:{padding:"12px 12px 16px"},attrs:{"is-link":"",clickable:!1,center:""},scopedSlots:t._u([{key:"title",fn:function(){return[n("van-grid",{attrs:{border:!1,"column-num":"4",clickable:!0}},[n("van-grid-item",{attrs:{text:"训练时长"},scopedSlots:t._u([{key:"icon",fn:function(){return[t._v(t._s(e.totalPlayTime)+"分钟")]},proxy:!0}],null,!0)}),n("van-grid-item",{attrs:{text:"训练次数"},scopedSlots:t._u([{key:"icon",fn:function(){return[n("span",{staticStyle:{color:"#01C1B5"}},[t._v(t._s(e.trainNum)+"次")])]},proxy:!0}],null,!0)}),n("van-grid-item",{attrs:{text:"训练天数"},scopedSlots:t._u([{key:"icon",fn:function(){return[n("span",{staticStyle:{color:"#FF802C"}},[t._v(t._s(e.trainDay)+"天")])]},proxy:!0}],null,!0)}),n("van-grid-item",{attrs:{text:"评测次数"},scopedSlots:t._u([{key:"icon",fn:function(){return[n("span",{staticStyle:{color:"#F79C00"}},[t._v(t._s(e.recordNum)+"次")])]},proxy:!0}],null,!0)})],1)]},proxy:!0}],null,!0)})],1)}),1):n("m-empty",{attrs:{msg:"暂无训练统计"}})],1)},r=[],i=a("a34a"),s=a.n(i),o=a("6e6e"),c=a("d678"),l=a("5a0c"),u=a.n(l),d=a("ff51"),h=a("1576"),f=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"trainModel"},[a("div",{directives:[{name:"show",rawName:"v-show",value:"visited"==t.activeType,expression:"activeType == 'visited'"}],staticClass:"visit-tips"},[t._m(0)]),a("search",{attrs:{placeholder:"学生姓名或手机号"},on:{onSearch:t.onSearch},scopedSlots:t._u([{key:"left",fn:function(){return[a("van-dropdown-menu",{staticStyle:{"padding-right":".1rem"},attrs:{"close-on-click-outside":!1,"active-color":"#01C1B5"}},[a("van-dropdown-item",{ref:"item",staticClass:"visitTime",attrs:{title:"筛选"}},[a("van-cell",{attrs:{title:"日期","is-link":"","title-style":"font-size: .14rem;",value:t.calendarValue,"value-class":"calendarColor"},on:{click:function(e){t.showCalendar=!0}}})],1)],1)]},proxy:!0}])}),a("van-row",{staticClass:"searchArray"},[a("van-col",{staticClass:"title-style",attrs:{span:"6"},on:{click:function(e){return t.onSort(0)}}},[t._v("\n 训练时长\n "),a("div",[a("i",{staticClass:"box box-up",class:{active:"ASC"==t.searchArray[0]},staticStyle:{"margin-bottom":".03rem"}}),a("i",{staticClass:"box box-down",class:{active:"DESC"==t.searchArray[0]}})])]),a("van-col",{staticClass:"title-style",attrs:{span:"6"},on:{click:function(e){return t.onSort(1)}}},[t._v("\n 训练次数\n "),a("div",[a("i",{staticClass:"box box-up",class:{active:"ASC"==t.searchArray[1]},staticStyle:{"margin-bottom":".03rem"}}),a("i",{staticClass:"box box-down",class:{active:"DESC"==t.searchArray[1]}})])]),a("van-col",{staticClass:"title-style",attrs:{span:"6"},on:{click:function(e){return t.onSort(2)}}},[t._v("\n 训练天数\n "),a("div",[a("i",{staticClass:"box box-up",class:{active:"ASC"==t.searchArray[2]},staticStyle:{"margin-bottom":".03rem"}}),a("i",{staticClass:"box box-down",class:{active:"DESC"==t.searchArray[2]}})])]),a("van-col",{staticClass:"title-style",attrs:{span:"6"},on:{click:function(e){return t.onSort(3)}}},[t._v("\n 评测次数\n "),a("div",[a("i",{staticClass:"box box-up",class:{active:"ASC"==t.searchArray[3]},staticStyle:{"margin-bottom":".03rem"}}),a("i",{staticClass:"box box-down",class:{active:"DESC"==t.searchArray[3]}})])])],1),a("van-calendar",{attrs:{minDate:t.minDate,"default-date":t.defaultDate,"first-day-of-week":1,formatter:t.formatterDay,color:"#01C1B5",type:"range","get-container":"body"},on:{select:t.selectDate,confirm:t.onConfirm,close:t.onClose},model:{value:t.showCalendar,callback:function(e){t.showCalendar=e},expression:"showCalendar"}})],1)},v=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",[t._v("上周训练时长不足80分钟或训练次数小于4次的学员"),a("br"),t._v("\n 需在每周三24:00前完成回访")])}],p=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"search"},[t._t("left"),a("van-search",{attrs:{placeholder:t.placeholder,"left-icon":t.leftIcon,"show-action":""},on:{search:t.onSearch},model:{value:t.searchValue,callback:function(e){t.searchValue=e},expression:"searchValue"}},[a("template",{slot:"action"},[a("span",{staticClass:"search_btn",on:{click:t.onSearch}},[t._v("搜索")])])],2)],2)},m=[],y={props:{placeholder:{type:String,default:"请输入搜索关键词"}},data:function(){return{leftIcon:a("0781"),searchValue:""}},methods:{onSearch:function(){this.$emit("onSearch",this.searchValue)}}},w=y,b=(a("09c7"),a("2877")),A=Object(b["a"])(w,p,m,!1,null,"0d660384",null),g=A.exports;function S(t,e){return x(t)||C(t,e)||D()}function D(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function C(t,e){var a=[],n=!0,r=!1,i=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done);n=!0)if(a.push(s.value),e&&a.length===e)break}catch(c){r=!0,i=c}finally{try{n||null==o["return"]||o["return"]()}finally{if(r)throw i}}return a}function x(t){if(Array.isArray(t))return t}function Y(t,e,a,n,r,i,s){try{var o=t[i](s),c=o.value}catch(l){return void a(l)}o.done?e(c):Promise.resolve(c).then(n,r)}function M(t){return function(){var e=this,a=arguments;return new Promise(function(n,r){var i=t.apply(e,a);function s(t){Y(i,n,r,s,o,"next",t)}function o(t){Y(i,n,r,s,o,"throw",t)}s(void 0)})}}var k={props:{active:{type:String,default:"all"},defaultTime:{type:Number,default:0}},components:{Search:g},data:function(){return{showCalendar:!1,minDate:new Date(2e3,0,1),defaultDate:[],startDay:null,endDay:null,search:null,searchArray:[null,null,null,null],searchType:{totalPlayTime:null,trainNum:null,trainDay:null,recordNum:null}}},mounted:function(){var t=M(s.a.mark(function t(){var e,a,n,r;return s.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:e=this.defaultTime,a=7*e,n=new Date,r=new Date,a>0?(n=Object(d["e"])(u()().add(a,"day").format("YYYY-MM-DD")),r=Object(d["f"])(u()().add(a,"day").format("YYYY-MM-DD"))):(n=Object(d["e"])(u()().subtract(Math.abs(a),"day").format("YYYY-MM-DD")),r=Object(d["f"])(u()().subtract(Math.abs(a),"day").format("YYYY-MM-DD"))),this.defaultDate=[new Date(n),new Date(r)],this.startDay=n,this.endDay=r,this.onSort();case 8:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),computed:{calendarValue:function(){return"".concat(u()(this.startDay).format("YYYY/MM/DD")," - ").concat(u()(this.endDay).format("YYYY/MM/DD"))},activeType:function(){return this.active}},methods:{onSort:function(t){var e=this.searchArray;e.forEach(function(a,n){n!=t&&(e[n]=null)}),"ASC"==e[t]?e[t]="DESC":"DESC"==e[t]?e[t]=null:e[t]="ASC",this.$forceUpdate(),this.onAllFilter()},onSearch:function(t){this.search=t,this.onAllFilter()},onAllFilter:function(){var t=this.searchArray,e=null,a=null;t.forEach(function(t,n){t&&(e=n,a=t)});var n=["totalPlayTime","trainNum","trainDay","recordNum"],r={search:this.search,startTime:this.startDay,endTime:this.endDay,page:1,sort:n[e],order:a};this.$listeners.onLoad(r)},changeDropDownItemStatus:function(){this.$refs.item.toggle(!1)},selectDate:function(t){var e=S(t,2),a=e[0],n=e[1];if(a){var r=u()(a).get("day");a=0===r?u()(a).subtract(6,"day"):u()(a).subtract(r-1,"day")}if(a){var i=7-u()(a).get("day");i<7&&(n=u()(a).add(i,"day"))}this.defaultDate=[new Date(a.valueOf()),new Date(n.valueOf())]},onConfirm:function(t){var e=S(t,2),a=e[0],n=e[1];if(this.showCalendar=!1,a){var r=u()(a).get("day");a=0===r?u()(a).subtract(6,"day"):u()(a).subtract(r-1,"day")}if(n){var i=7-u()(n).get("day");i<7&&(n=u()(n).add(i,"day"))}this.startDay=u()(a).format("YYYY-MM-DD"),this.endDay=u()(n).format("YYYY-MM-DD"),this.changeDropDownItemStatus(),this.onAllFilter()},onClose:function(){this.defaultDate=[new Date(this.startDay),new Date(this.endDay)]},formatterDay:function(t){var e=t.date.getMonth()+1,a=t.date.getDate(),n=new Date;return e==n.getMonth()+1&&a==n.getDate()&&(t.text="今天"),t}}},O=k,_=(a("497d"),Object(b["a"])(O,f,v,!1,null,"8ca81962",null)),B=_.exports;function E(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,n)}return a}function U(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?E(a,!0).forEach(function(e){L(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):E(a).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function L(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function P(t,e,a,n,r,i,s){try{var o=t[i](s),c=o.value}catch(l){return void a(l)}o.done?e(c):Promise.resolve(c).then(n,r)}function T(t){return function(){var e=this,a=arguments;return new Promise(function(n,r){var i=t.apply(e,a);function s(t){P(i,n,r,s,o,"next",t)}function o(t){P(i,n,r,s,o,"throw",t)}s(void 0)})}}var j={components:{MHeader:o["a"],MEmpty:c["a"],trainModel:B},data:function(){var t=sessionStorage.getItem("trainTab");return sessionStorage.removeItem("trainTab"),{headerStatus:!0,active:t||"all",list:[],loading:!1,finished:!1,params:{page:1,rows:20},dataShow:!0,formatEndTime:null,formatStartTime:null}},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),(Object(d["b"])().android||Object(d["b"])().iPhone)&&(this.headerStatus=!1),document.title="训练统计"},methods:{onLoad:function(t){this.params=Object.assign(this.params,t),this.onResetList()},tabChange:function(){this.$refs.trainModel1&&this.$refs.trainModel1.changeDropDownItemStatus(),this.$refs.trainModel2&&this.$refs.trainModel2.changeDropDownItemStatus(),"visited"==this.active&&this.$refs.trainModel2?this.$refs.trainModel2.onAllFilter():"all"==this.active&&this.$refs.trainModel1&&this.$refs.trainModel1.onAllFilter()},search:function(t){this.params.search=t,this.onResetList()},onResetList:function(){this.list=[],this.params.page=1,this.dataShow=!0,this.loading=!0,this.finished=!1,this.getList()},onHref:function(t){sessionStorage.setItem("trainTab",this.active),this.$router.push({path:"/trainDetail",query:{userId:t.userId,username:t.username,phone:t.phone,musicGroupName:t.musicGroupName,avatar:t.avatar,visitFlag:t.visitFlag}})},getList:function(){var t=T(s.a.mark(function t(){var e,a,n,r;return s.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return e=this.params,a="all"!=this.active?1:null,t.prev=2,t.next=5,Object(h["a"])(U({},e,{visitFlag:a}));case 5:n=t.sent,r=n.data,this.loading=!1,e.page=r.pageNo,this.list=this.list.concat(r.rows),e.page>=r.totalPage&&(this.finished=!0),this.params.page++,this.list.length<=0&&(this.dataShow=!1),t.next=19;break;case 15:t.prev=15,t.t0=t["catch"](2),this.finished=!0,this.dataShow=!1;case 19:case"end":return t.stop()}},t,this,[[2,15]])}));function e(){return t.apply(this,arguments)}return e}()}},I=j,F=(a("088a"),Object(b["a"])(I,n,r,!1,null,"206ca392",null));e["default"]=F.exports},d363:function(t,e,a){}}]);