chunk-3e57e041.646ee3d9.js 16 KB

123456
  1. /*!
  2. * build: Hopaheal
  3. * copyright: Mead
  4. * time: 2022-6-7 11:38:49
  5. */
  6. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3e57e041"],{"50a3":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"role-management-container"},[a("vab-query-form",[a("vab-query-form-left-panel",{attrs:{span:6}},[a("el-form",[a("el-form-item",[a("el-button",{staticStyle:{"margin-right":"5px"},attrs:{icon:"el-icon-plus",type:"success"},on:{click:e.handleEdit}},[e._v(" 添加 ")]),a("el-button",{attrs:{icon:"el-icon-download",type:"warning"},on:{click:e.chooseterm}},[e._v(" 批量导出 ")])],1)],1)],1),a("vab-query-form-right-panel",{attrs:{span:18}},[a("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",[a("el-input",{staticStyle:{width:"160px","margin-right":"5px"},attrs:{clearable:"",placeholder:"请输入学生姓名"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.student_name,callback:function(t){e.$set(e.queryForm,"student_name","string"===typeof t?t.trim():t)},expression:"queryForm.student_name"}})],1),a("el-form-item",[a("el-input",{staticStyle:{width:"160px","margin-right":"5px"},attrs:{clearable:"",placeholder:"请输入学生学号"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.student_account,callback:function(t){e.$set(e.queryForm,"student_account","string"===typeof t?t.trim():t)},expression:"queryForm.student_account"}})],1),a("el-form-item",[a("el-input",{staticStyle:{width:"160px","margin-right":"5px"},attrs:{clearable:"",placeholder:"请输入导师姓名"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.teacher_name,callback:function(t){e.$set(e.queryForm,"teacher_name","string"===typeof t?t.trim():t)},expression:"queryForm.teacher_name"}})],1),a("el-form-item",[a("el-input",{staticStyle:{width:"160px","margin-right":"5px"},attrs:{clearable:"",placeholder:"请输入导师工号"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.teacher_account,callback:function(t){e.$set(e.queryForm,"teacher_account","string"===typeof t?t.trim():t)},expression:"queryForm.teacher_account"}})],1),a("el-form-item",[a("el-select",{attrs:{clearable:"",placeholder:"请选择学期"},model:{value:e.queryForm.term_id,callback:function(t){e.$set(e.queryForm,"term_id",t)},expression:"queryForm.term_id"}},e._l(e.termData,(function(e){return a("el-option",{key:e.id,attrs:{clearable:"",label:e.name,value:e.id}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),a("el-dialog",{attrs:{"close-on-click-modal":!1,title:"添加",visible:e.addFlag,width:"500px"},on:{"update:visible":function(t){e.addFlag=t}},scopedSlots:e._u([{key:"footer",fn:function(){return[a("el-button",{on:{click:function(t){return e.close("form")}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.add}},[e._v("确 定")])]},proxy:!0}])},[a("el-form",{ref:"form",attrs:{"label-width":"60px",model:e.form,rules:e.rules}},[a("el-form-item",{attrs:{label:"学期",prop:"term_id"}},[a("el-select",{ref:"selectblur",staticStyle:{width:"100%"},attrs:{placeholder:"请选择学期"},on:{change:e.term_change},model:{value:e.form.term_id,callback:function(t){e.$set(e.form,"term_id",t)},expression:"form.term_id"}},e._l(e.termData,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"导师",prop:"teacher_id"}},[a("el-select",{ref:"selectblur",staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择导师","popper-append-to-body":!1,"popper-class":"eloption",remote:"","remote-method":e.remoteMethod},on:{change:e.teacher_change,focus:e.tea_blur},model:{value:e.form.teacher_id,callback:function(t){e.$set(e.form,"teacher_id",t)},expression:"form.teacher_id"}},[e._l(e.teacherData,(function(t){return a("el-option",{key:t.id,attrs:{label:t.truename,value:t.id}},[a("span",{staticStyle:{float:"left"}},[e._v(e._s(t.truename))]),a("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(" "+e._s(t.account)+" ")])])})),a("el-pagination",{attrs:{background:"","current-page":e.queryForm1.page,layout:e.layout1,"page-size":e.queryForm1.per_page,"page-sizes":[15,20,30,40,50,100],small:"",total:e.queryForm1.total},on:{"current-change":e.handleCurrentChange1,"size-change":e.handleSizeChange1}})],2)],1),a("el-form-item",{attrs:{label:"学生",prop:"student_id"}},[a("el-select",{ref:"selectblur",staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择学生","popper-append-to-body":!1,"popper-class":"eloption",remote:"","remote-method":e.remoteMethod1},on:{change:e.student_change,focus:e.stu_blur},model:{value:e.form.student_id,callback:function(t){e.$set(e.form,"student_id",t)},expression:"form.student_id"}},[e._l(e.studentData,(function(t){return a("el-option",{key:t.id,attrs:{label:t.truename,value:t.id}},[a("span",{staticStyle:{float:"left"}},[e._v(e._s(t.truename))]),a("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(" "+e._s(t.account)+" ")])])})),a("el-pagination",{attrs:{background:"","current-page":e.queryForm2.page,layout:e.layout1,"page-size":e.queryForm2.per_page,"page-sizes":[15,20,30,40,50,100],small:"",total:e.queryForm2.total},on:{"current-change":e.handleCurrentChange2,"size-change":e.handleSizeChange2}})],2)],1)],1)],1),a("el-dialog",{attrs:{"before-close":e.handleClose2,center:"",title:"学期选择",visible:e.portFlag,width:"30%"},on:{"update:visible":function(t){e.portFlag=t}}},[a("div",{staticClass:"reset"},[a("el-form",{ref:"form_reset",attrs:{"label-width":"50px",model:e.form1,rules:e.rules}},[a("el-form-item",{attrs:{label:"学期",prop:"term_id"}},[a("el-select",{ref:"selectblur",staticStyle:{width:"100%"},attrs:{placeholder:"请选择学期"},on:{change:e.term_choose},model:{value:e.form1.term_id,callback:function(t){e.$set(e.form1,"term_id",t)},expression:"form1.term_id"}},e._l(e.termData,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.do_choose}},[e._v("确 定")])],1)]),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.list},on:{"selection-change":e.setSelectRows},scopedSlots:e._u([{key:"empty",fn:function(){return[a("el-image",{staticClass:"vab-data-empty",attrs:{src:r("f1f0")}})]},proxy:!0}])},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection"}}),a("el-table-column",{attrs:{align:"center",label:"序号",sortable:"",type:"index",width:"60"}}),a("el-table-column",{attrs:{align:"center",label:"学年",prop:"term.name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"学生姓名",prop:"student.truename","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"学号",prop:"student.account","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"导师姓名",prop:"teacher.truename","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"导师工号",prop:"teacher.account","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"时间",prop:"created_at","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"状态",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[1==r.status?a("el-tag",[e._v(" "+e._s("正常")+" ")]):e._e(),0==r.status?a("el-tag",{attrs:{type:"danger"}},[e._v(" "+e._s("否")+" ")]):e._e()]}}])})],1),a("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.queryForm.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1)},n=[],o=r("1da1"),l=r("5530"),i=(r("ac1f"),r("466d"),r("d3b7"),r("3ca3"),r("ddb0"),r("2b3d"),r("9861"),r("96cf"),r("863d")),s=r("6111"),u=r("bc3a"),c=r.n(u),d=r("f121"),m=r("2f62"),p={name:"TeacherChoose",data:function(){return{termData:[],list:[],listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",layout1:"total, prev, pager, next",queryForm:{page:1,per_page:15},queryForm1:{page:1,per_page:15},queryForm2:{page:1,per_page:15},addFlag:!1,portFlag:!1,form:{},form1:{},rules:{term_id:[{required:!0,trigger:"blur",message:"请选择学期"}],teacher_id:[{required:!0,trigger:"blur",message:"请选择导师"}],student_id:[{required:!0,trigger:"blur",message:"请选择学生"}],status:[{required:!0,trigger:"blur",message:"请选择状态"}]},teacherData:[],studentData:[],term:""}},computed:Object(l["a"])({},Object(m["c"])({token:"user/token"})),created:function(){this.getTerm(),this.getList(),this.getTeacher(),this.getStudent()},methods:{setSelectRows:function(e){console.log(e,"val"),this.selectRows=e},handleEdit:function(){this.addFlag=!0},close:function(e){var t=this;this.$nextTick((function(){void 0!==t.$refs[e]&&t.$refs[e].resetFields()})),this.form=this.$options.data().form,this.fileList=[],this.addFlag=!1},handleClose2:function(){var e=this;this.$nextTick((function(){void 0!==e.$refs["form_reset"]&&e.$refs["form_reset"].resetFields()})),this.form1=this.$options.data().form1,this.portFlag=!1},add:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=8;break}return t.next=3,Object(i["doAdd"])(e.form);case 3:a=t.sent,n=a.message,e.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.getList(),e.close();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},term_change:function(e){console.log(e,"e1"),this.$refs.form.clearValidate("term_id")},teacher_change:function(e){console.log(e,"e2"),this.$refs.form.clearValidate("teacher_id")},student_change:function(e){console.log(e,"e3"),this.$refs.form.clearValidate("student_id")},handleSizeChange1:function(e){this.queryForm1.per_page=e,this.getTeacher()},handleCurrentChange1:function(e){this.queryForm1.page=e,this.getTeacher()},handleSizeChange2:function(e){this.queryForm2.per_page=e,this.getStudent()},handleCurrentChange2:function(e){this.queryForm2.page=e,this.getStudent()},getList:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["teacherChooseList"])(e.queryForm);case 2:r=t.sent,a=r.data,e.list=a.list,n=a.meta,e.queryForm.total=n.pagination.total,e.listLoading=!1;case 8:case"end":return t.stop()}}),t)})))()},getTerm:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["getTermList"])();case 2:r=t.sent,a=r.data,console.log(a,"学年列表"),e.termData=a;case 6:case"end":return t.stop()}}),t)})))()},remoteMethod:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:console.log(e,"query"),""!==e?(t.queryForm1.truename=e,t.queryForm1.page=1,t.getTeacher()):t.teacherData=[];case 2:case"end":return r.stop()}}),r)})))()},remoteMethod1:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:console.log(e,"query"),""!==e?(t.queryForm2.truename=e,t.queryForm2.page=1,t.getStudent()):t.studentData=[];case 2:case"end":return r.stop()}}),r)})))()},tea_blur:function(){this.getTeacher()},stu_blur:function(){this.getStudent()},getTeacher:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["getTeacherList"])(e.queryForm1);case 2:r=t.sent,a=r.data,e.teacherData=a.list,console.log(e.teacherData,"导师列表"),n=a.meta,e.queryForm1.total=n.pagination.total;case 8:case"end":return t.stop()}}),t)})))()},getStudent:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["getStudentList"])(e.queryForm2);case 2:r=t.sent,a=r.data,e.studentData=a.list,console.log(e.studentData,"学生列表"),n=a.meta,e.queryForm2.total=n.pagination.total;case 8:case"end":return t.stop()}}),t)})))()},handleSizeChange:function(e){this.queryForm.per_page=e,this.getList()},handleCurrentChange:function(e){this.queryForm.page=e,this.getList()},queryData:function(){this.queryForm.page=1,this.getList()},chooseterm:function(){this.portFlag=!0},term_choose:function(e){this.term=e},do_choose:function(){this.download(this.term)},download:function(e){var t=this;console.log(e,"test"),c()({baseURL:d["baseURL"],timeout:5e3,method:"get",url:"/mentor/subscribe-export",headers:{Authorization:"Bearer ".concat(this.token)},params:{term_id:e},responseType:"blob"}).then((function(e){t.convertRes2Blob(e),t.portFlag=!1}))},convertRes2Blob:function(e){var t=e.headers["content-disposition"].match(/filename=(.*)(.*)/);console.log(t,"Mead");var r=t[1],a=new Blob([e.data],{type:"application/vnd.ms-excel"});if("undefined"!==typeof window.navigator.msSaveBlob)window.navigator.msSaveBlob(a,decodeURI(r));else{var n=window.URL.createObjectURL(a),o=document.createElement("a");o.style.display="none",o.href=n,o.setAttribute("download",decodeURI(r)),"undefined"===typeof o.download&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(n)}}}},f=p,h=(r("aa0c"),r("2877")),g=Object(h["a"])(f,a,n,!1,null,"21480d3e",null);t["default"]=g.exports},6111:function(e,t,r){"use strict";r.r(t),r.d(t,"getList",(function(){return n})),r.d(t,"getTermList",(function(){return o})),r.d(t,"getTeacherList",(function(){return l})),r.d(t,"getStudentList",(function(){return i})),r.d(t,"getIs_answer",(function(){return s})),r.d(t,"get_teaIsanswer",(function(){return u}));var a=r("b775");function n(e){return Object(a["default"])({url:"/mentor/subscribe",method:"get",params:e})}function o(e){return Object(a["default"])({url:"/mentor/term-select-options",method:"get",params:e})}function l(e){return Object(a["default"])({url:"/mentor/teacher?type=1",method:"get",params:e})}function i(e){return Object(a["default"])({url:"/mentor/student",method:"get",params:e})}function s(e){return Object(a["default"])({url:"/mentor/student-answers",method:"get",params:e})}function u(e){return Object(a["default"])({url:"/mentor/teacher-answers",method:"get",params:e})}},"863d":function(e,t,r){"use strict";r.r(t),r.d(t,"teacherChooseList",(function(){return n})),r.d(t,"doAdd",(function(){return o}));var a=r("b775");function n(e){return Object(a["default"])({url:"/mentor/subscribe",method:"get",params:e})}function o(e){return Object(a["default"])({url:"/mentor/subscribe",method:"post",data:e})}},aa0c:function(e,t,r){"use strict";r("b398")},b398:function(e,t,r){},f1f0:function(e,t,r){e.exports=r.p+"static/img/data_empty.475a2a1e.png"}}]);