(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d3c4c186"],{"225f":function(t,e,n){"use strict";n.r(e);var s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"student-set set-page"},[n("h1",[t._v("外刊宝-学生设置")]),n("div",{staticClass:"top-operation"},[n("el-select",{attrs:{size:"medium"},on:{change:t.selectGrade},model:{value:t.grade,callback:function(e){t.grade=e},expression:"grade"}},t._l(t.grades,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),n("el-upload",{attrs:{"show-file-list":!1,action:"","http-request":t.upload}},[n("div",{staticClass:"upload btn"},[t._v(" 上传成绩 ")])]),n("div",{staticClass:"download",on:{click:t.download}},[t._m(0),t._v(" 下载模版 ")]),n("span",{staticClass:"tips"},[t._v(" 提示:上传文件(选择最近一次考试成绩,系统将根据最近一次考试成绩,推荐不同的产品) ")]),n("div",{staticClass:"preserve btn",on:{click:t.preserve}},[t._v("保存")])],1),n("div",{staticClass:"panel-wrap"},[n("div",{staticClass:"left-panel panel"},[n("p",{staticClass:"panel-title"},[t._v("班级")]),n("div",{staticClass:"panel-content"},[n("ul",{staticClass:"class-list"},[n("li",{staticClass:"select-all",class:[0==t.classId?"active":""],on:{click:function(e){return t.selectClass()}}},[t._v(" 全选 ")]),t._l(t.classes,(function(e){return n("li",{key:e.class_id,class:[t.classId==e.class_id?"active":""],on:{click:function(n){return t.selectClass(e.class_id)}}},[t._v(" "+t._s(e.class_name)+" ")])}))],2)])]),n("div",{staticClass:"middle-panel panel"},[n("div",{staticClass:"operation-bar"},[n("el-checkbox",{attrs:{disabled:t.checkAllDisabled},on:{change:t.allSelectStudent},model:{value:t.checkAll,callback:function(e){t.checkAll=e},expression:"checkAll"}},[t._v("全选")]),n("el-input",{attrs:{size:"small"},model:{value:t.studentName,callback:function(e){t.studentName="string"===typeof e?e.trim():e},expression:"studentName"}}),n("div",{staticClass:"search btn",on:{click:t.search}},[t._v("搜索")]),n("el-dropdown",{attrs:{trigger:"click"},on:{command:t.selectProduct}},[n("el-button",{attrs:{disabled:!t.selectedStudent.length}},[t._v(" 选择档次"),n("i",{staticClass:"el-icon-arrow-right el-icon--right"})]),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{attrs:{command:1}},[t._v("基础")]),n("el-dropdown-item",{attrs:{command:2}},[t._v("提升")]),n("el-dropdown-item",{attrs:{command:3}},[t._v("培优")])],1)],1)],1),n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.studentloading,expression:"studentloading"}],staticClass:"panel-content"},[n("el-checkbox-group",{model:{value:t.students,callback:function(e){t.students=e},expression:"students"}},t._l(t.studentData,(function(e){return n("el-checkbox",{key:e.student_id,attrs:{label:e.student_id,disabled:!!e.is_set},on:{change:function(n){return t.selectStudent(n,e)}}},[t._v(t._s(e.realname))])})),1)],1)]),n("div",{staticClass:"right-panel panel"},[t._m(1),n("div",{staticClass:"panel-content"},[n("ul",{staticClass:"student-list"},t._l(t.basicStudent,(function(e){return n("li",{key:e.student_id},[t._v(" "+t._s(e.realname)),n("i",{on:{click:function(n){return t.removeStudent(e)}}})])})),0),n("ul",{staticClass:"student-list"},t._l(t.waikanStudent,(function(e){return n("li",{key:e.student_id},[t._v(" "+t._s(e.realname)),n("i",{on:{click:function(n){return t.removeStudent(e)}}})])})),0),n("ul",{staticClass:"student-list"},t._l(t.hotspotStudent,(function(e){return n("li",{key:e.student_id},[t._v(" "+t._s(e.realname)),n("i",{on:{click:function(n){return t.removeStudent(e)}}})])})),0)])])])])},a=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"icon"},[s("img",{staticClass:"icon-1",attrs:{src:n("3bf3")}}),s("img",{staticClass:"icon-2",attrs:{src:n("bbf1")}})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel-title"},[n("p",{staticClass:"product-title"},[t._v("基础(档次一)")]),n("p",{staticClass:"product-title"},[t._v("提升(档次二)")]),n("p",{staticClass:"product-title"},[t._v("培优(档次三)")])])}],i=(n("99af"),n("a623"),n("4de4"),n("4160"),n("caad"),n("d81d"),n("45fc"),n("a434"),n("2532"),n("159b"),n("2909")),u=n("cd37"),d=n("f1ed"),c={name:"StudentSet",components:{},filters:{},props:{},data:function(){return{grade:1,grades:[{value:1,label:"高一"},{value:2,label:"高二"},{value:3,label:"高三"}],classes:[],classId:0,studentName:"",students:[],classData:[],checkAll:!1,checkAllDisabled:!1,allStudents:[],studentData:[],productStudent:[],levelStudents:[],basicStudent:[],waikanStudent:[],hotspotStudent:[],selectedStudent:[],delStudent:[],uploadAddress:"",studentloading:!0}},computed:{},watch:{},created:function(){this.selectGrade(this.grade)},mounted:function(){},methods:{selectGrade:function(t){this.studentData=[],this.classId=0,this.students=[],this.getClass(t),this.initStudentSet(t)},initStudentSet:function(t){var e=this,n={grade:t};Object(u["b"])(n).then((function(t){e.classData=t.data.class_students,e.classData.forEach((function(t){var n;(n=e.studentData).push.apply(n,Object(i["a"])(t.students)),e.studentloading=!1,t.students.forEach((function(t){t.is_set&&e.students.push(t.student_id)}))})),e.allStudents=e.studentData,e.productStudent=t.data.reading_level_students,e.showProductStudent(e.productStudent),e.checkAll=e.levelStudents.length===e.studentData.length,e.checkAllDisabled=e.levelStudents.length===e.studentData.length}))},getClass:function(t){var e=this;Object(u["d"])({grade:t}).then((function(t){e.classes=t.data.class}))},showProductStudent:function(t,e){var n=this;t.legth||(this.basicStudent=[],this.waikanStudent=[],this.hotspotStudent=[]),this.levelStudents=[],this.classId&&(t=JSON.parse(JSON.stringify(t)),t.forEach((function(t){return t.students=t.students.filter((function(t){return t.class_id==e}))}))),t.forEach((function(t){var e;switch(t.reading_level){case 1:n.basicStudent=t.students;break;case 2:n.waikanStudent=t.students;break;case 3:n.hotspotStudent=t.students;break}(e=n.levelStudents).push.apply(e,Object(i["a"])(t.students))}))},selectClass:function(t){var e=this;t?(this.classId=t,this.classData.forEach((function(n){t==n.class_id&&(e.studentData=n.students)})),this.showProductStudent(this.productStudent,t)):(this.classId=0,this.studentData=this.allStudents,this.showProductStudent(this.productStudent)),this.students=this.students.filter((function(t){return!e.selectedStudent.some((function(e){return e.student_id==t}))})),this.checkAll=this.levelStudents.length===this.studentData.length,this.checkAllDisabled=this.levelStudents.length===this.studentData.length,this.selectedStudent=[]},search:function(){var t=this;this.studentName||(this.studentData=this.allStudents),this.studentData=this.studentData.filter((function(e){return e.realname.includes(t.studentName)}))},selectStudent:function(t,e){var n=this;t?this.selectedStudent.push({class_id:e.class_id,realname:e.realname,student_id:e.student_id}):this.selectedStudent=this.selectedStudent.filter((function(t){return t.student_id!=e.student_id})),this.checkAll=this.studentData.every((function(t){var e=n.students.includes(t.student_id);return!!e}))},allSelectStudent:function(t){var e=this,n=[];this.classId?this.classData.forEach((function(t){e.classId==t.class_id&&(n=t.students)})):n=this.allStudents,n.forEach((function(n){if(t){if(e.students.includes(n.student_id))return;e.students.push(n.student_id),e.selectedStudent.push(n)}else e.students=e.students.filter((function(t){return!e.selectedStudent.some((function(e){return e.student_id==t}))})),e.selectedStudent=[]}))},selectProduct:function(t){var e=this;this.productStudent.forEach((function(n){var s;n.reading_level==t&&(s=n.students).push.apply(s,Object(i["a"])(e.selectedStudent))})),this.showProductStudent(this.productStudent,this.classId),this.classData.forEach((function(t){e.selectedStudent.forEach((function(e){e.class_id==t.class_id&&t.students.forEach((function(t){e.student_id==t.student_id&&(t.is_set=!0)}))}))})),this.delStudent=this.delStudent.filter((function(t){return!e.selectedStudent.some((function(e){return e.student_id==t}))})),this.selectedStudent=[],this.checkAll=this.levelStudents.length===this.studentData.length,this.checkAllDisabled=this.levelStudents.length===this.studentData.length},removeStudent:function(t){var e=this;this.checkAllDisabled=this.selectedStudent.length===this.studentData.length,this.checkAll=this.selectedStudent.length===this.studentData.length,this.productStudent.forEach((function(e){e.students.forEach((function(e,n,s){e.student_id==t.student_id&&s.splice(n,1)}))})),this.showProductStudent(this.productStudent,this.classId),this.students.forEach((function(n,s){t.student_id==n&&e.students.splice(s,1)})),this.classData.forEach((function(e){t.class_id==e.class_id&&e.students.forEach((function(e){t.student_id==e.student_id&&(e.is_set=!1)}))})),this.delStudent.push(t.student_id)},upload:function(t){var e=this,n={grade:this.grade,file:t.file},s=Object(d["b"])(n);Object(u["l"])(s).then((function(t){if(0==t.status&&e.$confirm(t.msg,"错误提示",{showCancelButton:!1,type:"error",callback:function(){}}),1==t.status){e.$confirm("共计上传".concat(t.data.excel_total,"个学生数据,获取到有效学生数据").concat(t.data.student_total,"个
页面数据已更新,请继续操作!"),"操作提示",{dangerouslyUseHTMLString:!0,showCancelButton:!1,type:"success",callback:function(){}});var n=[];t.data.class_students.forEach((function(t){n.push.apply(n,Object(i["a"])(t.students))})),e.allStudents.forEach((function(t){n.forEach((function(e){e.student_id==t.student_id&&(t.is_set=!0)}))})),n.forEach((function(t){e.students.includes(t.student_id)||e.students.push(t.student_id)}));var s=t.data.reading_level_students,a=s.map((function(t){var e;return t.students.forEach((function(t){e=t.student_id})),e}));e.productStudent.forEach((function(t){var e=[];t.students.forEach((function(t){a.includes(t.student_id)||e.push(t)})),t.students=e})),e.productStudent.forEach((function(t){s.forEach((function(e){t.reading_level==e.reading_level&&(t.students.length?e.students.forEach((function(e){var n=t.students.filter((function(t){return t.student_id==e.student_id}));n.length||t.students.push(e)})):t.students=e.students)}))})),e.selectClass()}2==t.status&&e.$confirm("未获取到有效学生数据,请检查表格数据是否有误!","错误提示",{showCancelButton:!1,type:"error",callback:function(){}}),3==t.status&&e.$confirm("上传数据与当前年级不符!","错误提示",{showCancelButton:!1,type:"error",callback:function(){}})}))},setData:function(){},download:function(){location.href="/assets/data/导入成绩模版.xlsx"},preserve:function(){var t=this,e=this.productStudent.map((function(t){return{reading_level:t.reading_level,students:t.students.map((function(t){return t.student_id}))}})),n=e.every((function(t){return!t.students.length}));if(n)this.$message.error("请设置学生数据!");else{var s=this.$loading({lock:!0,text:"数据保存中......",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.5)",customClass:"waikan-loading"}),a={reading_level:0,students:this.delStudent};e.unshift(a);var i={grade:this.grade,students_product_type:e};console.log(i),Object(u["a"])(i).then((function(e){s.close(),1==e.status&&t.$alert("保存成功!",{confirmButtonText:"确定",callback:function(){t.$router.push("WaiKanGenerate")}})}))}}}},l=c,r=(n("cb5b"),n("2877")),o=Object(r["a"])(l,s,a,!1,null,null,null);e["default"]=o.exports},2532:function(t,e,n){"use strict";var s=n("23e7"),a=n("5a34"),i=n("1d80"),u=n("ab13");s({target:"String",proto:!0,forced:!u("includes")},{includes:function(t){return!!~String(i(this)).indexOf(a(t),arguments.length>1?arguments[1]:void 0)}})},"3bf3":function(t,e,n){t.exports=n.p+"img/u1805.20a1f072.svg"},"45fc":function(t,e,n){"use strict";var s=n("23e7"),a=n("b727").some,i=n("a640"),u=n("ae40"),d=i("some"),c=u("some");s({target:"Array",proto:!0,forced:!d||!c},{some:function(t){return a(this,t,arguments.length>1?arguments[1]:void 0)}})},"5a34":function(t,e,n){var s=n("44e7");t.exports=function(t){if(s(t))throw TypeError("The method doesn't accept regular expressions");return t}},a434:function(t,e,n){"use strict";var s=n("23e7"),a=n("23cb"),i=n("a691"),u=n("50c4"),d=n("7b0b"),c=n("65f0"),l=n("8418"),r=n("1dde"),o=n("ae40"),h=r("splice"),f=o("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,v=Math.min,g=9007199254740991,_="Maximum allowed length exceeded";s({target:"Array",proto:!0,forced:!h||!f},{splice:function(t,e){var n,s,r,o,h,f,S=d(this),m=u(S.length),b=a(t,m),k=arguments.length;if(0===k?n=s=0:1===k?(n=0,s=m-b):(n=k-2,s=v(p(i(e),0),m-b)),m+n-s>g)throw TypeError(_);for(r=c(S,s),o=0;om-s+n;o--)delete S[o-1]}else if(n>s)for(o=m-s;o>b;o--)h=o+s-1,f=o+n-1,h in S?S[f]=S[h]:delete S[f];for(o=0;o1?arguments[1]:void 0)}})},ab13:function(t,e,n){var s=n("b622"),a=s("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[a]=!1,"/./"[t](e)}catch(s){}}return!1}},bbf1:function(t,e,n){t.exports=n.p+"img/u1806.3682ab06.svg"},cb5b:function(t,e,n){"use strict";var s=n("ee8d"),a=n.n(s);a.a},cd37:function(t,e,n){"use strict";n.d(e,"i",(function(){return a})),n.d(e,"f",(function(){return i})),n.d(e,"j",(function(){return u})),n.d(e,"d",(function(){return d})),n.d(e,"c",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"h",(function(){return r})),n.d(e,"k",(function(){return o})),n.d(e,"g",(function(){return h})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return p})),n.d(e,"l",(function(){return v}));var s=n("c1fb");function a(){return s["a"].post("print/ajaxReadingTextbookModuleUnit")}function i(t){return s["a"].post("print/ajaxNewGetModuleAndUnit",t)}function u(t){return s["a"].post("print/ajaxNewGetUnitByModuleId",t)}function d(t){return s["a"].post("print/ajaxReadingClasses",t)}function c(t){return s["a"].post("print/ajaxReadingBasicTopics",t)}function l(t){return s["a"].post("print/ajaxReadingHotTopics",t)}function r(){return s["a"].post("print/ajaxReadingSubjectContext")}function o(t){return s["a"].post("print/ajaxNewSaveEnglishReading",t)}function h(t){return s["a"].post("print/ajaxSmartTypeStudents",t)}function f(t){return s["a"].post("print/ajaxEnglishReadingSetInit",t)}function p(t){return s["a"].post("print/ajaxEnglishReadingStudentSettingSave",t)}function v(t){return s["a"].post("print/englishReadingStudentImport",t)}},d81d:function(t,e,n){"use strict";var s=n("23e7"),a=n("b727").map,i=n("1dde"),u=n("ae40"),d=i("map"),c=u("map");s({target:"Array",proto:!0,forced:!d||!c},{map:function(t){return a(this,t,arguments.length>1?arguments[1]:void 0)}})},ee8d:function(t,e,n){}}]);