班级头像

parent a7443e9f
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=never><link rel=stylesheet href=https:////at.alicdn.com/t/font_746649_x1rivf5f5.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/theme-chalk/index.css><title>唱唱启蒙-后台</title></head><body><script src=https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js></script><script src=https://cdn.jsdelivr.net/npm/vuex@3.0.1/dist/vuex.min.js></script><script src=https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js></script><script src=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/index.js></script><div id=app></div><script type=text/javascript src=/static/js/manifest.301383eaa5f2694ddbb1.js></script><script type=text/javascript src=/static/js/vendor.520caa645c172051b099.js></script><script type=text/javascript src=/static/js/app.93f38d3d6ddf78553e45.js></script></body><script>let el = document.getElementsByTagName("script");
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=never><link rel=stylesheet href=https:////at.alicdn.com/t/font_746649_x1rivf5f5.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/theme-chalk/index.css><title>唱唱启蒙-后台</title></head><body><script src=https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js></script><script src=https://cdn.jsdelivr.net/npm/vuex@3.0.1/dist/vuex.min.js></script><script src=https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js></script><script src=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/index.js></script><div id=app></div><script type=text/javascript src=/static/js/manifest.b8da6a56a73a570e1358.js></script><script type=text/javascript src=/static/js/vendor.520caa645c172051b099.js></script><script type=text/javascript src=/static/js/app.93f38d3d6ddf78553e45.js></script></body><script>let el = document.getElementsByTagName("script");
el.onerror = function(a,b,c){
console.log('error:',a,b,c);
};
......
webpackJsonp([16],{"1/HN":function(e,t,n){(e.exports=n("FZ+f")(!0)).push([e.i,"\n.demo-table-expand {\n font-size: 0;\n}\n.demo-table-expand label {\n width: 90px;\n color: #99a9bf;\n}\n.demo-table-expand .el-form-item {\n margin-right: 0;\n margin-bottom: 0;\n width: 50%;\n}\n\n","",{version:3,sources:["C:/Users/Administrator/Desktop/后台/admin/src/components/class/index.vue"],names:[],mappings:";AACA;EACE,aAAa;CACd;AACD;EACE,YAAY;EACZ,eAAe;CAChB;AACD;EACE,gBAAgB;EAChB,iBAAiB;EACjB,WAAW;CACZ",file:"index.vue",sourcesContent:["\n.demo-table-expand {\n font-size: 0;\n}\n.demo-table-expand label {\n width: 90px;\n color: #99a9bf;\n}\n.demo-table-expand .el-form-item {\n margin-right: 0;\n margin-bottom: 0;\n width: 50%;\n}\n\n"],sourceRoot:""}])},BenM:function(e,t,n){(e.exports=n("FZ+f")(!0)).push([e.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","",{version:3,sources:[],names:[],mappings:"",file:"dialog.vue",sourceRoot:""}])},JP4Q:function(e,t,n){var i=n("BenM");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);n("rjj0")("486a2a46",i,!1,{})},NzM9:function(e,t,n){(e.exports=n("FZ+f")(!0)).push([e.i,"\n.class[data-v-426dc2ae] {\n padding: 20px 0;\n}\n.intro .el-form-item[data-v-426dc2ae] {\n margin-bottom: 0;\n}\n.avatar[data-v-426dc2ae] {\n width: 100px;\n}\n","",{version:3,sources:["C:/Users/Administrator/Desktop/后台/admin/src/components/class/index.vue"],names:[],mappings:";AACA;EACE,gBAAgB;CACjB;AACD;EACE,iBAAiB;CAClB;AACD;EACE,aAAa;CACd",file:"index.vue",sourcesContent:["\n.class[data-v-426dc2ae] {\n padding: 20px 0;\n}\n.intro .el-form-item[data-v-426dc2ae] {\n margin-bottom: 0;\n}\n.avatar[data-v-426dc2ae] {\n width: 100px;\n}\n"],sourceRoot:""}])},OX9A:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("CCn6"),o=n("g5CC"),s=n("+TkF"),a=n("0qGg"),r=n("kmJW"),l={data:function(){return{nowPage:1,total:0,limit:10,periodsId:null,goods_id:null,goodsList:[],teacher_id:"",classList:[],title:"",countObj:"",teacherList:[],userObj:{classId:"",title:"",show:!1,goods_id:null},dialogObj:{show:!1,title:"添加班级",periodsId:"",type:0,id:0},selectedGoods:[]}},components:{UserList:a.a,classDialog:o.a,page:r.a},filters:{classTypeFilter:function(e){var t=parseInt(e);return 1===t?"带班班级":2===t?"观摩班级":""},classSourceFilter:function(e){return s.f[e]},percent:function(e){return(100*e).toFixed(2)+"%"}},mounted:function(){this.initPage()},methods:{changeRow:function(e,t){t.indexOf(e)>-1&&Object(i._30)(e.periods_id,e.id).then(function(t){e.arrive_course_rate=t.arrive_course_rate,e.watch_course_rate=t.watch_course_rate,e.over_course_rate=t.over_course_rate,e.work_rate=t.work_rate,e.over_work_rate=t.over_work_rate,e.clock_rate=t.clock_rate,e.over_clock_rate=t.over_clock_rate,e.transform_rate=t.transform_rate})},initQuery:function(){var e=this,t=this.$route.query;t&&t.goods_id&&t.periods_id?(this.goods_id=t.goods_id,this.selectedGoods=[parseInt(t.goods_id),parseInt(t.periods_id)],Object(i._53)({goods_id:this.selectedGoods[0]}).then(function(t){t.list.forEach(function(e){e.name=e.title}),e.goodsList.find(function(t){return t.id===e.selectedGoods[0]}).children=t.list;var n=e.goodsList.find(function(t){return t.id===e.selectedGoods[0]});e.periods=n.children.find(function(t){return t.id===e.selectedGoods[1]}),e.teacher_id="",e.getClassList()})):Object(i._35)().then(function(t){t&&(e.goods_id=t.goods_id,e.selectedGoods=[parseInt(t.goods_id),parseInt(t.id)],Object(i._53)({goods_id:e.selectedGoods[0]}).then(function(t){t.list.forEach(function(e){e.name=e.title}),e.goodsList.find(function(t){return t.id===e.selectedGoods[0]}).children=t.list;var n=e.goodsList.find(function(t){return t.id===e.selectedGoods[0]});e.periods=n.children.find(function(t){return t.id===e.selectedGoods[1]}),e.teacher_id="",e.getClassList()}))})},initPage:function(){var e=this;Object(i._40)({page:1,limit:100,goods_type:"1,2"}).then(function(t){console.log(t),t.list.forEach(function(e){e.name="["+e.id+"]["+s.h[e.goods_type]+"]["+e.current_price/100+"元]"+e.name,e.children=[]}),e.goodsList=t.list,e.initQuery()})},showUser:function(e){this.userObj={classId:e.id,periods_id:e.periods_id,show:!0,goods_id:this.goods_id,title:e.teacher_name+"班级用户列表",teacherId:e.teacher_id,class_name:e.class_name}},getTeacher:function(){var e=this;this.periods&&Object(i._56)(this.periods.id).then(function(t){var n={};t=t.reduce(function(e,t){return!n[t.teacher_id]&&(n[t.teacher_id]=e.push(t)),e},[]),e.teacherList=t})},changePeriods:function(e){if(e.length>1){this.goods_id=e[0];var t=this.goodsList.find(function(t){return t.id===e[0]});this.periods=t.children.find(function(t){return t.id===e[1]}),this.teacher_id="",this.getTeacher(),this.getClassList()}},onPageChange:function(e){this.nowPage=e,this.getClassList()},onSizeChange:function(e){this.limit=e,this.nowPage=1,this.getClassList()},onReflash:function(e){this.periods=e,this.selectedGoods=[e.goods_id,e.id],this.getClassList()},getClassList:function(){var e=this;if(this.periods){this.getTeacher();var t={limit:this.limit,page:this.nowPage};this.teacher_id&&(t.teacher_id=this.teacher_id),Object(i._29)(this.periods.id,t).then(function(t){t.list.forEach(function(e){e.arrive_course_rate=0,e.watch_course_rate=0,e.over_course_rate=0,e.work_rate=0,e.over_work_rate=0,e.clock_rate=0,e.over_clock_rate=0,e.transform_rate=0}),e.title=t.periods,e.title.count_join_num=t.count.count_join_num?t.count.count_join_num:"暂无",e.title.count_max_join_num=t.count.count_max_join_num?t.count.count_max_join_num:"暂无",e.title.count_teacher_num=t.count.count_teacher_num?t.count.count_teacher_num:"暂无",e.countObj=t.count?t.count:"",e.classList=t.list,e.total=t.total})}},handleItemChange:function(e){var t=this;Object(i._53)({goods_id:e[0]}).then(function(n){n.list.forEach(function(e){e.name=e.title}),t.goodsList.find(function(t){return t.id===e[0]}).children=n.list})},delClass:function(e){var t=this;this.$confirm("此操作将删除该班级?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(i.H)(e.id).then(function(e){t.$message({type:"success",message:"删除成功!"}),t.getClassList()})})},onAdd:function(){this.dialogObj={show:!0,title:"添加班级",type:0,teacherList:this.teacherList?this.teacherList:[]},this.periods&&(this.dialogObj.periods=this.periods,this.dialogObj.periodsId=this.periods.id)},editClass:function(e){this.dialogObj={show:!0,title:"编辑班级",type:1,id:e.id,teacherList:this.teacherList?this.teacherList:[]},this.periods&&(this.dialogObj.periods=this.periods,this.dialogObj.periodsId=this.periods.id)}}},c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"class"},[n("div",{staticClass:"form-block"},[n("el-form",{attrs:{"label-width":"90px",inline:""}},[n("el-form-item",{attrs:{label:"期数"}},[n("el-cascader",{attrs:{options:e.goodsList,props:{value:"id",label:"name"}},on:{"active-item-change":e.handleItemChange,change:e.changePeriods},model:{value:e.selectedGoods,callback:function(t){e.selectedGoods=t},expression:"selectedGoods"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"老师"}},[n("el-select",{attrs:{placeholder:"请选择",clearable:""},on:{change:e.getClassList},model:{value:e.teacher_id,callback:function(t){e.teacher_id=t},expression:"teacher_id"}},e._l(e.teacherList,function(e,t){return n("el-option",{key:t,attrs:{label:e.teacher_name,value:e.teacher_id}})}))],1),e._v(" "),n("el-form-item",{attrs:{label:""}},[n("el-button",{attrs:{type:"primary"},on:{click:e.getClassList}},[e._v("\n 搜索\n ")])],1),e._v(" "),n("el-form-item",{staticStyle:{float:"right"}},[e.$store.state.readonly?e._e():n("el-button",{attrs:{type:"success"},on:{click:e.onAdd}},[e._v("+添加班级")])],1)],1)],1),e._v(" "),e.title&&e.title.title?n("div",{staticClass:"intro"},[n("el-table",{staticStyle:{display:"block",margin:"20px auto",background:"transparent"},attrs:{border:"",size:"mini",data:[e.title]}},[n("el-table-column",{attrs:{label:"期数名称",prop:"title"}}),e._v(" "),n("el-table-column",{attrs:{label:"可看课包数",prop:"watch_num"}}),e._v(" "),n("el-table-column",{attrs:{label:"已看课包数",prop:"has_watch_num"}}),e._v(" "),n("el-table-column",{attrs:{label:"开始时间",prop:"start_at"}}),e._v(" "),n("el-table-column",{attrs:{label:"老师数量",prop:"count_teacher_num"}}),e._v(" "),n("el-table-column",{attrs:{label:"预计学员总数",prop:"count_max_join_num"}}),e._v(" "),n("el-table-column",{attrs:{label:"学员总数",prop:"count_join_num"}}),e._v(" "),n("el-table-column",{attrs:{label:"结束时间",prop:"over_at"}})],1)],1):e._e(),e._v(" "),e.title&&e.title.title?e._e():n("div",[n("el-form",{attrs:{"label-width":"300px",inline:""}},[n("el-form-item",{attrs:{label:"暂无期数信息,请先选择期数"}})],1)],1),e._v(" "),n("div",[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.classList},on:{"expand-change":e.changeRow}},[n("el-table-column",{attrs:{type:"expand"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-table",{staticStyle:{width:"100%"},attrs:{data:[t.row]}},[n("el-table-column",{attrs:{label:"到课率"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e._f("percent")(t.row.arrive_course_rate)))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"看课率"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e._f("percent")(t.row.watch_course_rate)))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"完课率"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e._f("percent")(t.row.over_course_rate)))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"打卡率"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e._f("percent")(t.row.clock_rate)))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"全勤打卡率"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e._f("percent")(t.row.over_clock_rate)))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"转化率"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e._f("percent")(t.row.transform_rate)))])]}}])})],1)]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"班级名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.class_name)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"qr",width:"130",label:"班级二维码"},scopedSlots:e._u([{key:"default",fn:function(e){return[n("a",{attrs:{href:e.row.qr,target:"_blank"}},[n("img",{staticClass:"avatar",attrs:{src:e.row.qr,alt:"二维码"}})])]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"teacher_name",label:"班主任"}}),e._v(" "),n("el-table-column",{attrs:{label:"老师状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(0===t.row.teacher_status?"带班":"不带班")+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"班级类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("classTypeFilter")(t.row.type))+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"max_join_num",label:"最大人数"}}),e._v(" "),n("el-table-column",{attrs:{prop:"join_num",label:"现有人数"}}),e._v(" "),n("el-table-column",{attrs:{prop:"source",label:"招生来源"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("classSourceFilter")(t.row.source))+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{width:"250",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(n){e.showUser(t.row)}}},[e._v("班级成员")]),e._v(" "),e.$store.state.readonly?e._e():n("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(n){e.editClass(t.row)}}},[e._v("编辑")]),e._v(" "),e.$store.state.deletePermission&&!e.$store.state.readonly?n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){e.delClass(t.row)}}},[e._v("删除")]):e._e()]}}])})],1)],1),e._v(" "),n("page",{attrs:{nowPage:e.nowPage,total:e.total,limit:e.limit},on:{pageChange:e.onPageChange,sizeChange:e.onSizeChange}}),e._v(" "),n("class-dialog",{attrs:{dialogObj:e.dialogObj},on:{reflash:e.onReflash}}),e._v(" "),n("user-list",{attrs:{userObj:e.userObj},on:{reflash:e.getClassList}})],1)};c._withStripped=!0;var d={render:c,staticRenderFns:[]},u=d;var h=!1;var _=n("VU/8")(l,u,!1,function(e){h||(n("rKW7"),n("a1h3"))},"data-v-426dc2ae",null);_.options.__file="src\\components\\class\\index.vue";t.default=_.exports},a1h3:function(e,t,n){var i=n("1/HN");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);n("rjj0")("171dfdde",i,!1,{})},g5CC:function(e,t,n){"use strict";var i=n("CCn6"),o=n("+TkF"),s={props:["dialogObj"],data:function(){var e=[];for(var t in o.f)e.push({label:o.f[t],value:Number(t)});return{imageList:[],form:{teacher_id:"",max_join_num:"",class_name:"",source:"",qr:""},type:0,classSource:e,teacherList:[],exitTeacherList:[],goodsList:[],periods:{},uploadShow:!0}},methods:{beforeAvatarUpload:function(){this.uploadShow=!1},handleRemove:function(){this.uploadShow=!0},handleAvatarSuccess:function(e){this.imageList=[{name:e.data.url,url:"https://cdn.singsingenglish.com/"+e.data.url}]},uploadFile:function(e){var t=this;this.loading=!0,this.$store.dispatch("setProgress",{type:"new",id:e.file.uid}),this.fileUid=e.file.uid,Object(i._126)({file:e.file,type:"all"}).then(function(e){t.form.media_id=e.wechat_info?e.wechat_info.media_id:"",t.imageList=[{name:e.url,url:"https://cdn.singsingenglish.com/"+e.url}],t.uploadShow=!1,t.loading=!1,t.$message({type:"success",message:"上传成功!"})}).catch(function(){t.loading=!1})},findDifferentArray:function(e,t){var n=[];return e.forEach(function(e){-1===t.findIndex(function(t){return t.teacher_id===e.id})&&n.push(e)}),n},getTeacher:function(){var e=this;Object(i._73)({limit:100,status:0}).then(function(t){e.teacherList=t.list})},getTeacherByPeriods:function(){var e=this;Object(i._73)({limit:100,status:0}).then(function(t){e.teacherList=t.list})},initPage:function(){var e=this;switch(this.periods=this.dialogObj.periods,this.dialogObj.type){case 0:this.dialogObj.periodsId||this.getPeriodList(),this.form={teacher_id:"",max_join_num:"",source:"",qr:""},this.type=0,this.getTeacher();break;case 1:this.type=1,Object(i._28)(this.dialogObj.id).then(function(t){e.form={teacher_id:parseInt(t.teacher_id),max_join_num:t.max_join_num,class_name:t.class_name,source:t.source,qr:""},e.getTeacher()})}},getPeriodList:function(){var e=this;Object(i._40)().then(function(t){t.list.forEach(function(e){e.name="["+o.h[e.goods_type]+"]["+e.current_price/100+"元]"+e.name,e.children=[]}),e.goodsList=t.list,e.periods||Object(i._53)({goods_id:e.goodsList[0].id}).then(function(t){t.list.forEach(function(e){e.name=e.title}),e.goodsList[0].children=t.list,e.periods=t.list[0]})})},onSave:function(){var e=this;this.imageList.length>0&&(this.form.qr=this.imageList[0].url);var t={max_join_num:String(this.form.max_join_num),teacher_id:String(this.form.teacher_id),source:this.form.source,class_name:this.form.class_name,qr:this.form.qr,media_id:this.form.media_id};switch(console.log(t),this.dialogObj.type){case 0:var n=this.dialogObj.periodsId?this.dialogObj.periodsId:this.periods.id;Object(i.f)(n,t).then(function(t){e.$message({type:"success",message:"添加成功!"}),e.$emit("reflash",e.periods),e.dialogObj.show=!1});break;case 1:Object(i._0)(this.dialogObj.id,t).then(function(t){e.$message({type:"success",message:"修改成功!"}),e.$emit("reflash",e.periods),e.dialogObj.show=!1})}},handleItemChange:function(e){var t=this;Object(i._53)({goods_id:e[0]}).then(function(n){n.list.forEach(function(e){e.name=e.title}),t.goodsList.find(function(t){return t.id===e[0]}).children=n.list})},changePeriods:function(e){if(e.length>1){var t=this.goodsList.find(function(t){return t.id===e[0]});this.periods=t.children.find(function(t){return t.id===e[1]}),this.getTeacherByPeriods()}},selectName:function(e,t){var n=e.filter(function(e,n){return e.id==t});this.form.class_name=n[0].name+"一班"}},watch:{"dialogObj.show":function(e){e&&this.initPage()}}},a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.dialogObj.title,visible:e.dialogObj.show},on:{"update:visible":function(t){e.$set(e.dialogObj,"show",t)}}},[n("el-form",{ref:"form",attrs:{model:e.form,"label-width":"120px"}},[this.dialogObj.periodsId?e._e():n("el-form-item",{attrs:{label:"期数"}},[n("el-cascader",{attrs:{options:e.goodsList,props:{value:"id",label:"name"}},on:{"active-item-change":e.handleItemChange,change:e.changePeriods}})],1),e._v(" "),n("el-form-item",{attrs:{label:"老师"}},[n("el-select",{attrs:{placeholder:"请选择",filterable:""},on:{change:function(t){e.selectName(e.teacherList,e.form.teacher_id)}},model:{value:e.form.teacher_id,callback:function(t){e.$set(e.form,"teacher_id",t)},expression:"form.teacher_id"}},e._l(e.teacherList,function(e,t){return n("el-option",{key:t,attrs:{label:e.name,value:e.id}})}))],1),e._v(" "),n("el-form-item",{attrs:{label:"班级名称"}},[n("el-input",{staticStyle:{width:"220px"},model:{value:e.form.class_name,callback:function(t){e.$set(e.form,"class_name",t)},expression:"form.class_name"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"最大学员"}},[n("el-input-number",{model:{value:e.form.max_join_num,callback:function(t){e.$set(e.form,"max_join_num",t)},expression:"form.max_join_num"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"招生来源"}},[n("el-select",{attrs:{placeholder:"请选择",filterable:""},model:{value:e.form.source,callback:function(t){e.$set(e.form,"source",t)},expression:"form.source"}},e._l(e.classSource,function(e,t){return n("el-option",{key:t,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),n("el-form-item",[1===e.type?n("img",{staticClass:"qr-img",attrs:{src:e.form.qr}}):e._e(),e._v(" "),n("el-upload",{class:{disabled:!e.uploadShow},attrs:{action:"/api/public/upload/zone","http-request":e.uploadFile,"before-upload":e.beforeAvatarUpload,"list-type":"picture-card","file-list":e.imageList,"on-success":e.handleAvatarSuccess,"on-remove":e.handleRemove}},[n("i",{staticClass:"el-icon-plus"})])],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogObj.show=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onSave}},[e._v("确 定")])],1)],1)};a._withStripped=!0;var r={render:a,staticRenderFns:[]},l=r;var c=!1;var d=n("VU/8")(s,l,!1,function(e){c||n("JP4Q")},"data-v-e25797c8",null);d.options.__file="src\\components\\class\\dialog.vue";t.a=d.exports},rKW7:function(e,t,n){var i=n("NzM9");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);n("rjj0")("94e58b82",i,!1,{})}});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,b,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[i],d[t]&&u.push(d[t][0]),d[t]=0;for(r in b)Object.prototype.hasOwnProperty.call(b,r)&&(e[r]=b[r]);for(c&&c(a,b,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var a={},d={56:0};function f(c){if(a[c])return a[c].exports;var d=a[c]={i:c,l:!1,exports:{}};return e[c].call(d.exports,d,d.exports,f),d.l=!0,d.exports}f.e=function(e){var c=d[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,f){c=d[e]=[a,f]});c[2]=a;var b=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,f.nc&&n.setAttribute("nonce",f.nc),n.src=f.p+"static/js/"+e+"."+{0:"48db51be0a24deef26f1",1:"b66e69d793a9d35d3909",2:"3fa6129d7cce1d2727cc",3:"f5f0c3d1e1fec5c5c951",4:"059ca7c142d3d8481359",5:"533eebc8d015c5c93845",6:"5f4940d46329fcb43187",7:"99ccfc906ae3130ce1e7",8:"85b6fe06267b11873800",9:"09523bba6af5134fcfac",10:"0fca58732edb7ad98d68",11:"63f78de02776e90ac1a0",12:"68c52a92bb73a2c2160a",13:"71249d67c16a076c8e96",14:"07769f54f841afe1b4dd",15:"0a9b1e03b653d37a8ec4",16:"2b402dca7ac597a68110",17:"ee936bc6bcfa50fe23f6",18:"a43d1cac8d747564e8bb",19:"c73d7498829b6d7c702f",20:"e08d9efdedb45e684a12",21:"13a048139a3f3a781f1c",22:"70c03c1895359e0d8b5e",23:"3bb77e0e5ab020a5156e",24:"c3dc2577aa8713fc2862",25:"11eea56cf1799c6b3210",26:"0071fbeee69d787a61bd",27:"59e2475897064b70514e",28:"e306918d8301ef6404ad",29:"e39c21b0dca50318cd84",30:"5e4bbe655c24af98cb5a",31:"ffd4e726822058f2a07c",32:"cd07cafd989482131981",33:"3e28193ece694879de73",34:"9d667b679f50d8174059",35:"3febc01bc0e887e26e7d",36:"2f5b581299537d235564",37:"f7a65cabf3b141969162",38:"6484d2ec831c62486c90",39:"d283f2388df33e02cef4",40:"a39dfa4cd254107d52f9",41:"a16ad1ea1f2438c037aa",42:"939d6413605876c9721b",43:"790e9555b1ee2e9221d3",44:"5d153cbe32e3b25baa48",45:"1676124a8bb46f2a9a9e",46:"2b6bd996d5e1d9b81baf",47:"a64e6fe827cb9322b4e6",48:"0c37f641710a7b675836",49:"61bceaadc6e9d1f38f43",50:"48254be58d6882c9698e",51:"bcf05c46b40f43b66dd3",52:"074092fb2fa3a4d87b4d",53:"386d74c7b4bd44e2d537"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var c=d[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),d[e]=void 0)}return n.onerror=n.onload=t,b.appendChild(n),a},f.m=e,f.c=a,f.d=function(e,c,a){f.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},f.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(c,"a",c),c},f.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},f.p="/",f.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=never><link rel=stylesheet href=https:////at.alicdn.com/t/font_746649_x1rivf5f5.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/theme-chalk/index.css><title>唱唱启蒙-后台</title><link href=/static/css/app.8a8990603d45d0ccfc40d6a18deb0b54.css rel=stylesheet></head><body><script src=https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js></script><script src=https://cdn.jsdelivr.net/npm/vuex@3.0.1/dist/vuex.min.js></script><script src=https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js></script><script src=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/index.js></script><div id=app></div><script type=text/javascript src=/static/js/manifest.bc4da69b1d6478898f78.js></script><script type=text/javascript src=/static/js/vendor.1989ff930c83bbe25dc0.js></script><script type=text/javascript src=/static/js/app.96fb402908e1c8c6ed42.js></script></body><script>let el = document.getElementsByTagName("script");
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=never><link rel=stylesheet href=https:////at.alicdn.com/t/font_746649_x1rivf5f5.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/theme-chalk/index.css><title>唱唱启蒙-后台</title><link href=/static/css/app.7d4d84d90482cfe6d4bb0044db10a8c9.css rel=stylesheet></head><body><script src=https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js></script><script src=https://cdn.jsdelivr.net/npm/vuex@3.0.1/dist/vuex.min.js></script><script src=https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js></script><script src=https://cdn.jsdelivr.net/npm/element-ui@2.4.9/lib/index.js></script><div id=app></div><script type=text/javascript src=/static/js/manifest.2780fb809d1add2cc38a.js></script><script type=text/javascript src=/static/js/vendor.1989ff930c83bbe25dc0.js></script><script type=text/javascript src=/static/js/app.96fb402908e1c8c6ed42.js></script></body><script>let el = document.getElementsByTagName("script");
el.onerror = function(a,b,c){
console.log('error:',a,b,c);
};
......
This source diff could not be displayed because it is too large. You can view the blob instead.
webpackJsonp([12],{"0TW7":function(t,e){},OX9A:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i("CCn6"),o=i("g5CC"),a=i("+TkF"),n=i("0qGg"),r=i("kmJW"),l={data:function(){return{nowPage:1,total:0,limit:10,periodsId:null,goods_id:null,goodsList:[],teacher_id:"",classList:[],title:"",countObj:"",teacherList:[],userObj:{classId:"",title:"",show:!1,goods_id:null},dialogObj:{show:!1,title:"添加班级",periodsId:"",type:0,id:0},selectedGoods:[]}},components:{UserList:n.a,classDialog:o.a,page:r.a},filters:{classTypeFilter:function(t){var e=parseInt(t);return 1===e?"带班班级":2===e?"观摩班级":""},classSourceFilter:function(t){return a.f[t]},percent:function(t){return(100*t).toFixed(2)+"%"}},mounted:function(){this.initPage()},methods:{changeRow:function(t,e){e.indexOf(t)>-1&&Object(s._30)(t.periods_id,t.id).then(function(e){t.arrive_course_rate=e.arrive_course_rate,t.watch_course_rate=e.watch_course_rate,t.over_course_rate=e.over_course_rate,t.work_rate=e.work_rate,t.over_work_rate=e.over_work_rate,t.clock_rate=e.clock_rate,t.over_clock_rate=e.over_clock_rate,t.transform_rate=e.transform_rate})},initQuery:function(){var t=this,e=this.$route.query;e&&e.goods_id&&e.periods_id?(this.goods_id=e.goods_id,this.selectedGoods=[parseInt(e.goods_id),parseInt(e.periods_id)],Object(s._53)({goods_id:this.selectedGoods[0]}).then(function(e){e.list.forEach(function(t){t.name=t.title}),t.goodsList.find(function(e){return e.id===t.selectedGoods[0]}).children=e.list;var i=t.goodsList.find(function(e){return e.id===t.selectedGoods[0]});t.periods=i.children.find(function(e){return e.id===t.selectedGoods[1]}),t.teacher_id="",t.getClassList()})):Object(s._35)().then(function(e){e&&(t.goods_id=e.goods_id,t.selectedGoods=[parseInt(e.goods_id),parseInt(e.id)],Object(s._53)({goods_id:t.selectedGoods[0]}).then(function(e){e.list.forEach(function(t){t.name=t.title}),t.goodsList.find(function(e){return e.id===t.selectedGoods[0]}).children=e.list;var i=t.goodsList.find(function(e){return e.id===t.selectedGoods[0]});t.periods=i.children.find(function(e){return e.id===t.selectedGoods[1]}),t.teacher_id="",t.getClassList()}))})},initPage:function(){var t=this;Object(s._40)({page:1,limit:100,goods_type:"1,2"}).then(function(e){console.log(e),e.list.forEach(function(t){t.name="["+t.id+"]["+a.h[t.goods_type]+"]["+t.current_price/100+"元]"+t.name,t.children=[]}),t.goodsList=e.list,t.initQuery()})},showUser:function(t){this.userObj={classId:t.id,periods_id:t.periods_id,show:!0,goods_id:this.goods_id,title:t.teacher_name+"班级用户列表",teacherId:t.teacher_id,class_name:t.class_name}},getTeacher:function(){var t=this;this.periods&&Object(s._56)(this.periods.id).then(function(e){var i={};e=e.reduce(function(t,e){return!i[e.teacher_id]&&(i[e.teacher_id]=t.push(e)),t},[]),t.teacherList=e})},changePeriods:function(t){if(t.length>1){this.goods_id=t[0];var e=this.goodsList.find(function(e){return e.id===t[0]});this.periods=e.children.find(function(e){return e.id===t[1]}),this.teacher_id="",this.getTeacher(),this.getClassList()}},onPageChange:function(t){this.nowPage=t,this.getClassList()},onSizeChange:function(t){this.limit=t,this.nowPage=1,this.getClassList()},onReflash:function(t){this.periods=t,this.selectedGoods=[t.goods_id,t.id],this.getClassList()},getClassList:function(){var t=this;if(this.periods){this.getTeacher();var e={limit:this.limit,page:this.nowPage};this.teacher_id&&(e.teacher_id=this.teacher_id),Object(s._29)(this.periods.id,e).then(function(e){e.list.forEach(function(t){t.arrive_course_rate=0,t.watch_course_rate=0,t.over_course_rate=0,t.work_rate=0,t.over_work_rate=0,t.clock_rate=0,t.over_clock_rate=0,t.transform_rate=0}),t.title=e.periods,t.title.count_join_num=e.count.count_join_num?e.count.count_join_num:"暂无",t.title.count_max_join_num=e.count.count_max_join_num?e.count.count_max_join_num:"暂无",t.title.count_teacher_num=e.count.count_teacher_num?e.count.count_teacher_num:"暂无",t.countObj=e.count?e.count:"",t.classList=e.list,t.total=e.total})}},handleItemChange:function(t){var e=this;Object(s._53)({goods_id:t[0]}).then(function(i){i.list.forEach(function(t){t.name=t.title}),e.goodsList.find(function(e){return e.id===t[0]}).children=i.list})},delClass:function(t){var e=this;this.$confirm("此操作将删除该班级?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(s.H)(t.id).then(function(t){e.$message({type:"success",message:"删除成功!"}),e.getClassList()})})},onAdd:function(){this.dialogObj={show:!0,title:"添加班级",type:0,teacherList:this.teacherList?this.teacherList:[]},this.periods&&(this.dialogObj.periods=this.periods,this.dialogObj.periodsId=this.periods.id)},editClass:function(t){this.dialogObj={show:!0,title:"编辑班级",type:1,id:t.id,teacherList:this.teacherList?this.teacherList:[]},this.periods&&(this.dialogObj.periods=this.periods,this.dialogObj.periodsId=this.periods.id)}}},c={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"class"},[i("div",{staticClass:"form-block"},[i("el-form",{attrs:{"label-width":"90px",inline:""}},[i("el-form-item",{attrs:{label:"期数"}},[i("el-cascader",{attrs:{options:t.goodsList,props:{value:"id",label:"name"}},on:{"active-item-change":t.handleItemChange,change:t.changePeriods},model:{value:t.selectedGoods,callback:function(e){t.selectedGoods=e},expression:"selectedGoods"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"老师"}},[i("el-select",{attrs:{placeholder:"请选择",clearable:""},on:{change:t.getClassList},model:{value:t.teacher_id,callback:function(e){t.teacher_id=e},expression:"teacher_id"}},t._l(t.teacherList,function(t,e){return i("el-option",{key:e,attrs:{label:t.teacher_name,value:t.teacher_id}})}))],1),t._v(" "),i("el-form-item",{attrs:{label:""}},[i("el-button",{attrs:{type:"primary"},on:{click:t.getClassList}},[t._v("\n 搜索\n ")])],1),t._v(" "),i("el-form-item",{staticStyle:{float:"right"}},[t.$store.state.readonly?t._e():i("el-button",{attrs:{type:"success"},on:{click:t.onAdd}},[t._v("+添加班级")])],1)],1)],1),t._v(" "),t.title&&t.title.title?i("div",{staticClass:"intro"},[i("el-table",{staticStyle:{display:"block",margin:"20px auto",background:"transparent"},attrs:{border:"",size:"mini",data:[t.title]}},[i("el-table-column",{attrs:{label:"期数名称",prop:"title"}}),t._v(" "),i("el-table-column",{attrs:{label:"可看课包数",prop:"watch_num"}}),t._v(" "),i("el-table-column",{attrs:{label:"已看课包数",prop:"has_watch_num"}}),t._v(" "),i("el-table-column",{attrs:{label:"开始时间",prop:"start_at"}}),t._v(" "),i("el-table-column",{attrs:{label:"老师数量",prop:"count_teacher_num"}}),t._v(" "),i("el-table-column",{attrs:{label:"预计学员总数",prop:"count_max_join_num"}}),t._v(" "),i("el-table-column",{attrs:{label:"学员总数",prop:"count_join_num"}}),t._v(" "),i("el-table-column",{attrs:{label:"结束时间",prop:"over_at"}})],1)],1):t._e(),t._v(" "),t.title&&t.title.title?t._e():i("div",[i("el-form",{attrs:{"label-width":"300px",inline:""}},[i("el-form-item",{attrs:{label:"暂无期数信息,请先选择期数"}})],1)],1),t._v(" "),i("div",[i("el-table",{staticStyle:{width:"100%"},attrs:{data:t.classList},on:{"expand-change":t.changeRow}},[i("el-table-column",{attrs:{type:"expand"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-table",{staticStyle:{width:"100%"},attrs:{data:[e.row]}},[i("el-table-column",{attrs:{label:"到课率"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("percent")(e.row.arrive_course_rate)))])]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"看课率"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("percent")(e.row.watch_course_rate)))])]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"完课率"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("percent")(e.row.over_course_rate)))])]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"打卡率"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("percent")(e.row.clock_rate)))])]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"全勤打卡率"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("percent")(e.row.over_clock_rate)))])]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"转化率"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("percent")(e.row.transform_rate)))])]}}])})],1)]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"班级名称"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.class_name)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"qr",width:"130",label:"班级二维码"},scopedSlots:t._u([{key:"default",fn:function(t){return[i("a",{attrs:{href:t.row.qr,target:"_blank"}},[i("img",{staticClass:"avatar",attrs:{src:t.row.qr,alt:"二维码"}})])]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"teacher_name",label:"班主任"}}),t._v(" "),i("el-table-column",{attrs:{label:"老师状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(0===e.row.teacher_status?"带班":"不带班")+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"班级类型"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("classTypeFilter")(e.row.type))+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"max_join_num",label:"最大人数"}}),t._v(" "),i("el-table-column",{attrs:{prop:"join_num",label:"现有人数"}}),t._v(" "),i("el-table-column",{attrs:{prop:"source",label:"招生来源"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("classSourceFilter")(e.row.source))+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{width:"250",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(i){t.showUser(e.row)}}},[t._v("班级成员")]),t._v(" "),t.$store.state.readonly?t._e():i("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(i){t.editClass(e.row)}}},[t._v("编辑")]),t._v(" "),t.$store.state.deletePermission&&!t.$store.state.readonly?i("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(i){t.delClass(e.row)}}},[t._v("删除")]):t._e()]}}])})],1)],1),t._v(" "),i("page",{attrs:{nowPage:t.nowPage,total:t.total,limit:t.limit},on:{pageChange:t.onPageChange,sizeChange:t.onSizeChange}}),t._v(" "),i("class-dialog",{attrs:{dialogObj:t.dialogObj},on:{reflash:t.onReflash}}),t._v(" "),i("user-list",{attrs:{userObj:t.userObj},on:{reflash:t.getClassList}})],1)},staticRenderFns:[]};var d=i("VU/8")(l,c,!1,function(t){i("xMOM"),i("0TW7")},"data-v-cf52e8ec",null);e.default=d.exports},c5eA:function(t,e){},g5CC:function(t,e,i){"use strict";var s=i("CCn6"),o=i("+TkF"),a={props:["dialogObj"],data:function(){var t=[];for(var e in o.f)t.push({label:o.f[e],value:Number(e)});return{imageList:[],form:{teacher_id:"",max_join_num:"",class_name:"",source:"",qr:""},type:0,classSource:t,teacherList:[],exitTeacherList:[],goodsList:[],periods:{},uploadShow:!0}},methods:{beforeAvatarUpload:function(){this.uploadShow=!1},handleRemove:function(){this.uploadShow=!0},handleAvatarSuccess:function(t){this.imageList=[{name:t.data.url,url:"https://cdn.singsingenglish.com/"+t.data.url}]},uploadFile:function(t){var e=this;this.loading=!0,this.$store.dispatch("setProgress",{type:"new",id:t.file.uid}),this.fileUid=t.file.uid,Object(s._126)({file:t.file,type:"all"}).then(function(t){e.form.media_id=t.wechat_info?t.wechat_info.media_id:"",e.imageList=[{name:t.url,url:"https://cdn.singsingenglish.com/"+t.url}],e.uploadShow=!1,e.loading=!1,e.$message({type:"success",message:"上传成功!"})}).catch(function(){e.loading=!1})},findDifferentArray:function(t,e){var i=[];return t.forEach(function(t){-1===e.findIndex(function(e){return e.teacher_id===t.id})&&i.push(t)}),i},getTeacher:function(){var t=this;Object(s._73)({limit:100,status:0}).then(function(e){t.teacherList=e.list})},getTeacherByPeriods:function(){var t=this;Object(s._73)({limit:100,status:0}).then(function(e){t.teacherList=e.list})},initPage:function(){var t=this;switch(this.periods=this.dialogObj.periods,this.dialogObj.type){case 0:this.dialogObj.periodsId||this.getPeriodList(),this.form={teacher_id:"",max_join_num:"",source:"",qr:""},this.type=0,this.getTeacher();break;case 1:this.type=1,Object(s._28)(this.dialogObj.id).then(function(e){t.form={teacher_id:parseInt(e.teacher_id),max_join_num:e.max_join_num,class_name:e.class_name,source:e.source,qr:""},t.getTeacher()})}},getPeriodList:function(){var t=this;Object(s._40)().then(function(e){e.list.forEach(function(t){t.name="["+o.h[t.goods_type]+"]["+t.current_price/100+"元]"+t.name,t.children=[]}),t.goodsList=e.list,t.periods||Object(s._53)({goods_id:t.goodsList[0].id}).then(function(e){e.list.forEach(function(t){t.name=t.title}),t.goodsList[0].children=e.list,t.periods=e.list[0]})})},onSave:function(){var t=this;this.imageList.length>0&&(this.form.qr=this.imageList[0].url);var e={max_join_num:String(this.form.max_join_num),teacher_id:String(this.form.teacher_id),source:this.form.source,class_name:this.form.class_name,qr:this.form.qr,media_id:this.form.media_id};switch(console.log(e),this.dialogObj.type){case 0:var i=this.dialogObj.periodsId?this.dialogObj.periodsId:this.periods.id;Object(s.f)(i,e).then(function(e){t.$message({type:"success",message:"添加成功!"}),t.$emit("reflash",t.periods),t.dialogObj.show=!1});break;case 1:Object(s._0)(this.dialogObj.id,e).then(function(e){t.$message({type:"success",message:"修改成功!"}),t.$emit("reflash",t.periods),t.dialogObj.show=!1})}},handleItemChange:function(t){var e=this;Object(s._53)({goods_id:t[0]}).then(function(i){i.list.forEach(function(t){t.name=t.title}),e.goodsList.find(function(e){return e.id===t[0]}).children=i.list})},changePeriods:function(t){if(t.length>1){var e=this.goodsList.find(function(e){return e.id===t[0]});this.periods=e.children.find(function(e){return e.id===t[1]}),this.getTeacherByPeriods()}},selectName:function(t,e){var i=t.filter(function(t,i){return t.id==e});this.form.class_name=i[0].name+"一班"}},watch:{"dialogObj.show":function(t){t&&this.initPage()}}},n={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{attrs:{title:t.dialogObj.title,visible:t.dialogObj.show},on:{"update:visible":function(e){t.$set(t.dialogObj,"show",e)}}},[i("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px"}},[this.dialogObj.periodsId?t._e():i("el-form-item",{attrs:{label:"期数"}},[i("el-cascader",{attrs:{options:t.goodsList,props:{value:"id",label:"name"}},on:{"active-item-change":t.handleItemChange,change:t.changePeriods}})],1),t._v(" "),i("el-form-item",{attrs:{label:"老师"}},[i("el-select",{attrs:{placeholder:"请选择",filterable:""},on:{change:function(e){t.selectName(t.teacherList,t.form.teacher_id)}},model:{value:t.form.teacher_id,callback:function(e){t.$set(t.form,"teacher_id",e)},expression:"form.teacher_id"}},t._l(t.teacherList,function(t,e){return i("el-option",{key:e,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),i("el-form-item",{attrs:{label:"班级名称"}},[i("el-input",{staticStyle:{width:"220px"},model:{value:t.form.class_name,callback:function(e){t.$set(t.form,"class_name",e)},expression:"form.class_name"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"最大学员"}},[i("el-input-number",{model:{value:t.form.max_join_num,callback:function(e){t.$set(t.form,"max_join_num",e)},expression:"form.max_join_num"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"招生来源"}},[i("el-select",{attrs:{placeholder:"请选择",filterable:""},model:{value:t.form.source,callback:function(e){t.$set(t.form,"source",e)},expression:"form.source"}},t._l(t.classSource,function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})}))],1),t._v(" "),i("el-form-item",[1===t.type?i("img",{staticClass:"qr-img",attrs:{src:t.form.qr}}):t._e(),t._v(" "),i("el-upload",{class:{disabled:!t.uploadShow},attrs:{action:"/api/public/upload/zone","http-request":t.uploadFile,"before-upload":t.beforeAvatarUpload,"list-type":"picture-card","file-list":t.imageList,"on-success":t.handleAvatarSuccess,"on-remove":t.handleRemove}},[i("i",{staticClass:"el-icon-plus"})])],1)],1),t._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.dialogObj.show=!1}}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:t.onSave}},[t._v("确 定")])],1)],1)},staticRenderFns:[]};var r=i("VU/8")(a,n,!1,function(t){i("c5eA")},"data-v-2358f2b6",null);e.a=r.exports},xMOM:function(t,e){}});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,d,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[i],b[t]&&u.push(b[t][0]),b[t]=0;for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&(e[r]=d[r]);for(c&&c(a,d,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=f(f.s=n[i]);return o};var a={},b={56:0};function f(c){if(a[c])return a[c].exports;var b=a[c]={i:c,l:!1,exports:{}};return e[c].call(b.exports,b,b.exports,f),b.l=!0,b.exports}f.e=function(e){var c=b[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,f){c=b[e]=[a,f]});c[2]=a;var d=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,f.nc&&n.setAttribute("nonce",f.nc),n.src=f.p+"static/js/"+e+"."+{0:"02f833ebcc43507a77bd",1:"48308881493e2d004a1a",2:"7fc7db0d032ea03d9ec6",3:"c0a29cd6a66c85bbe8fb",4:"5352a82878badb954d35",5:"9017de79e056fe039271",6:"b1c9d4bcae7fd78e99f6",7:"70db7561b737296aab6a",8:"cdc034b21a51a5f6567f",9:"a480c8692470d845b0ff",10:"539ddfbd8ca7c237c7ba",11:"ebc020d874aa1c84be62",12:"fb6f3ba45dc5173a9bb4",13:"7c7cbc5a8be5396f56eb",14:"fa39b24453e810c36b96",15:"167afe55f46a061d55bf",16:"cebcb06e3a22b0b6cb1b",17:"1a7e9827766176a693c5",18:"aaae6bcbaa1b04fe6522",19:"743451bef08b125635f1",20:"35e0b23c2b33b7eb10f4",21:"2b670f80e81c95b841c6",22:"e1068c667802c871101b",23:"0a962264589383160c44",24:"25c05a2d6628d51eaf54",25:"03f16ccfe5d583b7800d",26:"20c58c1a6aeb3bd7c9d8",27:"b1ba1ddd03f95a5dced7",28:"fe524b57ea14474670ac",29:"142fa147d47c9c7ad8dd",30:"3d5b646ccf1187a6db8d",31:"d8f7236e796354f5a777",32:"ef62d541e6f7dfa12653",33:"19ab65cf0e4b00b33a91",34:"5dac0109ef7103954e96",35:"bfca94e4e2df12006846",36:"b12b8e33ace7bb96e972",37:"50ade86b59e643c8b921",38:"ef7972ac0c27589daa15",39:"3cbe77ceb237cfabb852",40:"c16360ac2901bc9d164e",41:"e2252f797d9ee07b1ceb",42:"bfcf4d980f9588d2fc8b",43:"6ea73de8c8dc76b93912",44:"fc8b4c6ab29184eaa69b",45:"ad395547e267b32c1791",46:"b72e24dde04b9aca0137",47:"b91b7317f7fb0cb3f533",48:"6b002803c2ecb922e9da",49:"f76a19201df3442d8d55",50:"0492b997561d7f53f2bb",51:"cb32796b49c2bd2f2e87",52:"ad1410c1e547f2943941",53:"27ee80f01739d59ef386"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var c=b[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),b[e]=void 0)}return n.onerror=n.onload=t,d.appendChild(n),a},f.m=e,f.c=a,f.d=function(e,c,a){f.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},f.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(c,"a",c),c},f.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},f.p="/",f.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -39,6 +39,21 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item >
<img class="qr-img" v-if="type===1" :src="form.qr"/>
<!--<el-input v-model="form.qr"></el-input>-->
<el-upload
action="/api/public/upload/zone"
:http-request="uploadFile"
:class="{disabled:!uploadShow}"
:before-upload="beforeAvatarUpload"
list-type="picture-card"
:file-list="imageList"
:on-success="handleAvatarSuccess"
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogObj.show = false">取 消</el-button>
......@@ -48,7 +63,7 @@
</template>
<script>
import {getTeacherListApi,getClassDetailApi,editClassApi,addClassApi,getPeriodsApi,getGoodsListApi,getPeriodsTeacherApi} from "../../service/api";
import {getTeacherListApi,getClassDetailApi,editClassApi,addClassApi,getPeriodsApi,getGoodsListApi,getPeriodsTeacherApi,uploadFileApi} from "../../service/api";
import {GOODSTYPE,CLASSSOURCE} from '../../util/wordbook';
export default {
props:[
......@@ -60,20 +75,50 @@
classSource.push({label:CLASSSOURCE[x],value:Number(x)})
}
return{
imageList:[],
form:{
teacher_id:'',
max_join_num:'',
class_name:"",
source:""
source:"",
qr:""
},
type:0,
classSource:classSource,
teacherList:[],
exitTeacherList: [],
goodsList: [],
periods: {}
periods: {},
uploadShow: true
}
},
methods:{
beforeAvatarUpload(){
this.uploadShow = false
},
handleRemove(){
this.uploadShow = true
},
handleAvatarSuccess(res) {
this.imageList = [{name:res.data.url,url:process.env.IMAGE_URL_HEAD + res.data.url}]
},
uploadFile(a) {
this.loading = true;
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'all'}).then(res=>{
this.form.media_id = res.wechat_info ? res.wechat_info.media_id : '';
this.imageList = [{name:res.url,url:process.env.IMAGE_URL_HEAD + res.url}];
this.uploadShow = false;
this.loading = false;
this.$message({
type: 'success',
message: '上传成功!'
});
}).catch(()=>{
this.loading = false;
})
},
findDifferentArray(array1, array2){
let newArray = [];
array1.forEach((val)=>{
......@@ -106,17 +151,21 @@
this.form = {
teacher_id:'',
max_join_num:'',
source:''
source:'',
qr:""
};
this.type = 0;
this.getTeacher();
break;
case 1:
this.type = 1;
getClassDetailApi(this.dialogObj.id).then(res=>{
this.form = {
teacher_id: parseInt(res.teacher_id),
max_join_num:res.max_join_num,
class_name:res.class_name,
source:res.source
source:res.source,
qr:""
};
this.getTeacher();
})
......@@ -139,12 +188,18 @@
});
},
onSave(){
if(this.imageList.length > 0){
this.form.qr = this.imageList[0].url;
}
let json = {
max_join_num:String(this.form.max_join_num),
teacher_id:String(this.form.teacher_id),
source : this.form.source,
class_name:this.form.class_name
class_name:this.form.class_name,
qr:this.form.qr,
media_id:this.form.media_id
};
console.log(json)
switch (this.dialogObj.type) {
case 0:
let id = this.dialogObj.periodsId ? this.dialogObj.periodsId : this.periods.id;
......
......@@ -132,6 +132,16 @@
{{scope.row.class_name}}
</template>
</el-table-column>
<el-table-column
prop="qr"
width="130"
label="班级二维码">
<template slot-scope="scope">
<a :href="scope.row.qr" target="_blank">
<img class="avatar" :src="scope.row.qr" alt="二维码">
</a>
</template>
</el-table-column>
<el-table-column
prop="teacher_name"
label="班主任">
......@@ -440,6 +450,7 @@
.intro .el-form-item{
margin-bottom: 0;
}
.avatar{width: 100px;}
</style>
<style>
.demo-table-expand {
......@@ -454,4 +465,5 @@
margin-bottom: 0;
width: 50%;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment